Fixing partition table in linux with sfdisk

Manipulating partition tables on MS-DOS labelled hard disk (the most common type as of this writing) is an extemely important skill to have as a System Administrator. If one or more partitions gets deleted or modified in an unintentional way, it is imperative that one know how to restore or modify the partitions to rectify the problem.

Continue reading

Edit pictures and images online for free

PiccyFix.com is an instant, easy-to-use, free, online picture, image and photo editor. Our cool online photo editing wizard does all the hard work for you. No graphics software to pay for, download, install, configure, register and learn.. just upload your picture below into your browser and you’re away!! Piccyfix works across 99% of browsers for Windows, Apple Mac and Linux, and across nearly all mobile devices and phones too.

Nmap on Cygwin

Installed nmap on cygwin. Dead easy!

  1. Download and install Cygwin
  2. Download and install WinPCAP
  3. Accept most defaults
  4. Do the default installation, typically C:\cygwin\
  5. Download nmap for windows (zip)
  6. Open the zip file
  7. Double click the folder inside the zip, a large list of files should appear
  8. Extract these files (and not the folder which contains them) to C:\cygwin\usr\local\bin
  9. Open cygwin
  10. Type
    • nmap --version
  11. Your nmap installation on cygwin is now complete

Update 3/May/2012: Try running the vcredist_x86.exe file found in the zip archive if nmap doesn’t seem to run.

For a general understanding of nmap, just type nmap. For a more detailed comprehension, read the manual, and search the web.

Password-less Logins with OpenSSH, scp, and rsync

UPDATE: I changed ‘>’ (erase file, then write to file) to ‘>>’ (append to file). This avoids you overwriting your, or other peoples’, public keys.

Setting up password-less logins is both dangerous, and mighty. It allows one to authenticate to an OpenSSH server without typing in a password. Authentication is gained via knowledge of a private key.

Generate a Public/Private Key Pair

$> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/felipe/.ssh/id_rsa):
Enter passphrase (empty for no passphrase): <ENTER>
Enter same passphrase again: <ENTER>
Your identification has been saved in /home/felipe/.ssh/id_rsa.
Your public key has been saved in /home/felipe/.ssh/id_rsa.pub.
The key fingerprint is:
d7:79:c3:01:ce:90:71:a2:a2:3d:83:26:fb:9a:1f:5b felipe@linux.local

You will then find two files inside your directory. Keep them safe, secure, and secret. The public key (the one with .pub at the end) can be widely disemmindated. It represents the antonym of secrecy and privacy. The private key, however, must remain private and secret at all times.

Copy the PUBLIC key to a remote OpenSSH server

You must copy your public key to a remote host. The host will verify that you own the private key by encrypting a “challenge” and forcing your ssh client to decrypt it. If successful, you are authenticated, and admitted entrance. A password isn’t required.

$> cat /home/felipe/.ssh/id_rsa.pub | ssh felipe@remote-host.com \
"cat - >> .ssh/authorized_keys"
felipe@remote-host.com's password: <PASSWORD>

This copies your public key the authorized_keys file (NB: authorized_keys2 is deprecated and no longer recommended for use. OpenSSH checks both).

Testing Phase

‘logout’ or ‘exit’ and try:

$> ssh felipe@remote-host.com

It should not ask you for a password. You should automatically be logged into the remote system.

Works with scp and rsync too!

‘scp’ and ‘rsync’ both use a ssh client at the backend, and so will also authenticate automatically utilising your public and private key pair. Try:

$> scp file_a felipe@remote-host.com:file_b

This should transfer without pausing to ask for your password. Likewise try:

$> rsync -r /backups/2010/Jan felipe@remote-host.com:/backups/2010

This should backup your entire directory to remote-host.com without pausing to ask for a password. You can put a line similar to this one in a shell script, and run it with cron once a week or so. It will automatically backup your system, using OpenSSH, and proven secure and safe method for authentication of human and machines across an untrusted public network, away from curious eyes.

OGG Vorbis vs. MP3

I just ripped some of my CD’s to MP3, but I was just curious what OGG would do for me. I had never actually compared the two encoding formats, side-by-side, but today, I was simply stunned.

A song compressed with MP3 (VBR 128Kbps Normal Quality) was around 5.1 – 5.8 MB. It sounded good, but ‘clearly’ inferior to the actual CD Quality sound.

The OGG rip (VBR 128Kbps), on the other hand knocked my socks off! It was around 3.0 – 3.1 MB and sounded ‘nearly’ as good as the original CD!

I hesitated, at first, to rip them all to MP3, in case I wanted to share them (!gasp!) with others. However, now that I can see a 17% – 20% compression gain using OGG over MP3, I no longer feel that way. I wholeheartedly endorse the use of OGG Vorbis for ALL compressed lossy compression.

Most [good] audio/multimedia players already support OGG (except, MS programs, obviously!) so you should have no problem listening to them.

If you have a portable media player (PMP) without native OGG support there are two options

  1. Contact the manuafaturer and demand (request?) that they support OGG in future versions of their players
  2. Ask them to create a firmware update to include OGG support on currently supported players
  3. Install Rockbox: a Linux-based GNU open-source free software suite which allows many major PMP’s to play a huge variety of free and proprietary (i.e. non-free, patented, or otherwise ‘encumbered’) formats, such as OGG. It also allows you to play wide variety of video formats, as well. It included a bunch of interesting features such as backlight dimming, battery-saving features, audio enhancement features, and plenty of games (plays DOOM too!)

Googleblog homing in on security

As part of National Cyber-security Awareness Month, Googleblog posts some important tips regarding password security.

Creating a new password is often one of the first recommendations you hear when trouble occurs. Even a great password can’t keep you from being scammed, but setting one that’s memorable for you and that’s hard for others to guess is a smart security practice since weak passwords can be easily guessed. Below are a few common problems we’ve seen in the past and suggestions for making your passwords stronger. — Choosing a smart password.

Microsoft charges full commercial prices to non-for-profit

Paula Carleton, CIO of the not-for-profit Baptist Community Services, told Computerworld she is investigating how to move its 850 Windows desktops to open source following Microsoft’s decision to force it to a full commercial licence.

Every dollar we are forced to spend on software is a dollar less spent on the charitable services like homeless and crisis care that we deliver,” Carleton said, adding that it is a public benevolent organization according to the tax office. Read more…