Archive for the 'HOWTO' Category

Mounting the Nokia 9300 file system on Linux with p3nfs

June 7, 2006

This is how I made my Nokia 9300’s file system available to my Ubuntu Dapper box. I can now copy/move files around, as well as edit files on the phone just like I could earlier with the 9210.


Browsing the phone’s filesystem in Nautilus

You need a working Bluetooth setup. See my earlier Bluetooth related HOWTO on how to find out your phone’s Bluetooth address with the hcitool and how to setup a PIN so you can pair the devices in a friendly fashion. You need to have portmap installed (in order to use any kind of NFS shares). Then you need the key ingredient, p3nfs. Download the ARCH Linux binary package and the corresponding nfsapp SIS installer for the 9300/9500.

1. Install nfsapp on the phone (send the file over via Bluetooth, or browse to the p3nfs homepage with the phone’s browser and download it)
2. Convert the ARCH linux binary package of p3nfs into a debian package and install it: sudo alien -i p3nfs-x.xx.pkg.tar.gz
3. Set the suid bit on /usr/bin/p3nfsd so that you don’t have to be root to access the phone’s filesystem: sudo chmod+s /usr/bin/p3nfsd
4. Bind an rfcomm device to your phone. The nfsapp uses the Bluetooth channel 13: sudo rfcomm bind /dev/rfcomm0 XX:XX:XX:XX:XX:XX 13 (XX:XX:XX:XX:XX:XX being your phone’s address)
5. Start nfsapp on the phone. Check that it’s using Bluetooth/13 to communicate. If not, press ‘p’ to change it
6. Make a convenient mount point in your home directory, such as ‘Phone’
7. Start p3nfsd: p3nfsd -series80 -tty /dev/rfcomm0 -dir /home/<username>/Phone
8. Browse to the Phone directory with a file manager or in the terminal
9. when you’re done, exit any application, file browser or terminal accessing the ‘Phone’ directory and unmount the phone: ls /home/<username>/Phone/exit — wait for output confirming that p3nfsd has exited cleanly

You would probably prefer not to type all those commands by hand every day, so make a few nice aliases in your ~/.bashrc:
alias bindcomm='sudo rfcomm bind /dev/rfcomm0 XX:XX:XX:XX:XX:XX 13'
alias mountphone='p3nfsd -series80 -tty /dev/rfcomm0 -dir /home/username/Phone'
alias umountphone='ls /home/username/Phone/exit'

NOTE: Do not mess with files on the E: and Z: “drives” on the phone. They belong the running system’s internal memory and touching that stuff may crash the phone and perhaps make it unbootable.

NOTE: This HOWTO is just a quick list of steps to get this working. It is not a substitute for actually reading the p3nfs README file. The p3nfs documentation also deals with situations when things are not working. I won’t, so don’t call me for support :)

Technorati Tags: , , ,

GPRS via Bluetooth and Nokia 9300

May 28, 2006

(Update: Instructions for connecting via the DKU2 cable now at the end of the post.)
This is how I made the GPRS Internet connection working from my Ubuntu Dapper laptop via a Nokia 9300 and Bluetooth. I found this info on an Ubuntu forums thread, kudos go to emperon:

  1. Have a working bluetooth setup.
  2. hcitool scan gives you your phone’s BD address. Make a note of this.
  3. sdptool search DUN will show you the appropriate channel to use. Make a note of this.
  4. Check that you have a 4-number code in /etc/bluetooth/pin unless your phone and the machine are very friendly already. Your phone may ask for this number later.
  5. Type rfcomm bind /dev/rfcomm0 X:X:X:X:X:X YY (where X:X:X:X:X:X is the BD address and YY is the channel number).
  6. Type rfcomm and check that the channel is either “clear” or “closed”.
  7. Create /etc/ppp/peers/gprs with the following contents:
    /dev/rfcomm0
    connect '/usr/sbin/chat -v -f /etc/ppp/peers/gprs.chat'
            noauth
            defaultroute
            usepeerdns
            lcp-echo-interval 65535
            debug
  8. Create /etc/ppp/peers/gprs.chat with the following contents:
    TIMEOUT                 15        
    ECHO                    ON
    HANGUP                  ON      
    ''                      AT
    OK                      ATZ     
    OK                      ATD*99*#
    (NOTE: *99*# above is the number to call. This one works for Sonera in Finland and many other providers, but call your friendly provider helpdesk and make sure you have the correct one.)
  9. Initiate bluetooth pairing between your phone and the computer.
  10. Make the call: sudo pppd call gprs
  11. Surf away!

Here’s instructions for connecting via the DKU2 cable supplied with the 9300. Cables are uncool and sometimes get in the way, but the procedure is simpler. This info comes mostly from gr0kzer0 in another forum thread:

  1. Install wvdial.
  2. Connect the cable.
  3. Run wvdialconf /etc/wvdial.conf
  4. Edit the /etc/wvdial.conf just created. Look at the last four lines, we edit the Phone, Password and Username lines (the username and password are bogus ones. wvdial wants non-empty ones but you can enter Batman’s credentials there if you like), and additionally force the modem into Stupid Mode.
    [Dialer Defaults]
    Init1 = ATZ
    Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
    Modem Type = USB Modem
    Baud = 460800
    New PPPD = yes
    Modem = /dev/ttyACM0
    ISDN = 0
    Phone = *99#
    Password = foo
    Username = bar
    Stupid Mode = 1

    (NOTE: Again try to find a suitable phone number)
  5. Now you should be able to dial out with wvdial or GNOME PPP.

Technorati Tags: , , , ,

Lifehack: how to erase permanent marker from your whiteboard

May 25, 2006

This must be the ultimate tip of the day. I know many people who sweat trying to clean their whiteboards, accidentally stained with permanent marker.  WikiHow has the HOWTO:

  1. Get the board you want the stuff off.
  2. Get a dry erase marker (yes, we will make marks to take marks) and a dry eraser.
  3. Draw over what you want to erase (make sure you draw slowly to fill it in better).
  4. Erase.
  5. Done!

I haven’t tried this yet, but soon will since my whiteboard is in a pretty sorry state. :)
(Via Lifehacker.com)

Upgrading Ubuntu now a snap!

May 22, 2006

Ubuntu Breezy users can now upgrade to Dapper more easily than ever. (Actually, someone who isn’t comfortable with the standard Debian dist-upgrade method shouldn’t upgrade before Dapper stabilizes on June 1st, but the method is already there.) I don’t think any other operating system is this easy to upgrade. Daniel shows us how in his blog:
daniel.holba.ch/blog » Blog Archive » Upgrading to Ubuntu 6.06

Technorati Tags: ,

Integrating your personal information space with “The Searchable GNOME”

May 14, 2006

GNOME 2.14 has been unofficially dubbed “The Searchable GNOME” for a reason. The latest iteration of GNOME takes desktop integration to a level where you can stop caring about the whereabouts of files on your file system, or indeed about the location of a specific piece of information in your personal information space or on the Internet. You probably already have forgotten where you files are, so the key to achieving the best possible comfort is

  • Accept the fact that you have no idea where your stuff is;
  • Realize that most of your data is in digital form, or can be digitized;
  • Make sure that all of your personal information space is searchable, both online and locally
  • Use the right applications! Always be prepared to sacrifice your favorite application in favor of one that integrates to your working environment most seamlessly

Your information space consists of all the stuff you have on your computer’s home directory (mail, documents, calendar entries, chat logs…) and, optimally, everything you have read and seen on the Web. All this information should be at your fingertips at all times.

GNOME hacker extraordinaire Jeff Waugh put it best in a recent interview: we need to get rid of the WIMP (Windows, Icons, Menus, Pointer) paradigm which has dominated on the desktop for so long because

“when I wake up in the morning, I don’t think that I have to rearrange my windows and sort my icons — they’re not the things that I find important. The things that I actually care about are people, events, documents and getting laid.”

So we need a user interface that doesn’t get between us and those things that really matter.

So this is how close to Luis I can get though a single text entry widget on my desktop, the Deskbar applet: from this single interface, I can mail him, go to his home page as well as other relevant pages via a Google search, open past e-mail and chat conversations with him, and peruse any document on my hard disk mentioning him.

Searching for Luis
Fig. 1: Searching for Luis


Note that there is no indication in the above screenshot to the applications that will be used to handle this data. I don’t care, and I shouldn’t be bothered with such details. If I want to contact Luis, I want to click his name and write him a message. I certainly don’t want to peruse my application menus to find an e-mail application, open a contacts database to find his address and then try to remember what I wanted to say to him. Also, I don’t want to open a presentation program, find a file (hoping I have given the file a descriptive name and archived it into a reasonably discoverable directory structure) and open it. All I want is Luis-information!

The first commandment in making your stuff searchable: build your desktop around Beagle, and only use applications that Beagle is aware of. Do not give in to the lure of a non-beaglified application, be it as awesome as it may, if there is a beagle-aware application available. In short, choose freely from the list of supported applications on the Beagle home page, but do not look elsewhere. I’m sure Opera is a cool browser, but if you want your browsing history indexed by Beagle, don’t use it. If you use Thunderbird, switch to Evolution. Read news feeds with Liferea or Blam. Keep your notes in a Tomboy sticky wiki. Index your photos with F-Spot. Learn to love these programs, you have no choice. Your life will be easier. Really.

Believe the Web2.0 hype. Well, some of it. Much of your data should live online. Switch to Gmail instead of keeping huge local mail archives, simply because Gmail is more searchable. With Gmail you can keep all your mail, and you don’t have to organize it because their search is faster than your ability to figure out the organization plan you had in mind a year ago. I’m sure other mail services are just as nice, but a plugin happens to be available which integrates Gmail into the deskbar and thus into your desktop. Use del.icio.us and tag all interesting pages so they are also searchable from the deskbar. Another upside with keeping your data on other people’s servers is that (let’s face it) Google’s servers are more likely to stay up 24/7 than yours so you can get to your data from any machine, anytime. Similarly, use F-Spot to tag your photos and upload them to Flickr (why Flickr of all the photo upload services on the Web? Because that’s what F-Spot supports, and F-Spot is what Beagle supports!) Use Gmailfs or Box.net to store data you might want to keep accessible at all times.

Keep your address book and calendar online, especially if you need to access it from different locations and devices. I keep my info on the ScheduleWorld.com servers because they’ve built their service on open standards. The SyncML, iCal, and LDAP protocols they use enable me to handle and access my data from my desktop, laptop, and mobile phone, and keep them all in sync at all times. This is doubly valuable for someone who use the forbidden combination of a Nokia smartphone and Linux systems. Since I use Evolution on the desktop, my address book and calendar are integrated in all my GNOME applications where it makes sense.

The days of totally transparent interfaces has not yet come, and we cannot get to people, events, documents, or laid with the power of thought alone quite yet, but there’s no reason not to make handing our information as easy as possible.

Disclaimer: the above concerns the data in my personal information space. I have made accessing my information as easy as possible, not as secure as possible. Some of the methods, such as accessing Gmail via the deskbar, are inherently insecure. I don’t recommend using similar methods for your million dollar company’s customer database and information like that.

Technorati Tags: , , ,

The last of the Linux-friendly graphics chip makers

April 10, 2006

For years, when newbies asked me which graphics card they should get when building a Linux box, the answer was easy. Unless you need bleeding-edge 3D support for, say, playing Doom 3, buy a Matrox card. I was always very happy with my Millenium G550 card’s 2D performance, which is what really counts on a serious workstation, and I always got enough DRI support to play simple 3D games and graphics hacks. Matrox used to support new versions of X with their binary drivers, which were incorporated into XFree and X.org sources pretty soon afterwards.

Now that Ubuntu Dapper uses the new X.org 7.0, i naturally wanted to play with cool and useful effects that the bleeding-edge XGL extension supports, so I needed DRI. Direct renedering was apparently not supported with the free mga drivers in X.org, so I readed for the Matrox website for drivers. Turns out Matrox had no driver for X.org later than version 6.8.1, and judging from the responses by Matrox representatives on their support forums, we shoudln’t even expect them any time soon. Perhaps the Matrox hackers have assumed the stagnated state of mind of the old XFree team and got scared of the brand new modular X that the 7.0 release represents, or perhaps the company policy has changed, I don’t know. No explanation there, beyond “no ETA at this point” for the drivers. Daunted, I went on to do other stuff.

This morning I returned to the support forums, only to find that the Linux forum was locked, no new posts could be submitted. Apparently Matrox had grown weary of the Rants of the Linux users (who had been spoiled with quick delivery of drivers in the past), and decided to simply shut off this channel of critique. Daunted, and this time very pissed too, I turned to Google for a last search for a solution.

Lo, Google directed me to Arch Linux Wiki, where somebody had indeed come up with a fix involving a simple change in the xorg.conf file and the free mga driver in X.org. I quickly applied the fix (edit xorg.conf, add

Option “OldDmaInit” “true”

to your “Device section), tested and saw that it was good.

So now I have DRI, but I have no graphics chip maker to recommend to newbies. I never guessed Matrox could afford to lose the strong support they’ve had from Linux/X users over the years now that they’re losing the game to NVidia and ATI already. Now all I can say is, ATI is the worst one because their proprietary drivers are constantly broken. Matrox is close to the bottom, since they have no binary drivers at all, and we don’t know how much they are interested in giving the X community’s free drivers. NVidia has very good proprietary drivers for linux in case you don’t mind using them.

One of the best things about Linux has been that you almost never needed to hunt down and install drivers for your hardware, as Windows users are accustomed to do. If things continue to decline, we will always need to find the correct drivers (non-free drivers no less!) to get decent graphics support.

Woe is me. Please tell me I’m wrong and Matrox cards will work out of the box like they used to Real Soon.

Restoring a Debian Box

March 28, 2006

Here's a good method for saving and restoring a Debian installation. Of course, you have all data from /home on a partition of its own, and the configuration files in /etc are backed up. You naturally have saved a copy of your sources.list.

First, save the package states while the system is still working well:
dpkg --get-selections > (filename)

After a disaster, you can now restore the system to its original state: install a minimal system (no packages beyond the base system). Then:

dpkg --set-selections (filename)
apt-get dselect-upgrade
apt-get dist-upgrade
apt-get upgrade

Now you can just slam the configuration files to /etc from your backups.

Downgrading Packages in Debian

March 28, 2006

Here’s a method of downgrading debian from unstable to testing. Might work, might not.

From Travis Crump:

Package: *
Pin: release a=testing
Pin-Priority: 1001

in /etc/apt/preferences, and do an apt-get dist-upgrade, apt will happily try to downgrade every package to its testing
version[alternatively adding that to /etc/apt/preferences will let you do apt-get install without needing the version number]. It just isn’t guaranteed to work, and isn’t considered a bugif it doesn’t.

Backing Up Hard Disk Info

March 28, 2006

From clearthink

But in an effort to eliminate recurring errors, I strongly encourage users to include the output of the following commands in a log file or readme file added to your backups …

fdisk -l /dev/hda (/dev/hdb, /dev/hdc, … as needed)
dumpe2fs /dev/hda1 (once for *each* partition on hda. see output of fdisk above)
(do not do dumpe2fs on the swap partition)

The first command tells how your disk is partitioned. The second command includes all the technical data including the superblock locations. If this data is included on a tape or CD backup it canbe easily retrieved when you need it.

N-Up Printing with CUPS

March 28, 2006

Not all apps are N-Up friendly, but you can tell CUPS to print multiple pages on a single sheet. Here’s a tip I found on the Internet some time ago:

The -o number-up=value option selects N-Up printing. N-Up printing places multiple document pages on a single printed page. CUPS supports 1, 2, 4, 6, 9, and 16-Up formats; the default format is 1-Up:

lp -o number-up=1 filename ENTER
lp -o number-up=2 filename ENTER
lp -o number-up=4 filename ENTER
lpr -o number-up=16 filename ENTER