Windows Default from Grub

Modifying GRUB for Windows Default BootNormally, GRUB 2 uses the first entry on the boot menu to start by default. This is fine since most of the time Ubuntu adds the latest version of the kernel to the top of the list. This choice is controlled in the configuration file /etc/default/grub using the “GRUB DEFAULT” line which normally has the value “0″. “0″ is an index number for the first item in the boot menu.

If Windows is on the machine then it would quite often be “5″ but after a period of time as the kernel updates the list of entries in the GRUB2 boot menu grows. The entry for Windows will no longer be “5″.

It is possible to have GRUB automatically boot Windows by specifying the text line instead of the numeric index.

sudo gedit /etc/default/grub

I changed the “GRUB_DEFAULT” line to:

GRUB_DEFAULT="Windows 7 (loader) (on /dev/sda2)"

In my case I changed GRUB_DEFAULT to reflect the partition arrangement on my Acer netbook. The Windows partition is on the second partition on /dev/sda. I copied the line which refers to Windows exactly as it appears in /boot/grub/grub.cfg. There is a large amount of stuff in that file but the Windows line should appear after the “### BEGIN /etc/grub.d/30_os-prober ###” section but before “### END /etc/grub.d/30_os-prober ###”.

In my case it was:

menuentry "Windows 7 (loader) (on /dev/sda2)"

After making the change in /etc/default/grub you would need to save it and then update the GRUB configuration by executing the following:

sudo update-grub

As a self respecting Ubuntu user you may wonder why anyone would want to do this. In my case I have a new netbook with a chipset not fully supported yet. I have also set things up this way for Windows users who have allowed me to install Ubuntu for them to try out and use as a backup operating system.

Posted in linux, ubuntu, windows | Tagged , , , | Leave a comment

Use Infocast Offline

Best Buy's Chumby Like DeviceNormally, the Insignia Infocast 3.5″ downloads its content including the main control panel from the Chumby server on the Internet. When everything is working fine that is the desirable way to use it. If you want to listen to the fm radio or some music on a flash drive and there is no internet connection then you would normally be out of luck. Fortunately, there is a way to use it offline. Thanks to the efforts of Christian from Austria you can download his little package to a flash drive, reboot the Infocast with it plugged in and you will be able to use it offline. Other Infocast users reported they had to copy the contents of the psp directory on the Infocast to the psp directory on the flash drive without replacing any of the existing files. I too followed this advice and it worked like a charm.

On an unregistered Infocast I had it working but each time I started it up it would ask to setup the wireless network. After registering it it worked fine. I can even connect to the Internet and use it independently from the Chumby servers. I can run local flash lite applets, use the fm radio, play music files on the flash drive, or stream from Internet radio stations. It appears to mirror the configuration panel for it to download from a web server on localhost.

See the thread here on the Chumby forum: http://forum.chumby.com/viewtopic.php?id=1982.

Posted in ARM, linux, wireless | Tagged , | Leave a comment

A Kindle for $25 less?

http://en.wikipedia.org/wiki/File:Amazon_Kindle_3.JPGWould you buy a Kindle reader if it included advertisements and was $25 less? Amazon is offering a version of the already low priced, $139 WiFi Kindle for $114. The “Kindle with Special Offers” version replaces the screen saver featuring famous authors and the bottom of the home screen with Amazon related advertisements. They do not display while reading a book.

The Amazon Kindle 3 is an e-book reader that features an 6″ E Ink Pearl screen, extremely efficient power management, 4GB memory and WiFi connectivity. The E Ink Pearl screen comes closest to paper of any screen I have seen and only uses power when changing pages. This is the biggest reason it has a rechargeable battery that lasts up to a month of “normal” use between charges (if Wifi is off). It is also argued that this type of screen results in less eyestrain compared to backlit devices like an Apple or Android tablet. The 8.5 oz device is also lighter than the average tablet making it easier to hold for long periods of time.

The Kindle is also another example of a Linux powered device. The power sipping, Freescale 532 MHz, ARM-11 processor runs the Linux 2.6.26 kernel. Increasingly, Linux users don’t really know they are using Linux. As programmable, networked, electronic devices escape the confines of the desktop and become ubiquitous will most people care? The Kindle is an excellent example of the benefits and strengths of a well designed, special purpose device (created by the Amazon subsidiary Lab126).

So is $25 your price? How about $40? There has been a great deal of discussion out there that $99 is the magic number. They had me at $139.

(E-book reader users should check out calibre to manage their e-books.)

Posted in ARM, Buying Technology, efficiency, linux, tech marketplace, wireless | Tagged , , , , | Leave a comment

Use Wikipedia Offline

Wikipedia, the free encyclopedia is huge. The English version alone is currently at almost 3.6 million articles. One of the advantages of it being online is that no matter how big it is you can view the newest version of only the parts you are interested in without having to download the whole thing. But what if you did want to download it and use it offline?

You could download a copy of Wikipedia Static. It is composed of static HTML pages so it is quite big (~17GB compressed). It is also getting old, it was last generated in June of 2008. Fortunately, there are a few other options for offline viewing of Wikipedia content. The following are a few of my favourites:

Kiwixhttp://kiwix.org
Images, Tables and Text but only ~45,000 articles from Dec 2010, 3.7GB, GPL3, OSX, Windows, Linux.

Kiwix is client software for Linux, OSX, or Windows that uses an open data format for mediawiki developed by the openZIM project. The software includes a server mode for sharing on an intranet. The 3.7GB, Dec 2010 snapshot of Wikipedia consists of about 45,000 articles considered to be core articles tagged as part of the Wikipedia 1.0 Project. There are other zim format files available in other language versions of Wikipedia and also Wikipedia:Books. It is a newer project and format so additional zim formatted documents will likely become available as support and awareness grows.

Aard Dictionaryhttp://aarddict.org/
Text, Math and Tables, no Images, Mar. 12, 2010, 7.2GB, GPL3, OSX, Windows, Linux, Android, Nokia Maemo 5.

Aard Dictionary is a multi-platform word lookup program that supports large dictionaries and Wikipedia. The 7.2GB Wikipedia snapshot from March 12, 2010 contains more articles than Kiwix it does not support audio, video and images (except for images rendering math). It also doesn’t support all of the navigation features of Wikipedia. It is quite fast, however, and also supports a variety of other reference material such as Wikitionary, WikiQuote, Wikispecies, WordNet, The Collaborative International Dictionary of English, The Jargon File and other language versions of Wikipedia.

WikiReaderhttp://thewikireader.com/
Text only, no Images, Tables or Math, Jan. 15, 2011, 4.3GB, GPL3.

The WikiReader is a handheld device and open software that allows you to take Wikipedia with you. This device supports text only and searches are limited to article titles. You can download free quarterly snapshots of Wikipedia to a microSD flash memory card that plugs into the device or pay for a subscription shipped on memory cards. Other language versions of Wikipedia, Wikitionary, WikiQuote, and Project Gutenberg and WikiTravel are also available. The WikiReader I purchased included a 4GB microSD card which is big enough for the Summer 2010 snapshot of English Wikipedia but the newer snapshots will require purchasing a larger microSD card. The 2 AAA batteries that power this device are expected to last about 90 hours so this little device is very careful with power consumption.

These are three solid options for carrying around a pretty good sized encyclopedia without all the bulk. The first two are free so I would recommend using both of them. Perfect for the laptop or netbook. The third is small, very reasonably priced, very power efficient and ready for travel.

Posted in linux, ubuntu, windows | Tagged , , , , | Leave a comment

Yet Another Wifi Radio

I find MightyOhm’s WiFi radio project really inspirational. It uses an Asus WL-520gu router, Arduino and a usb audio adapter to create a very low power consumption WiFi radio. It also makes use of small, yet powerful, open source software packaged by the OpenWrt distribution. It also introduced me to the awesome power and flexibility of Music Player Daemon (MPD). It’s a great project that even covers putting it all in a nice display case.

I also like listening to music while I fall asleep so last summer I decided to try making my own WiFi Radio. I considered making an Asus based WiFi radio but a reluctance to potentially damage the Asus router trying to hook up a serial connection and uncertainty about whether or not it would work with WPA2-AES protocol encouraged me to look elsewhere for my WiFi radio solution. I decided to try reusing things I already own as much as possible.

I used a trusty old 733 MHz, Intel 386 based computer and set it up with Ubuntu 10.04 LTS. I added a USB LCDSmartie display from Sure Electronics and set it up to run headless (no monitor or keyboard). To control it I plugged in a USB keypad and installed OpenSSH Server so that I could remotely connect to it through the LAN. I setup the BIOS to start the computer at 9:45PM every day and to shut itself down after running for 4 hours. The speaker was provided by the external input of my alarm clock/radio (with its annoying amber glow).

I changed the LCD display from the bluish one the LCDSmartie shipped with to a red one. I prefer red lighting since it doesn’t mess up night vision or bother sleep as much. I have described how I configured the LCD display in a previous post: http://www.seephar.com/2010/10/enable-sure-electronics-driver-in-lcdproc/ and how to control it using python: http://www.seephar.com/2010/09/python-gmail-lcdproc-client/.

The USB Keypad is a Belkin Nostromo N50 Speedpad but it could be any USB numeric keypad. I used EMPCd and Music Player Client (MPC) to control Music Player Daemon (MPD). The tricky part of configuring EMPCd is figuring out what device the USB Keypad is assigned. The EMPCd website mentions using using ‘/usr/sbin/empcd -K’ and ‘/usr/sbin/empcd -L’ respectively to determine which keys and functions are supported. I tried by process of elimination all the /dev/input/event* devices in the EMPCd configuration file /etc/empcd.conf and found that “eventdevice /dev/input/event3″ responded to presses on the speedpad. I then was able to figure out which key was which event and altered the EMPCd configuration file accordingly.

I used a script (mpdcurrent.tcl.gz) adapted from one of Jannis Achstetter’s lcdproc clients and written in tcl to display the current status of MPD such as what song was playing or whether it was stopped, etc… Most scripts are started in /etc/rc.local.

#!/bin/sh -e
# rc.local
#
# Load script that displays current status of MPD using LCDProc
/home/phar/scripts/mpdcurrent.tcl &
# Clear any currently loaded MPD playlist
mpc clear
# Load predefined MPD playlist called "sleep", filled with sleep condusive music
mpc load sleep
# Play MPD playlist in random order
mpc random on
# When it gets to the end of the playlist it starts over
mpc repeat on
# Starts playing currently loaded playlist
mpc play &
# Shutdown in 4 hours
/sbin/shutdown -P +240 &
# Start EMPCd to capture events from speedpad and control MPD
/usr/sbin/empcd &
exit 0

I use Gnome Music Player Client (GMPC) to name and configure the playlists on MPD remotely. The playlists with various internet radio station urls and/or music are loaded using bash scripts executed by rc.local at startup and by EMPCd in response to specific key presses on the speedpad.

#!/bin/bash
# ldstream.sh loads MPD playlist containing Internet radio stations
# executed by EMPCd when correct button pressed on speedpad
mpc stop
mpc clear
mpc load stream
mpc random off
# Play first item in playlist
mpc play 1

I have 3 main playlist names: stream, sleep and elect. Here is a package (wifi_radio_files.tar.gz) of configuration files that may be helpful in understanding how I configured it. Each playlist can be loaded by pressing the appropriate button on the speedpad which executes a bash script which uses MPC to control MPD. Two more buttons select the previous or next item in the playlist and also stop and play the current item on MPD.

The 386 uses a low power consumption, DC to DC power supply and a Hitachi IC35L090AVV207-0 80GB Hard Drive that is fairly power efficient. The whole system idles at about 20 Watts and peaks at about 40Watts. It works very well. Admittedly the mini ATX case is not as small and elegant as MightyOhm’s project but it is quiet and can hide underneath the bed.

I have since replaced this “WiFi radio” and the clock/radio with the annoying amber glow with a Chumby like device called the Insignia Infocast 3.5 which I snagged on sale for $50. It is smaller, uses much less power, has a built-in speaker and is controlled with a touch screen. This machine currently resides in the basement shut down and waiting to be awaken with Wake On Lan (WOL) and act as an audio server once again.

Posted in efficiency, linux, Tutorial, ubuntu, wireless | Tagged , , | Leave a comment

Direct ATA to ATA Calling With The PAP2T-NA

As mentioned in my previous post, I have not abandoned plain old telephone service. It is very well engineered and integrates well with 911 service. There are, however, advantages to the flexibility of adding voip to your choices. My preferred home phone solution is to have two phones. One connected to the phone company and one (the long distance phone) connected to a flexible voip service like Voip.ms. My preferred ATA is the Cisco PAP2T-NA. I have family in other parts of the country. We tend to call them frequently so it is cost effective for all of us to adopt the dual phone strategy. Either ATA can be configured to dial a “hotline number” direct to the other ATA over the Internet before using the voip service in the dial plan. To make direct ATA to ATA calls work over the Internet you need to do the following:

  1. Setup and use a service like DynDNS.com to get a free domain name for your dynamic ip address.
  2. Configure the ATA to make and answer direct (unregistered) calls.
  3. Forward UDP ports on your router to the ATA.
  4. Configure the dial plan on the ATA be able to call the other ATA(‘s).

Most home internet service providers dynamically assign ip addresses so you need to get a domain name that doesn’t change. A service like DynDNS.com offers free domain names for situations like this. If your IP address is static then you do not need this and can just use that in the ATA’s dial plan.

You need to log into your PAP2T-NA as admin and go to line 1 and/or line 2 and change in the “Proxy and Registration” section the “Make Call Without Reg:” and “Ans Call Without Reg:” options to “yes” and save your changes at the bottom of the configuration screen by clicking on “Save Settings”.

The next thing you need to do is forward the necessary ports for an SIP call to work. I found the PAP2T-NA needed UDP 5060-5061, UDP 5004 and UDP 16384-16482 (since this was the way rtp was setup on my ATA in the SIP settings). Keep in mind that if you are unsure about the risks of forwarding ports on your router you probably should not do this. You have been warned.

The next step is to change the dial plan for Line 1 and/or Line 2. It would be a good idea to it write down or copy and paste & save it before making any changes. Here is an example of what mine would be like:

(<123:5194321111@domain.dyndns-remote.com>S0|*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)

When I dial 123 (my hotline number) the first rule in the dial plan is matched so it sends the call to 5194321111@domain.dyndns-remote.com. 5194321111(not the real number) is the “User ID:” on the other ATA. In this case it happens to be the DID number of the voip service on the other ATA. For Voip.ms it would be the account number. domain.dyndns-remote.com is the newly assigned dyndns.com domain name.

For this to work the “Enable IP Dialing:” option must also be “yes”. Remember to save your changes at the bottom of the configuration screen by clicking on “Save Settings”. Any other number will be processed by the other rules in the dialing plan and be sent out to the regular registered voip service. The next example demonstrates a dial plan rule for a second ATA:

(<123:5194321111@domain.dyndns-remote.com>S0|124:123456_7@domain2.dyndns-remote.com>S0|*xx|[3469]11|0|00|[2-9]xxxxxx|1xxx[2-9]xxxxxxS0|xxxxxxxxxxxx.)

Hotline number 124 will match the second rule and send the call to 123456_7@domain2.dyndns-remote.com.

So there you have direct ATA to ATA calling. Setting it up is the hard part once that has been completed the person just has to pick up the phone at the other end when it rings.

Cicso ATA Administration Guide (pdf)
Linksys Dial Plan Tips and Tricks by Mango
Configure your Linksys VoIP ATA the right way! by Mango

Posted in Tutorial, voip | Tagged , , | Leave a comment

Escaping Plain Old Telephone Service (POTS)

I have an Internet connection and an SIP based analog telephone adapter (ATA) and you have the same. Why can’t we call each other directly? Well we can but most people don’t have things setup for this to work. There is also potential for this to work as smoothly as we connect to a web page but there is not much incentive for service providers to help people bypass them and standards that seek to support this are not widely enough adopted yet. The users are the only ones with the incentive on this and at this point it is possibly more difficult to setup than they would prefer.

The Internet has a great way to match up a unique URL like http://www.seephar.com with the unique ip address of the server that hosts this web page. This standard service is called Domain Name Service (DNS) and it’s wide adoption makes the Internet a much more useful place. There is another standard which attempts to do the same with another unique piece of information: the phone number. That standard is called e164. It seeks to match up your unique phone number with an email address, website, VoIP addresses or more on the Internet. I would recommend e164.org to learn more about it.

This standard holds great promise but needs to be implemented in the software in the devices connected to the phone. The soft phone, analog telephone adapter (ATA) or the PBX, whatever it is that interfaces your phone with the Internet. The idea is for the calling device to check the e164 directory first when dialing a phone number to see if it is possible to connect directly to the number over the Internet before then trying it through the public switched telephone network (PSTN). A good example of a device that could do something like this is the Cisco SPA3102 Voice Gateway. It is a good product but I never was able to configure it so that there was no echo on the analog phone line. The next problem is that hardly anyone lists themselves in any of the e164 directory services. So if you have everything setup to work you will have no one to call. Support for e164 will require some sort of critical mass before it gets that kind of support. Until that time it is still possible to bypass the phone company and be ready for that day.

I have to confess, my preferred solution is to have two phones. One connected to the phone company and one (the long distance phone) connected to a flexible voip service like Voip.ms. I continue to use the “plain old telephone service”. It is very well engineered and it integrates better with 911 service. I find that supplementing it with voip service is cost effective and gives me some extra flexibility.

My preferred ATA is the Cisco PAP2T-NA. I have family in other parts of the country. We tend to call them frequently so it is cost effective for all of us to adopt the dual phone strategy. Either ATA can be configured to dial a “hotline number” direct to the other ATA over the Internet before using the voip service in the dial plan.

In my next post I show how I setup direct ATA to ATA calls with the Cisco PAP2T-NA:

http://www.seephar.com/2011/03/direct-ata-to-ata-calling-with-the-pap2t-na/

Posted in voip | Tagged , , , | Leave a comment

No Asterisk at Home

I have spent too much time in the past experimenting with using an Asterisk PBX server in the home. I learned a great deal but I have to confess it makes no sense for the average user. I can’t suggest doing it. Don’t get me wrong. I like open source, internet based telephony. The great convergence continues. I have simply found an easier and more cost effective way to continue using Asterisk.

There are well managed services out there that allow significant and flexible access to a shared Asterisk server so that you don’t have to host one at home or at the small business. At home I have my Linksys PAP2T-NA ATA adapter and it connects to a Canadian service provider called Voip.ms which I have been using for a few years now.

Voip.ms offers a full range of voip services and appears to also cater to the needs of resellers. The configuration is exposed using a nice web portal. They support both SIP and IAX2, have server presence in Toronto, Montreal, major regions in the US and in London, UK. You can have domestic or international DID numbers even though you may live in London, Ontario you can have a phone number almost anywhere for your customers or family to make local calls to reach you. If you don’t want a phone number but want to only make outgoing calls at very good rates you may only want to use the call termination services, avoid the monthly cost of a DID and only pay when you use the phone.

For those unwilling to give up their “plain old telephone service” this may be a good way to supplement it with a lower cost long distance phone or an extra line to keep the other free from being tied up. You can also take this phone line with you when you travel or even run a soft phone on your laptop.

For someone familiar with configuring an Asterisk PBX server, the web portal is fairly easy to use. I think it is geared to a technical user so those unfamiliar with voip telephony will have a bit of a learning curve. The prices and flexibility make hosting your own server seem impractical to me.

Posted in asterisk, tech marketplace, voip | Tagged , , , , | Leave a comment

Insignia Infocast 3.5

Insignia InfocastBest Buy USA finally gave me an opportunity to get a Chumby powered device very similar to the Chumby One. As with the WikiReader, I had noticed that Best Buy USA had started selling the Insignia Infocast 3.5″ and it was normally $99.99 but was on special for $69.99. It caught my attention since I had been interested in the Chumby for a few years now but it had not been available in Canada until recently. I didn’t have an opportunity to pop over to Port Huron to buy one and missed the sale. I was quite surprised to find that it then started selling for $49.99 for a short period of time (back in December 2010, they since appear to be limited in availability and back at the higher price discontinued). I had to get it.

It has a USB port on the back allowing me to plug a flash drive and play my own music files. It also has a built in FM radio. It has replaced my 386 PC based wifi radio. It streams all my favourite internet radio stations. It uses much less power as would be expected in a device using an ARM processor. It shuts itself down and turns itself on with very flexible “alarm scheduling” options. Unlike the clock/radio it replaced, I can turn off the display and get rid of that horrible orange glow.

Best of all it is really a linux based computer with a 3.5″ touch screen. It also has the possibility of further customizability (thanks Bunnie, and again). It is also possible to write flash apps for it using actionscript , mtasc and swfmill. Here is a great example using these tools.

Best Buy's Chumby Like DeviceInsignia Infocast 3.5 Back

Posted in ARM, Buying Technology, efficiency, linux, wireless | Tagged , , | Leave a comment

WikiReader $39.95 at Best Buy Canada

The WikiReaderI have been interested lately in offline Wikipedia access and while searching I noticed that Best Buy was now carrying the WikiReader. This wasn’t surprising, I knew Futureshop has been carrying it for $69.95 for a while now but Best Buy is currently selling it for $39.95. At almost half the price it is irresistible.

The WikiReader is a small handheld electronic device that gives you access to an offline, text version of Wikipedia stored on the 4GB microSD flash memory card hidden in the battery bay. It sips power from two standard AAA batteries which are expected to last about ~90 hours or about a year of typical use. I like a device that is power efficient.

It uses an Epson S1C33 E07 microcontroller and 3.5″ monochrome, reflective LCD screen. It is a capacitive touch screen with an on-screen keyboard. It is definitely not as nice as Kindle’s E Ink screen and it certainly doesn’t use as much power as a backlit screen but it may not meet the expectations of some today. I think the trade off is worth it for the low price and excellent battery life.

The snapshot of Wikipedia it shipped with was from June 2010 and doesn’t include pictures, maps or illustrations. Updates are available through shipped flash cards for a charge or through free downloads from their site. If you wish to update to the September 30, 2010 (or Jan 15, 2011) snapshot it appears you need to use a larger flash memory card. They also have Wikipedia in other languages, Wiktionary, Wikiquote and Wikitravel available for download. They also now have 33,000 works from Project Gutenberg but you would need a 16GB flash card to fit both Gutenberg and Wikipedia. I will probably put the english Wikipedia, Wiktionary, Wikiquote and Wikitravel on an 8GB flash card and put Gutenberg on the 4GB flash card it came with and keep it for “just in case”.

WikiReader Side ViewI fear that many would feel this device is redundant in our smart phone infested world or with pervasive internet connectivity in urban areas. Before you discount this device consider that there are some definite uses. It doesn’t take long in my part of the world to escape coverage. There are more than a few of us who can’t justify the price of an annual data subscription. Roaming charges can be excessive while travelling and there are some who don’t even use the Internet. Remember paper encyclopedias? The WikiReader is much smaller, easier to upgrade and less expensive than the paper based alternative.

Posted in Buying Technology, efficiency | Tagged , , | Leave a comment