Swap Two Numbers Without Temporary Variable

If you want to swap two variables, you would normally require a temporary third variable. But how to swap them without using a third variable? This is quite often a popular interview question for programming jobs.

Find Number of Hops Using Ping

In the computer networking field, traceroute is a diagnostic tool for displaying the hops and the round-trip time for each hop. Ping, on the other hand, computes round-trip times only from the destination point. But if you are just interested in finding out the number of hops to a destination and not the round-trip times, ping is an alternative utility to traceroute.

How to Get Linux Boot Time

Linux uptime command will show how long the system has been running. But if you want to find out the boot time of the system instead, you will have to perform a bit of arithmetic – subtract the output of the uptime command from the current time. Sounds too troublesome? There’s an easier way to do it using the Linux proc filesystem.

Week Numbers in Google Calendar

I use Google Calendar for both personal and business use but it lacks a critical piece of information by default – the week number. Week numbers are important when it comes to project schedules and also to track major milestones. But there is a way to add this missing feature and it’s quite simple actually.

How to Compute IMEI from IMEISV

The IMEI (International Mobile Station Equipment Identity) is a 15-digit number to uniquely identify a mobile phone device. IMEISV (IMEI Software Version) is a 16-digit number with the IMEI and an additional software version number.

Unix: Print Directory Tree Structure

shell script

The tree command has been around in Windows for a very long time to print out the directory structure but this is still not available in most of the Unix variants. Most of the new Linux distributions do seem to have the tree command available.

SSH Port Forwarding for FTP

Tunneling a FTP connection over SSH is not something that is straight forward. To understand the problem better, we need to analyse how FTP works.