and still may not

Month: May 2011

The latest version of Firefox (4.0.1) had me coming back to the first browser I loved, after breaking up with it in favor of (in order) Chrome, Chromium and Opera. It’s really sleek, minimalistic and fast (!).

One thing I’ve grown used to is to perform google searches directly from the address bar, and it is something I can no longer bear to live without.

My ISP has its own lame search engine, and everytime I tried to search for something it redirected me to its ugly page filled up with Google Ads (quite a coincidence, right?) and even after following the tuning hints given by Mozilla itself there was no way out of it.

So, I switched to OpenDNS (btw, in the golden times they used to show you their IPs first thing, now with all those blatant marketing stuff you have to resort on wikipedia to get 208.67.222.222 and 208.67.220.220) but now I got redirected to OpenDNS’s own lame search page!

In the end, the only way I found to use Google was to use… Google’s own public DNS servers, located at 8.8.8.8 and 8.8.4.4 (all my data passing through Google is getting scarier year after year, but you know, having several Gmail accounts using BigG as DNS provider isn’t making things worse than they currently are…)

[Update – June 2017] – as nvoss noted in the comments, as of coreutils version 8.24 (published 2 years ago), dd supports a nice status=progress option which does exactly what this post is about… At last! 🙂

dd is one tool I really love and one that really scares the hell out of me. It’s so powerful you have to show him respect, otherwise you’ll end up destroying all your precious data!
One thing it’s not very good at however is to show you some info on what’s going on and, most of all, how fast your files are being shredded to pieces never to come back again 🙂

So, say we’re using dd like this:

dd if=/path/to/input_file of=/path/to/output_file bs=4096

To get the usual

N record in
N record out
N bytes copied, M seconds, P transfer rate

we all learned to love, you can just

sudo killall -USR1 $DD_PID

from within another terminal and dd will display its statistics to the terminal you launched it from. Of course, you may add some

watch --interval=10 killall -USR1 $DD_PID

to update statistics at regular intervals.

But this is just boring.. What about some sort of progress bar? 😉

The trick is to break down dd in its input and output parts, and throw a pv in the middle, like this:

When dealing with several servers that don’t all see each other it is often a bit painful to jump from one SSH session to another, even more so if you have to type some password every time.
In case you are allowed to edit .ssh/authorized_keys (I don’t see a valid reason why you shouldn’t, but in the wonderful world of system administrators.. who knows?) your struggle is about to end. Provided, of course, that you use Linux 🙂

Let’s say you want to reach hostB (unreachable from your own host) by tunneling over hostA (which you have direct access to).

Edit your .ssh/config file to include a stanza for each host; it should look like this:

This will also let you type ssh h<TAB> having the shell auto-complete magic fill the remaining “ost” for you (the remaining A or B is up to you). Right now you may already tunnel over A to reach B, but still you would have to type in passwords for both host A and hostB every time you ssh hostB.

Generate your id_rsa.pub in case you don’t have one, and add it to the authorized_keys list of both hostA and hostB: