Skip to content

Instantly share code, notes, and snippets.

@taldanzig
taldanzig / gist:4033311
Created November 7, 2012 18:10
Move email signature below quoted text on reply in Sparrow on OS X

From a Terminal run:

defaults write com.sparrowmailapp.sparrow ComposerReplySignatureBottom YES

Via @dinh_viet_hoa on Twitter.

@taldanzig
taldanzig / gitpushpull.md
Created January 23, 2013 06:38
Make push/pull work with a remote non-bare repository

Make push/pull work with a remote non-bare repository

Sometimes it is necessary (and desireable) to work on a git repository on multiple development machines. We want to be able to push and pull between repositories without having to use an intermediary bare repository, and for this to work symetrically in both repositories.

First clone we clone an existing repository:

git clone ssh://user@hostname:/path/to/repo

By default this will name the remote as origin, but let's assume we want to reserve that name for a master repository that commits will eventually get pushed to:

@taldanzig
taldanzig / osxvpnrouting.markdown
Created January 24, 2013 22:14
Routing tips for VPNs on OS X

Routing tips for VPNs on OS X

When VPNs Just Work™, they're a fantastic way of allowing access to a private network from remote locations. When they don't work it can be an experience in frustration. I've had situations where I can connect to a VPN from my Mac, but various networking situations cause routing conflicts. Here are a couple of cases and how I've been able to get around them.

Specific cases

Case 1: conflicting additional routes.

In this example the VPN we are connecting to has a subnet that does not conflict with our local IP, but has additional routes that conflict in some way with our local network's routing. In my example the remote subnet is 10.0.x.0/24, my local subnet is 10.0.y.0/24, and the conflicting route is 10.0.0.0/8. Without the later route, I can't access all hosts on the VPN without manually adding the route after connecting to the VPN:

One-liner to clean /boot on Ubuntu systems

Ubuntu systems (especially those with auto-updates enabled) fill up /boot with kernel images over time.

Here is a quick and dirty command to clean installed kernel packages on Ubuntu systems. It will keep the currently running kernel and the newest installed kernel package:

apt-get --purge remove $(dpkg-query --list 'linux-image-3*' | grep '^ii' | sed '$d' | grep -v $(uname -r) | sed -e 's/.linux-image-(3(.[0-9]+)+-[0-9]+).$/\1/' | sed -e 's/^(.)$/linux-.-\1.*/')

Adding space to an LVM backed extX or btrfs filesystem

Add some physical or virtual storage (resize a VM image, add a new VM image, add a disk)

Create a new LVM physical volume

lvm pvcreate /dev/sdb # substitute appropriate device name

Fixed IP addresses in VMWare Fusion 7

Edit /Library/Preferences/VMware Fusion/vmnet8/dhcpd.conf add a section at the end similar to the following:

host debian8-taldev {
	hardware ethernet 00:0c:29:ed:98:82;
	fixed-address 10.38.1.10;
}

Keybase proof

I hereby claim:

  • I am taldanzig on github.
  • I am taldanzig (https://keybase.io/taldanzig) on keybase.
  • I have a public key ASDWqtjmazyhWe5rNor_gdJKGZXe3kncZ2LNzTfubjVYLAo

To claim this, I am signing this object: