Git: generate and apply patch from commit

Creating

git format-patch -n commit-id

E.g.
$ git format-patch -1 HEAD
$ git format-patch -2 86c5960

Applying

git am < patch

More: http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specific-commit

Advertisements

/sbin/ip route add … RTNETLINK answers: File exists

When starting opevpn I encountered strange issue. VPN was connecting but I could not access services behind it.
What I found in its log was:

Thu Oct 16 12:15:50 2014 /sbin/ip route add 10.1.1.0/24 via 10.1.1.1
RTNETLINK answers: File exists

It turned out the newly added route was conflicting with other route (a leftover from messing up vpn-things).

First, I removed the conflicting rule:

sudo route del -net 10.1.1.0 netmask 255.255.255.0

Then I manually added the route the vpn was trying to add (but I think it’s optional and simply restarting the VPN would do the thing)

/sbin/ip route add 10.1.1.0/24 via 10.1.1.1