2008/01/31

Following the golden thread

1. create TAGS

$ cd ~/src/TAGS && find . -name "*.[cph]" -print | etags --language=c++ --members -

2. tell xemacs where it is (e.g. .xemacs/init.el): (setq tags-file-name "~/src/TAGS")

3. Hit <meta>. to start finding things

4. read this for more options

2008/01/25

Network Slight of Hand

The mysql proxy cookbook has this recipe:

iptables -t nat -I PREROUTING \
-s ! 127.0.0.1 -p tcp \
--dport 3306 -j \
REDIRECT --to-ports 4040


It redirects remote clients attempting to connect to the default mysqld listen port to the mysql proxy daemon instead.

I had a legacy application with no support for port selection:

iptables -t nat -I PREROUTING \
-p tcp --destination dummyhostname --dport 3306 \
-j REDIRECT --to-ports 4040


This directs any connection to the dummy host port 3306 to instead go to the proxy - neat.

From this HP-UX security summary we see that HP-UX has ipfilter (new enough versions seem to have nat - older ones don't) and puts filter rules in /etc/opt/ipf/ipf.conf :

rdr lan0 20.20.20.5/32 port 80 -> 192.168.0.5 port 8000


redirects traffic from port 80 to port 8000, or how about some load balancing:

rdr lan0 20.20.20.5/32 port 80 -> 192.168.0.5,192.168.0.6 port 8000

A useful trick where the legacy application doesn't know about off host destinations and you would like to punt some of the load to another box.

ipf won't act as a reflector, which appears to mean that something like this doesn't work, even when I think that it should:

/etc/opt/ipf/ipnat.conf:
rdr lo0 127.0.0.1/32 port 7777 -> 192.168.0.42 port 23

# ipnat -CF -f /etc/opt/ipf/ipnat.conf
# ipnat -l
# ipnat -sv


Curious, as the interfaces are different.

Its also not clear if you have to enable ip forwarding on HP-UX with:

# ndd -set /dev/ip ip_forwarding 1
# ndd -get /dev/ip ip_forwarding

2008/01/03

gentoo recovery

gentoo based rescue disk options - the lwn distributions page is a good starting point:
  1. sabayonlinux - appears to be kept up to date & comes in a mini-edition
  2. the official 2007.0 gentoo live CD is getting on a bit now (SATA) [update 2008.0 beta]
  3. the liveusb path is paved with bitrot.
  4. flashlinux from 2005.
  5. gnap - catalyst based...
  6. sysresccd - catalyst based... USB install instructions look good (and is what I used in the end)
  7. linux-live is a possible for pre-686 hardware
other random reading:
  1. lwn has a good/scary article on gentoo for developers
  2. paludis vs portage article
  3. random blog posts sometimes pertaining to gentoo; drobbins blog