Do NOT ask me for personal details when calling me

Here’s an example of a phone call I receive every now and then:

Ring Ring

Hello?
Hi, may I speak to Mansour please?
Speaking.
I’m calling from [organization] regarding [reason for call].
Sure.
Before continuing, I need to confirm your identity. Can you please state your full name, date of birth and address?

At this point, I’m wondering if the company has a picture of a donkey on my file, seeing that I’m being treated like an idiot. Only an idiot would just give out personal details without being 100% sure who the entity on the other end is. And guess what, the only way to be sure that it’s your bank you’re talking to, is to call them yourself. Period.

read the rest …

Upload Outlook archive PST to IMAP server

At one point or another, you may have used Microsoft Outlook to send and receive emails and if you have ever saved an archive file, you know that it is not so easily convertible to other formats. In this post, I’m going to show you a painless and quick way to move all your emails from a PST file to an IMAP server preserving everything, including the date and time the emails were originally sent.

read the rest …

How to extract/decompress cloop images (python version)

I’m working on a little project to multiboot anything and everything unix in the universe on a single media. This is one of the several utilities that I have written to help with that. It’s a python version of the original decompressor for compressed loopback device (cloop). To extract/decompress the cloop image, you can do:

python cloop-decompress ~/tmp/KNOPPIX ~/tmp/KNOPPIX.raw

Now you can loop mount the raw image as you normally would:

mount -o loop ~/tmp/KNOPPIX.raw /mnt

Talk with guest OS in VirtualBox through serial port

Setup the serial configuration. Boot the VM. Then run the following to turn the unix socket into a terminal:

socat UNIX-CONNECT:/tmp/com1 PTY,link=/tmp/com1-pty

The above should block for the entire time of the conversation. If it doesn’t, there’s an issue. Fix it!

Then run a terminal program to talk with it:

screen /tmp/com1-pty

As an alternative to using screen, you can use the following in place of socat and screen above:

socat UNIX-CONNECT:/tmp/com1 STDIO,raw,echo=0

VirtualBox Serial Ports configuration page

Serial Port Configuration

Allowing root access to FUSE mounts

There are some places even root can’t get to. One such place is a FUSE mounted volume. I found this out when trying to access an sshfs mounted directory as root and got permission denied.

To get around this, do the following (which I learnt by asking about it on serverfault):

  1. Add user_allow_other to /etc/fuse.conf
  2. Run sshfs (or any other FUSE mounting command) with -o allow_root option.

Find own public IP address

Here are a few tricks to programatically find your public IP address:

curl -s http://jsonip.com | sed 's/.*"ip":"\([^"]\+\)".*/\1\n/'
curl -s http://ipinfo.io

Merge PDF files

A little ghostscript trick to merge multiple PDF files into one:

gs -q -sPAPERSIZE=letter -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
   -sOutputFile=out.pdf in1.pdf in2.pdf in3.pdf ...