Adding a permanent network route in Windows

It’s not that common to add a network route in windows, but if you have more than one network interface and there are many networks hidden over there, you will need to do it

The syntax is quite simple

route -p add the_network mask the_netmask the_gateway metric the_metric

As an example, we will use the following information:

the_metric 10

And the resulting command is:

route -p add mask metric 10

-p means the network will be added permanently in windows registry, if you want to play with this new network until the next reboot, don’t use it.
If you do not what to do with metric , simply use 10

To check the routing table, use the command

route print

Squid 3.3 in Raspbian Wheezy

I have been playing recently with Squid and “Splash pages”, but this function works fine on Squid 3.2 and later; however Raspbian only offers Squid 3.1.

I looked for a ready to install 3.2+ version in the Webz but didn’t find one, so I backported the Debian Jessie version.

For the lazy ones, here are the links (try them at your own):

libecap2 (This dependency is not available in Wheezy)



Then install squid3 (install according to your needs)







Mounting a partition from a dd image

At some point, everybody may have done a dd image of a USB/SD stick, as the below example shows:

dd if=/dev/sdb of=foo.img 

But it is usual that at some point in time we would like to access the information inside the image, doing that is quite easy:

First,you should do a fdisk on the image:

fdisk -l foo.img

Disk foo.img: 7998 MB, 7998537728 bytes, 15622144 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0002fc6d

Device Boot      Start         End      Blocks   Id  System
foo.img1   *             15622143     7811071+   c  W95 FAT32 (LBA)

Then some maths are needed. The operators are the start of the partition and the sector size in bytes.  The operation is simply start * sector size in bytes.

In this particular case the operation is 1 * 512 = 512.

Now that we have the result, that we call the offset. In other words, 512 is the offset where the partition starts in this dd image.

So the command to mount the partition is:

mount -t vfat -o loop,ro,noexec,offset=512 foo.img /mnt/mountpoint

And then we can copy the information from the partition inside!





Powered by WordPress with GimpStyle Theme design by Horacio Bella.
Entries and comments feeds. Valid XHTML and CSS.