Posts

Showing posts from September, 2013

ipcalc where have you been hiding

Somehow I've lived this long and never stumbled upon ipcalc.  It made scripting a secondary interface and route file very easy. I wanted to be able to dynamically configure /etc/sysconfig/network-scripts/route-eth1 during boot.  I was working on my own convoluted sed script to get the right values, but ipcalc was already there and simplified my work. Normally, I'd put something like: ADDRESS0=6.6.1.0 NETMASK0=255.255.255.0 GATEWAY0=6.6.1.1 But in Amazon, some of these values can vary and for puppet to be able to distribute to any of my environments across my AZs: VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" SUBNET_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH1_MAC}/subnet-ipv4-cidr-block" ADDRESS0=`ipcalc -n ${VPC_CIDR_RANGE} | sed -e's/^NETWORK/ADDRESS0/'` NETMASK0=`ipcalc -m ${VPC_CIDR_RANGE} | sed -e's/^NETMASK/NETMASK0/'` GAT

Getting tab copy and paste right with rxvt-unicode option

I  have always liked xterm, but moved to rxvt years ago for a couple of its features.  Recently I moved to urxvt256c for all my terminal needs. When I use the AWS cli tools, which output tabs as whitespace, my double click selection has started including the tabs.  Maybe it has done this for a while, I don't know exactly when it started, but it is annoying since a double click selection which grabs a tab can screw up a command line paste if there is 1 file in the directory. So you get: ssh $(i2ip thisisthe1localfile.txt i-1234567) instead of ssh $(i2ip i-1234567) thanks to bash's autocomplete. After some googling I found what I should have found originally: https://github.com/jhelwig/rxvt-unicode-ppa/blob/master/doc/rxvt.1.pod -ptab|+ptab If enabled (default), "Horizontal Tab" characters are being stored as actual wide characters in the screen buffer, which makes it possible to select and paste them. Since a horizontal tab is a cursor movement and not an