Skip to content

Sending files using netcat

There are plenty of articles about this already, but I couldn't find anyone who wrote a script to automate this simple task of transferring files using just netcat.

CODE:
wilmer@ruby:~/src/bitlbee/devel$ ncsend.sh /audio/03\ Tree\ of\ Life.mp3 
nc 87.198.255.202 6886 | pv > 03\ Tree\ of\ Life.mp3


Run it and it will give you a command to run/copy-paste on the remote side/pass to the person who wants the file. It uses pv as a nice progress indicator, and the script assumes pv is available on both sending and receiving ends. But that's good, everyone should have pv installed on his/her machine.

I'd just include the code in this little article, but Serendipity would screw up the layout completely, so instead you can download it here.

Gotta love Unix hacks...

Forgetting your LUKS cryptopart password sucks. But writing a shell oneliner like this:

CODE:
for i in P{a,4}ssw{0,o}rd{-,}Permut{4,a}tions; do
  echo -n $i > /tmp/pwd
  cryptsetup luksOpen /dev/loop0 test --keyfile /tmp/pwd && echo $i
done


is awesome. :-) Took me only ten minutes to get it back once I had a copy of the superblock onto my workstation.

spamass-milter and IPv6

While migrating my mailserver from Ubuntu Dapper to Debian Lenny, I noticed spamass-milter didn't want to start:

Could not parse "2001:770:017b::" as a network

After scratching my head on that for a while (it worked on the old box!) I remembered two years ago I spent some time adding IPv6 support to spamass-milter myself. Support as-in allowing IPv6 subnets to be whitelisted/auto-accepted. Very useful if you want mails from your local IPv6 machines to be accepted automatically without waiting for 10s while spamassasin is checking if you're not a spammer...

I never published the thing and now I could hardly find back the damn thing at all. :-)

http://wilmer.gaast.net/downloads/spamass-milter-ipv6.diff

Just to make sure I won't lose it again ... and maybe it'll be useful for someone else.

Also just de-Ubuntufied my laptop. Debian's doing great so far: Suspend and Resume actually work better out of the box, but fonts look a bit ugly (and sometimes really less readable I'm afraid) compared to Ubuntu...

edns-client-ip

Finally, the Internet-Draft I was working on with my team over the last months made it to the public.

http://googlecode.blogspot.com/2010/01/proposal-to-extend-dns-protocol.html
http://www.ietf.org/id/draft-vandergaast-edns-client-ip-00.txt

This draft was the main purpose of my visit to IETF76 last year. I'll have to go to 77/78 this year then to hopefully get this idea accepted as a working group item.

It's interesting to see all the comments coming up claiming that this is evil and meant for tracking purposes just because it has the name Google on it... :-/

Running 32-bit 3D apps on 64-bit Debian NVIDIA systems

Because Intel on-board video isn't quite good enough at 3D and my somewhat old laptop with built-in NVIDIA chip wasn't doing all that well at X-Plane either, I bought an NVIDIA GT240 card. Mostly because it seemed to be a good performer without doubling the power consumption of my PC. Stuff wasn't working all that well though and I got pretty frustrated:

QUOTE:
X Error of failed request: BadLength (poly request too large or internal Xlib length error)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 2 (X_GLXRenderLarge)
Serial number of failed request: 1468
Current serial number in output stream: 1483


was all X-Plane could tell me. Google Earth also didn't work and seemed more like Google Black hole to me. Both are 32-bit apps. A 64-bit binary of Flightgear did work. Sigh.

After some poking I noticed the nvidia-glx package replaces /usr/lib{64,}/libGL* with its own versions, but didn't touch /usr/lib32. A-ha!

The fix: Get a 32-bit version of nvidia-glx, extract it somewhere (dpkg -X) and copy all the files in its usr/lib to /usr/lib32, overwriting the libGL symlink that is currently there.

Or, hmm, as I just found out: apt-get install nvidia-glx-ia32. I'm glad someone thought of it already.

Now X-Plane works perfectly (with maybe even ten times the frame rate I had with Intel on-board) and Google Earth can show me my house again.

Just blogging this since so far a Google search for any part of the error above didn't give useful results.

Now, I just have to find out if I can get a TV signal out of this thing somehow, since my TV was made long before HDMI was invented. :-/

Google Public DNS

Today at work my first user facing product was released, Google Public DNS. I've worked a lot on it over the last months and it was actually the reason for my visit to NY this Summer. :-)

But now, finally after a long time, I can actually start calling the thing by its name instead of saying "my secret project at work", which makes me very happy.

Praise, complaints and comments about the service are welcome! :-)

Back from Japan

I'm back ... for almost two weeks already. Getting used again to bad weather (today's a very foggy and cold day in Dublin), working and all the other things of daily life. Japan was fantastic. I'll be careful to not sound like your average "everything's better in Japan" idiot, but admittedly, there were some things there I really liked.

One of the first things I noticed was that a rule about escalators I really like is actually enforced over there. Wherever I've been so far escalators are always full of people who don't understand how stairs work; they think the fact that the escalator goes up means they can just put their lazy feet on it and wait (forgetting that for lazy people we already invented elevators :-P). Many civilizations have tried introducing a "stand still on the left, walk on the right" rule, but Japan's the only place where I've seen people all obeying it.

Getting around there indeed turned out to be challenging at times. Even though people (at least from "my generation") learn English for about ten years at school, many people still don't or hardly speak it. This was never really a problem though. Menus in restaurants have pictures and pointing at things is the most successful international language ever invented. :-) One of the first days I had sushi in a place just a few steps away from my hotel in Tokyo. While eating my meal, the man behind the bar (probably also the owner of the place) came to me with a map, asking me to point at where I come from. Also, the little origami bird he folded for me from my chopsticks wrapper is still sitting on my desk here. :-D

The ramen place I went to for breakfast one of the first days was also amazing. Not so much because of the food (which was also good), but because of the size. Literally, it was a room of maybe just over 2m wide, about 10m deep, with a bar separating it into two small 10m × something areas. Two people working on one side, and ten seats on the other (all occupied, most of the time).

My camera claims I made over 700 pictures there. Obviously there are many duplicates and worthless pictures, and after soring there will probably only be around 100 left. I hope to put them online soon, and probably with some more stories. I wrote too much now already.

All I know is that I'm definitely going there again.

Disabling the stupidest FireFox feature ever (adding www/com to URLs)

Every few days it happens to me that I mistype a URL, and Firefox thinks it can fix it by adding www. and/or .com to it. This often brings me to some stupid webpage instead of the intranet page I was looking for, or just generates another broken URL that needs more work for me to fix because I have to undo what Firefox did and then still fix my typo.

I finally found out how to disable that stupid feature and am sure more people are wondering about that. Since it took me a while to find out how to do this, I guess I'll just write a (maybe easier to find) blog post about it.

In short: about:config -> browser.fixup.alternate.enabled.

Fixup. Yeah right.

For a similar feature that adds some other TLD to the URL if you accidentally have alt/ctrl or something pressed when you press Enter, there's a plugin called ClumsyFingers, I think. Fortunately my fingers aren't clumsy enough yet that I need that one.

I'm still in Japan, now in Hiroshima for the IETF meeting. Japan's fantastic. :-D