Thursday, November 11, 2010

Where to buy Samsung Galaxy S Captivate in Winnipeg


I have just recently became a proud and happy owner of this wonderful Android phone, but it was not easy. Rogers is milking this cow as hard as they could: stock is limited, only small shipments of 3-4 are sent out to stores. It took a bit of leg work and persistent calling to get my hands on one, here's how you can do it.

Saturday, October 16, 2010

Reduce number of virtual terminals (TTYs) in Lucid

CLI

Most Linux distributions come with several (usually six) virtual consoles enabled by default. Think of it as having six terminal windows you can flip through using (CTRL)+ALT+F[1-6] keys. Sometimes you don't need or want to have that many TTYs. Let's say you have very little RAM, or want to shave a fraction of a second from your boot time, or simply want to strip all that isn't necessary from your installation. Here's how you do it in Ubuntu 10.04 Lucid Lynx.

Let's say you want to leave only two virtual consoles, tty1 and tty2. simply go to /etc/init/ directory and delete, or better yet move to safe location, files tty3.conf, tty4.conf, tty5.conf and tty6.conf

$ cd /etc/init/
$ sudo rm tty[3-6].conf

Next time you boot, only first two TTYs will be present. Note, that this will also shift your X session to where tty3 would normally be, so you can access it by typing ALT+F3 instead of ALT+F7.

Tuesday, October 5, 2010

Read a random line of text from file in Linux

CLI

There are many ways to achieve this, but this is probably the simplest since you most likely already have all the necessary components installed.

On Ubuntu it's the "shuf" command from "coreutils" package. It's original purpose is to shuffle the lines passed to it, or as its description says: "write a random permutation of the input lines to standard output". However, with one of the arguments you can limit the number of lines it returns, so if all you need is a single line from a given text file, juts run:

$ shuf –n 1 list.txt

where argument –n tells shuf to print only one random line from file list.txt

Thursday, September 30, 2010

Auto login Ubuntu user from CLI

CLI

There are a lot of recipes out there on how to automatically login into a given Linux user's account on start up, but most of them rely on some sort of graphical environment or display manager to be present. It took me quite a bit of digging to find a way to auto login in Ubuntu with nothing but CLI. I'm sure others will find this tip useful.

To auto login user "bob" on first console terminal (tty1) edit file /etc/init/tty1.conf and replace last line:

exec /sbin/getty -8 38400 tty1

with this:

exec /bin/login -f bob < /dev/tty1 > /dev/tty1 2>&1

and Robert's your father's brother, next time you boot your machine bob will automatically log into his account on tty1.

Tuesday, September 28, 2010

Automatically update Transmission's block list


My favourite BitTorrent client Transmission supports bluetack-formatted blocklists. In computing, a blacklist or block list is a basic access control mechanism that allows everyone access, except for the members of the black list (i.e. list of denied accesses). Transmission utilizes a blocklist of known anti-P2P IPs, to prevent them from connecting and possibly interfering with transfers.
When you press the "Update Blocklist" button in the Transmission GUI, a new copy of blocklist is downloaded from a Transmission mirror that's updated twice daily. Since transmission-daemon on my headless server does not have such button I have to download the blocklist by hand, uncompress it, and place the uncompressed file in the daemon's blocklists folder.
Here's how to do it manually:

Friday, September 24, 2010

My must-have free Mac OS X apps

There are a lot of lists like this on the web, but every user's needs are slightly different, so here's a list of my favourite free Mac OS X apps that I install and use on all my Mac, and where possible, Linux and Windows computers.

Unarchiver

unarchiver This puppy can open pretty much any archive/compression format out there: Zip, Tar-GZip, Tar-BZip2, RAR, 7-zip, LhA, StuffIt and more. I nice touch is an option to automatically delete archive file after it has been extracted.

Download: http://wakaba.c3.cx/s/apps/unarchiver.html

TextWrangler

textwrangler If you do any kind of programming or just like to work with plain text files, this text editor is a must. There are better coding tools out there, but few are this cheap.

Download: http://www.barebones.com/products/textwrangler/

Burn

burn Forget bloated and expensive burner apps, here's a simple bare bones burner that can easily handle 99% of your CD/DVD burning needs.

Download: http://burn-osx.sourceforge.net/Pages/English/home.html

Adium

adium For chatting online nothing beats a good multi-protocol Instant Messenger. Adium is my Pidgin for Mac, talk to your contacts on MSN, AOL, GTalk, Yahoo, ICQ, IRC, Jabber, Facebook and more all from one client.

Download: http://adium.im/

Cyberduck

cyberduck Great app for transferring files. It supports FTP, SFTP, SCP, WebDAV and, as of recently, even Amazon S3 and Google Docs.

Download: http://cyberduck.ch/

Transmission

transmission Technically I don't use this app on any of my Macs anymore, but that's only because I run it on my Linux headless server 24x7. If you don't already do something similar, this BitTorrent app is definitely a must.

Download: http://www.transmissionbt.com/

Dropbox

dropbox This is a fantastic little utility I use on ALL my computers (Mac, Linux or Windows) to keep a small set of files in sync and backed up to the cloud. Any changes to these files will be automatically pushed to all computers, great for important docs that you frequently work on from multiple machines.

Download: http://www.dropbox.com/referrals/NTY1MDg4MTk

KeePassX

keepassx This is a Mac version of an awesome password safe application KeePass. It stores all your important passwords in its encrypted database. All you have to do is remember one strong master password, KeePassX will generate and remember passwords for everything else. Combine it with Dropbox and you'll have instant access to your password database from any of your computers or smart phones.

Download: http://www.keepassx.org/

VLC

vlc The ultimate video player/server that can play practically any video/audio format out there without you lifting a finger. It is much more than just a player, though, you can also re-encode or stream your videos to any machine on your LAN. I once used it to stream a DVD playing on my desktop to a laptop without DVD drive, which was connected to a video projector next door.

Download: http://www.videolan.org/vlc/

Perian

perian If you prefer to play your movies on the pre-installed QuickTime, Perian is your best friend. It gives you power to play many video/audio formats directly in QT.

Download: http://perian.org/

Handbrake

handbrake For times when you need to backup/rip your DVDs or do some format shifting, few apps come close to ease of use of Handbrake.

Download: http://handbrake.fr/

Growl

growl Not critical, but nice to have utility that makes system and application pop-up notification a lot nicer.

Download: http://growl.info/

Seashore

seashore This is an image editor, it's simple and has limitations, but it's free!

Download: http://seashore.sourceforge.net/The_Seashore_Project/About.html

Wednesday, September 22, 2010

Convert .png to .gd2 for Nagios status map

nagios-150x150

If you ever tried to make Nagios web interface look a little nicer by adding some custom host or service icons, you have probably came across collections of icon packs at Nagios Exchange. You have also noticed an unusual .gd2 extension on some of the images and realized that without this format icons don't display properly on Status Map. I was doing exactly that the other day and couldn't find the icons I needed, so I ended up creating some myself. Here's how to convert a PNG image into .gd2 (GD Graphics Library format).

On Ubuntu install libgd-tools package, it will contain a pngtogd2 app. To convert file.png to file.gd2 use:

$ pngtogd2 file.png file.gd2 0 1

Once you have your .png or .gif and .gd2 images, I tend to use 40x40x8bit images with transparent background, place them in your /usr/local/nagios/share/images/logos/ directory (if you installed Nagios from source) and add these properties to your host or service definition:

define host{
        ...
        icon_image              ubuntu.png
        statusmap_image         ubuntu.gd2
        ...
        }

Tuesday, September 21, 2010

Check NFS & memcached with Nagios

Recently I had to add a lot of new checks to my Nagios monitoring at work, here's a coupe that you can do without having to find dedicated plugins.

NFS

You can quickly check whether NFS server is up by using check_rpc plugin like so:
./check_rpc –H host –C nfs
Here's my command definition:
define command{
        command_name    check_nfs
        command_line    $USER1$/check_rpc -H $HOSTADDRESS$ -C nfs
        }

memcached

There are some dedicated plugins in the web for this one, but for my purposes this blog post was just the perfect solution. Memcached has a simple text based protocol and by default listens for connection on port 11211. So for a simple check I'm asking memcached for its version via TCP connection and expecting a response with word "VERSION" in it within 5 seconds:
./check_tcp -H host -p11211 -E -s 'version\n' -e 'VERSION' -w2 -c5 –t5
Here's my command definition:
define command{
        command_name    check_memcache
        command_line    $USER1$/check_tcp --hostname=$HOSTADDRESS$ --port=11211 --escape -s 'version\r\n' --expect='VERSION' --warning=2 --critical=5 --timeout=5
        }

Monday, August 9, 2010

Enabling apache_* Munin plug-ins in Ubuntu

munin-apache-150

There are three Munin plug-ins for Apache monitoring bundled with Ubuntu's munin-node package:

  • apache_accesses - monitors the number of accesses to Apache servers
  • apache_processes - monitors the number of apache-processes running on the machine, and (in addition to a simple process count), separate then into "busy" or "idle" servers
  • apache_volume - monitors the volume of data sent from Apache servers

First of all, make sure that the libwww-perl package is installed on your system, or you might notice an error like this when you're executing these plug-ins directly from /usr/share/munin/plugins:

Can't locate object method "new" via package "LWP::UserAgent" at ./apache_volume line 127

In addition, apache_accesses and apache_volume require ExtendedStatus support to be enabled as well as mod_status module.

Status module can be enabled by running:

$ sudo a2enmod status
$ sudo /etc/init.d/apache2 restart

To enable ExtendedStatus support create a /etc/apache2/conf.d/extendedstatus file containing the following directives:

<IfModule mod_status.c>
   ExtendedStatus On
</IfModule>

Now create symbolic links to plug-ins in /etc/munin/plugins directory:

$ cd /etc/munin/plugins
$ sudo ln -s /usr/share/munin/plugins/apache_accesses
$ sudo ln -s /usr/share/munin/plugins/apache_processes
$ sudo ln -s /usr/share/munin/plugins/apache_volume

Reload Apache and restart munin-node:

$ sudo /etc/init.d/apache2 reload
$ sudo /etc/init.d/munin-node restart

Saturday, July 24, 2010

The All-in-One Live USB

MultiBoot-ISOs

I have mentioned various ways to create a Live USB from a LiveCD before, but the following method, in my opinion, takes the prize. Once again great guys at pendrivelinux.com put together tools and steps necessary to Boot Multiple ISO from USB.

I have modified the process a bit to make the result suite my needs better, and encountered a few "gotchas", so as usual here are my notes.

Friday, July 9, 2010

BitTorrent and zsync FTW

My current favourite (and it seems almost everyone else's) Linux distro is Ubuntu. I use it on my home server, on virtual machines at work, I even carry it on my USB stick. I find that the easiest, and probably the fastest, way to download Ubuntu is via BitTorrent. Using BitTorrent to download Open Source software is also a nice way to show your appreciation - you reduce project's bandwidth costs and help creators to distribute their product. This is especially true during the stable release time, when everyone rushes to get the latest release and direct downloads slow down to a crawl. This is the perfect time to use P2P, since hundreds of people already have the file you want and are willing to share it with you.

BitTorrent is not a silver bullet, however. It's only good when the file you want is a popular one. For example here's a some tracker stats for two Ubuntu releases, 10.04 is a stable release from a couple months back and maverick is the latest alpha:

File Seeders Leechers
ubuntu-10.04-dvd-i386.iso 1391 123
ubuntu-10.04-server-i386.iso 968 20
maverick-dvd-i386.iso 8 5
maverick-server-i386.iso 10 0

Not a lot of people care about the alpha release, so there are very few seeders and leechers. Since number of peers is low, P2P download will be slow and you might be better off just downloading the file directly. In Ubuntu's case there is a better solution - zsync.

Wednesday, July 7, 2010

Universal USB Installer

portable-linux-usb

In my last post I mentioned UNetbootin – a great tool for Windows and Linux that allows you to create bootable Live USB drives for Ubuntu, Fedora, and other Linux distributions (VMware ESXi) without burning a CD. Here's another such tool, but with few extra features added.

Universal USB Installer is a Live Linux USB Creator that allows you to choose from a selection of Linux Distributions to put on your USB Flash Drive. The Universal USB Installer is easy to use. Simply choose a Live Linux Distribution, the ISO file, your Flash Drive and, Click Install. Other features include; Persistence (if available), and the ability to format the flash drive (recommended) to ensure a clean install. Upon completion, you should have a ready to run bootable USB Flash Drive with your select Linux version installed.

I particularly like the "Persistence" feature to create Linux LiveUSB that allows me to save data changes back to the USB storage device instead of leaving the information in system RAM. This data can then be recovered and used again on subsequent boots, even when booting from different machines. Now I always have a bootable Linux USB in my pocket.

Saturday, June 26, 2010

Quickly create VMware ESXi 4 LiveUSB

I recently discovered that it's possible to create a VMware ESXi 4 install USB using nothing but UNetbootin and official VMware ESXi 4 ISO file. Why would I want to do that? So I can install ESXi on servers without CD/DVD drives, they have become quite common lately. USB install is much faster than installing from optical media, and you save environment by not wasting a blank CD on a software version that will become outdated in three months or so.

In the past I have used a great little Bash script by Varazir that allows you to not only make a bootable USB with ESXi on it, but can also customize and merge various drivers into the install image. However, if all you need is a vanilla install, UNetbootin makes it a lot easier and works on both Windows and Linux platforms.

Just choose the "Diskimage" option and browse to your VMware ISO and you'll have a installation USB drive in no time.

unetbootin

Friday, June 4, 2010

How to deal with scam or unwanted phone calls in Canada

There have been a lot of unwanted phone calls reaching my household lately, so I though it was time to share some of the ways we, Canadians can deal with them.

There is a vast variety of unwanted telephone calls: regular telemarketing, automated diallers with and without pre-recorded messages, political or charity requests, plus a huge variety of scams. There's no way to address all of those in a single blog post, but I will attempt to at least provide a good starting point.

Saturday, May 29, 2010

Verify your downloads with checksums

lock-150

If you frequently download large files, such as installation media or LiveCDs, you might have encountered a situation where a file becomes corrupt during the download. You haven't? Let me paint a picture for you.

Your boss wants you to urgently deploy new ESXi server with all the latest updates and he wants it done yesterday. You grab the latest ISO release from the web and, after patiently waiting for it to download, burn it on a CD. You head to the server room, load the CD and… half way through install it complaints about media being corrupt. What happened? Was it the download? Failed burn session? Defective CD drive? Now you have to re-download the image and do it all over again and by now it's 4:30pm on Friday.

I have been there and can show you how to eliminate at least one unknown from the story above. You could verify whether file you downloaded is the same as the file posted on the web site. The process is called checksum or hash sum verification and allows you to check the integrity of your data.

Many sites will provide MD5, SHA1 or SHA256 checksum of the distributed file. All you have to do is compare it to the checksum of the file you have downloaded. How to do that? Here are two ways I use most often...

Friday, May 7, 2010

Some VMware gotchas

Had to troubleshoot a couple of VMware ESXi related errors at work this week, noting them here for my future self or anyone else looking for solution.

First problem occurred when I was moving a a 64bit SLES 9 virtual machine to a newly provisioned ESXi test host. The server in question was HP ProLiant DL360 G5 with Intel Xeon 5150 CPU. The CPU supports 64bit and VT, but when I started the virtual machine I got the following error:

Your CPU does not support long mode. Use a 32bit distribution.

Apparently the Virtualization Technology (VT) feature was not enabled in BIOS and ESXi could not run a 64bit guest OS without it. Pretty simple fix: reboot and reconfigure the BIOS settings to enable CPU's VT feature.

Next problem occurred when I upgraded one of the virtual machines. This VM was running 32bit Ubuntu 8.04 Hardy JeOS with VMware Tools Operating System Specific Package (OSP). I uninstalled the OSP using apt-get, upgraded the kernel and then attempted to re-install VMware Tools using .tgz package, but was greeted with the following error:

VMware Tools cannot be installed, since they have already been installed using
a package-based mechanism (rpm or deb) on this system. If you wish to continue,
you must first remove the currently installed VMware Tools using the
appropriate packaged-based mechanism, and then restart this installer

Execution aborted.

I double and triple checked, all VMware packages were removed, so what's the deal? After looking into the installation script vmware-install.pl, I saw that it checks for existence of DSP marker file /usr/lib/vmware-tools/dsp and displays the above message if file exists. I found that file being the sole resident of the /usr/lib/vmware-tools directory so I simply removed the file and the directory. Not sure why this file was left behind, but after that I was able to proceed with installation.

Monday, April 19, 2010

Import virtual appliance without vSphere client

ovftool-150

Since I don't have a Windows or even a non-Mac GUI machine at home, I have been looking for an easy way to import/export VMs and virtual appliances to/from my Whitebox ESXi server without VMware vSphere/Virtual Infrastructure (VI) client or Standalone Converter.

The solution came in the form of VMware Open Virtualization Format Tool, ovftool for short. This command line utility comes in Windows or Linux flavours and allows you to quickly probe, convert, compress, export and import virtual machines. Here are some of its feature highlights:

  • Supports both import and generation of OVA packages
  • Directly converts between any VI, VMX, or OVF source format to any VI, VMX, or OVF target format
  • Accesses OVF sources using HTTP, HTTPS, or FTP, or from a local file
  • Deploys and exports vApp configurations on vSphere 4 targets
  • Provides options to power on a VM after deployment, and to power off a virtual machine before exporting
  • Show information about the content of any source in probe mode
  • Provides context sensitive error messages for vSphere sources and targets, showing possible completions for common errors, such as an incomplete vCenter inventory path or missing datastore and network mappings
  • Provides an optional output format to support scripting when another program calls OVF Tool

Exactly what I need. I downloaded and installed Linux version to my headless Ubuntu server and was able to quickly deploy a sample virtual appliance to my ESXi server with the following command:

$ ovftool /path/to/test.ova vi://root@esxi.lan

For a slightly more interesting test I renamed the VM and told it to power on after import:

$ ovftool –-name=NewNameForVM –-powerOn /path/to/test.ova vi://root@esxi.lan

Now to power off a VM and export it as a Virtual Appliance:

$ ovftool –-powerOffSource vi://root@esxi.lan/ResourcePoolA/someVM01 /path/to/template.ova

For more documentation see VMware site.

Saturday, April 17, 2010

Installing ESXi 4 on P6T SE whitebox

esxi-server-150

I think VMware ESXi server is something marvellous. Being able to create multiple virtual machines with different operating systems, apps and configurations, simulate multiple networks, routers and switches, and all in one single server – pure awesomeness! And best part is – it's free.

After putting together acquiring my new whitebox server it was time to reward it with a spanking new OS. Some prior research indicated that not all onboard components were supported by ESXi 4 and some geeky tweaking would be required. Luckily I was armed with a pretty good resource on how to get ESXi working on my server. Huge thanks goes to vm-help.com and its community.

After checking the Whitebox HCL, I knew I might have some problems with my onboard Realtek NIC (have seen that before) and possibly JMicron IDE controller. But there is a way to load precompiled drivers before or, if you are lucky, after the install. This can be achieved by creating a custom oem.tgz package that should contain your device drivers and file to tell OS what those devices are by mapping their PCI IDs to drivers.

First step is to get the PCI IDs of my hardware. Once again vm-help.com had it covered for me. I booted my server with Ubuntu Live USB, never leave your house without it, and ran this command:

$ lspci -nn

Here's how the devices in question show up, the [10ec:8168] and [197b:2363] are the PCI IDs I was looking for:

04:00.0 IDE interface Mass storage controller: JMicron Technologies, Inc. JMicron 20360/20363 AHCI Controller [197b:2363]
06:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller [10ec:8168] (rev 02)

Next step is to create custom oem.tgz package and, in my case, merge it with installation image, since ESXi would refuse to install after failing to detect the Realtek NIC. It's quite a bit of pain to do by hand, so I decided to try a very neat little automation script by Varazir that can bundle it all for you nicely plus gives you a ton of additional features to choose from. In particular, things like:

  • enabling SSH, FTP and Rsync on your server
  • merging your custom oem.tgz file into installation ISO
  • creating a live or installation USB image

All I needed was the original ESXi ISO image, a custom oem.tgz file with drivers for my hardware, large enough USB stick and that script. I already had three out of four, just need those drivers. I must have been lucky, because the first community package I tried worked. It already had both JMicron and Realtek drivers and with the Varazir's script I had the installation USB with my drivers and extra features in minutes. I only had to do a small tweak to oem.tgz file to update the simple.map file with PCI IDs for my system.

I am now a proud owner of a Whitebox ESXi 4 Server!

Thursday, April 15, 2010

Styling a pre tag

If you come to this blog once in a while, you had probably noticed that I change the theme of it quite often. This mostly because I'm still not quite satisfied with any of them. One thing that I find myself modifying in every theme is the styling of the "pre" tag. I like it to look similar to Linux shell and to wrap if code within is to wide. Here's the CSS I use to do that:

pre {
  border:1px solid #888;
  background:#111;
  color:#DDD;
  padding:5px 10px;
  margin:0 0 1em 0;
  overflow:auto;
}

Update: This version will actually wrap the text instead of adding scroll bars:

pre {
  border:1px solid #888;
  background:#111;
  color:#DDD;
  padding:5px 10px;
  margin:0 0 1em 0;
  white-space:pre-wrap;
  white-space:-moz-pre-wrap;
  white-space:-pre-wrap;
  white-space:-o-pre-wrap;
  word-wrap:break-word;
}

Tuesday, April 13, 2010

My new server

In previous post I have briefly mentioned that I have just purchased a new computer server. As time passes I find myself forgetting what components I have and what their specs are, so as a reminder to future self, and to boast just a little bit, here it is...

Total comes to $973.99 plus tax, minus $50 mail-in rebate (if I get them).

Friday, April 9, 2010

Save money buying computer parts and electronics

memory-express-150

Until recently my favourite electronics retailer was NCIX. They have huge selection of computer equipment and pretty low prices. My favourite part though, is their price match policy. NCIX will match prices of any Canadian retailer, all they need is a link to competitor's page with lower price posted. Armed with that and some good "googling" skills you can get some ridiculously low prices.

To make things simpler, there are sites that can compare prices from multiple retailers. Simply search for the model number of the item you want. PriceCanada is my favourite. I particularly like their price history feature. Unfortunately, for more exhaustive search you'll have to use others as well. Here's my list:

Now if only I can get the same deal locally, without having to pay shipping fees and worry about RMAs… This is were Memory Express comes in. They are relatively new to Winnipeg computer and electronics scene, but by far the best choice. They might not have the largest selection or lowest prices, but they do have the same price matching policy as NCIX.

Just last month they've built me a gorgeous little white box server for just $1040 including tax and labour. Here is the part list:

  • Motherboard: ASUS P6T SE
  • CPU: Intel i7 930 Quad Core
  • RAM: 3x2GB Patriot Extreme Performance Viper DDR3-1333
  • Video: ASUS Radeon HD 4350 (512MB)
  • Case: Antec Sonata III ATX with 500W power supply
  • Other: 1TB HDD, CD/DVD burner drive

By shopping around for best deals on components and using Memory Express I paid $400-$700 less compared to Future Shop or Best Buy.

Friday, March 26, 2010

Disable power button on Ubuntu server

Power button

My little daughter loves to press buttons. Some of her favourite toys are my spare mouse and keyboard. I think she's going to be a computer geek, like her daddy. Unfortunately, my small headless Ubuntu server (and its glowing green power button) is also within her reach. Couple times during this week I've received a message from Monit that it was going down, a rare event, unless your kid just shutdown your entire server, again…

Fortunately, this problem is quite easy to fix. On Ubuntu and other Debians all you have to do is edit /etc/acpi/powerbtn.sh script (part of the acpid package) and comment out one line, like so:

#/sbin/shutdown -h now "Power button pressed"

This would prevent the triggered ACPI power button event from calling  shutdown command.

Sunday, March 21, 2010

Creating video DVD iso file using Linux CLI

dvd-150

Recently I had to create a video DVD iso image from a bunch .VOB files using Linux command line. I found this extensive tutorial on both how to create and burn an image file using command line. Here is a quick summary.

First, create VIDEO_TS and AUDIO_TS folders, if you don't already have them. Apparently some DVD players will not play a DVD if it doesn't have this particular directory structure.

In my case I had just .VOB, .IFO and .BUP files with no directory structure, so I copied all files to VIDEO_TS folder and left AUDIO_TS empty.

To create ISO I used a mkisofs command like so:

$ mkisofs -dvd-video -o mydvd.iso -udf /path/to/filedir/

Where "mydvd.iso" is the name of my future ISO file and "/path/to/filedir/" is the directory containing my VIDEO_TS and AUDIO_TS folders.

Just a little while later my ISO image file was ready. Just in case I checked to make sure that VIDEO_TS.IFO file had the lowest sector number like so:

$ isoinfo -i mydvd.iso -l

Now burn!

Wednesday, March 17, 2010

Nexus One is ready for Canada

I just came across some awesome news: Google's Nexus One, Android based phone is now available to Canadians!

Until now Nexus One was not supporting 3G frequencies utilized by Rogers Wireless and Fido, the only Canadian GSM provider (that's right not plural because both are the same company). You could have used Nexus in Canada to make phone calls and send SMS, you could have even use data… at mind bogglingly slow EDGE speeds. But no longer…

Today Google has made an announcement that they are now offering a Nexus One variation that will run on Rogers Wireless in Canada (and AT&T in US). Additionally, Nexus One devices can now be shipped to Canada from Google’s web store, and will work with a SIM from Rogers Wireless. To purchase your Canadian Nexus just go to google.com/phone and select "Compatible with 3G on AT&T (U.S.) and Rogers Wireless (Canada)" option.

If you are confused, as I used to be, about why a 3G capable phone might not work everywhere, here's a quick explanation. There are multiple UMTS (3G) frequency bands in use around the world. Most 3G capable cell phones are not able to use every single one of them, just one, two or three bands at best. Google's Nexus One has originally supported only 900 / 1700 / 2100 frequency bands, so only T-Mobile (1700 / 2100) customers could use 3G. The alternative version now supports 850 / 1900 / 2100 frequency bands, so Rogers (850/1900) customers and AT&T (850/1900) customers can use it. If this sounds strangely familiar it's because you've dealt with similar silliness before when your GSM phone would suddenly stop working in Asia, or some other country that uses different GSM frequency bands.

To make long and confusing research short, if you want to know which frequencies your phone must support in order to be useful in a particular country, head over to GSMArena and use their handy Network Bands tool. Just select the country you're planning to visit and it will list the frequency bands required. Not sure which frequencies your phone supports? Same web site will allow you to figure that out as well, just search for your model.

Well, I'm off to buy a Google Phone… maybe.

Monday, March 15, 2010

Restore jaibroken iPhone 3G (yet allow for future jailbreak)

There are countless tutorials online on how to jailbreak your iPhone, but among all those it's hard to find information on how to safely restore your already jailbroken iPhone back to its original state. Even less on how to do it so you can still jailbreak/unlock your phone in the future.

After a lot of searching, reading multiple forum posts and sorting through outdated, incomplete, irrelevant and incorrect information, these are the steps that allowed me to restore jailbroken iPhone 3G with firmware version 3.1.2 and keep it at that firmware revision. Your mileage may vary.


Short back-story... My wife just bought used iPhone 3G that was already jailbroken by previous owner. Upon closer examination it appeared that the phone owner was a bit of a command line hacker and had plenty of software installed that regular user wouldn't even know what to do with. I also had some concerns about possible backdoors since I noticed VNC and OpenSSH servers installed on the phone. Jailbreak gives root user privileges on the device and, combined with just these applications alone, previous owner would have unrestricted access to screen, storage and any command execution. I decided to completely erase all traces of jailbreak and any third party applications, just in case.

Luckily, iTunes gives you just such option as soon as you plug your iPhone into your computer. Just click the restore button in iTunes and it will return your phone to its virginal state (or restore your previous backup, if you had one). Unlucky for us, by default it forces you to upgrade to latest OS version (3.1.3) and modem firmware (05.12.01), which at this time is very problematic (some say impossible) to jailbreak and unlock. After some looking around I found that you can force iTunes to restore from specific firmware file if you hold Shift key in Windows, or Option/Alt key in Mac while clicking on restore button. I found the firmware restore file here and a multitude of good tutorials on jailbreaking and unlocking iPhone here and here.

Here are the steps for impatient:

  1. download firmware version 3.1.2 from here or here, it should be saved as .ipsw file
  2. make sure to choose firmware for your model of iPhone/iPod Touch
  3. open iTunes and connect your device
  4. hold Shift key (Alt/Option key on Mac) and click "Restore"
  5. a file dialog will open and let you choose the downloaded .ipsw file
  6. wait until the firmware is restored
  7. you will be prompted to activate your phone, this step requires SIM card of official iPhone carrier

Good luck!

Saturday, March 6, 2010

Add torrents to Transmission from Firefox

Just discovered a neat Firefox extension called Autotrans. It allows to send a torrent/magnet link from a web page straight to Transmission server via RPC.

Until now I had to right-click the link to torrent file, choose "Copy link location", open a new tab, type the URL to Transmission's Web UI, click "Open" button, paste the torrent link and click "Upload" button. Now it's simply a right-click on the link and select "Torrent it!". Bam!

Add-on configuration is pretty straight forward. Enter the IP/host name of the server the Transmission daemon is running on (you can even enter multiple daemons). If your daemon requires authentication, you can enter username and password. If you want, you can tweak values for AJAX timeout and retry count. There is also an optional menu item and status bar icon that takes you to Transmission web interface. The Autotrans is also smart enough to only show the context menu when link is a torrent/magnet link.

Wednesday, March 3, 2010

Making Pageant automatically load keys on startup

So I have a few private keys I generated for Public-Key SSH authentication. In Windows I manage SSH keys with Pageant - an SSH authentication agent for PuTTY. PuTTY is an awesome SSH/Telnet client for Windows that also comes with a suite of helper utilities like key generator and agent.

My work week starts like this: I log into my Windows workstation, open Pageant and load my keys one after another. Since the keys are encrypted I have to enter a password for each key. Once the keys are in memory I can securely log into multitude of Linux servers (that have the public key) without enduring their login prompt each time. Pretty nice, but there is still some room for improvement.

Wednesday, February 3, 2010

Transmission now supports magnet links

My choice BitTorrent client for headless Linux NAS server - Transmission has recently got a nice feature upgrade. Transmission already had most features you want from a BitTorrent client: encryption, a web interface, peer exchange, DHT, UPnP and NAT-PMP port forwarding, web seed support, watch directories, tracker editing, global and per-torrent speed limits, and more. Now it finally supports magnet links, and for users switching from Mac desktop client - the dearly missed "turtle mode" in Web UI!