Skip to content

Scanning barcodes with linux and a webcam

My Nokia phones can do it, so I thought there must be a way to do it on my laptop too. I wanted a way to scan both "traditional" barcodes and "two-dimensional" ones, like the QR-Codes. Here is my solution.

You'll need :

- a v4l-compatible webcam + mplayer compiled with v4l support (or any other scriptable way to grab frames from the webcam)

- a scriptable image viewer, I use feh on my laptop

- ZXing

Follow the instructions to build the ZXing javase component, then open three shell windows, and run:

shell1 (grab the webcam output as last.jpg +- every half second):
cd /tmp ; while [ 0 ] ; do mplayer tv:// -fps 2 -tv driver=v4l:width=640:height=480:device=/dev/video0 -vo jpeg:quality=95 -frames 2 ; mv 00000001.jpg last.jpg ; done

shell2 (view what you grabbed):
cd /tmp ; feh -R 1/2 last.jpg

shell3 (scan for barcodes):
while [ 0 ] ; do ( java -cp javase/javase.jar:core/core.jar com.google.zxing.client.j2se.CommandLineRunner /tmp/last.jpg | fgrep -v 'No barcode found') ; sleep 1 ; done


So no nice GUI, but it seems to work well.


  • Twitter
  • Bookmark Scanning barcodes with linux and a webcam at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Scanning barcodes with linux and a webcam
  • Mixx Scanning barcodes with linux and a webcam
  • Bloglines Scanning barcodes with linux and a webcam
  • Technorati Scanning barcodes with linux and a webcam
  • Fark this: Scanning barcodes with linux and a webcam
  • Bookmark Scanning barcodes with linux and a webcam at YahooMyWeb
  • Bookmark Scanning barcodes with linux and a webcam at Furl.net
  • Bookmark Scanning barcodes with linux and a webcam at reddit.com
  • Bookmark Scanning barcodes with linux and a webcam at blinklist.com
  • Bookmark Scanning barcodes with linux and a webcam at Spurl.net
  • Bookmark Scanning barcodes with linux and a webcam at NewsVine
  • Bookmark Scanning barcodes with linux and a webcam at Simpy.com
  • Bookmark Scanning barcodes with linux and a webcam at blogmarks
  • Bookmark Scanning barcodes with linux and a webcam with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)

I wanted to try the new 2.6.25 kernel on a Sunblade 100 I'm reinstalling. But immediately after entering "make" I got the following error:
arch/sparc64/kernel/asm-offsets.c:1: error: -m64 is not supported by this configuration
arch/sparc64/kernel/asm-offsets.c:1: error: -mlong-double-64 not allowed with -m64
arch/sparc64/kernel/asm-offsets.c:1: error: -mcmodel= is not supported on 32 bit systems
make[1]: *** [arch/sparc64/kernel/asm-offsets.s] Error 1
make: *** [prepare0] Error 2


I found the solution here, along with the explanation. To make it short, to get it to work, for now you'll have to type:
 # CROSS_COMPILE=sparc64-unknown-linux-gnu- make


  • Twitter
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)
  • Mixx Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)
  • Bloglines Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)
  • Technorati Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)
  • Fark this: Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration)
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at YahooMyWeb
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at Furl.net
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at reddit.com
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at blinklist.com
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at Spurl.net
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at NewsVine
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at Simpy.com
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) at blogmarks
  • Bookmark Linux Kernel 2.6.25 on Gentoo sparc (error: -m64 is not supported by this configuration) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)

It seems that after having been up for a couple of days, the WAG200G starts having issues routing UDP packets properly. This particularly affects VoIP traffic (here IAX2 on port 4569). The symptoms are that "regular surfing" works flawlessly, but the registration with the asterisk server fails. tcpdump shows no traffic on the server side. Restarting the WAG200G immediately solves the problem.

Here is how I restarted the router from the command line:
wget --http-user=admin --http-password=pa55w0rd \
--post-data='reboot=1&save=Enregistrer+les+param%E8tres&todo=reboot&h_reboot=1&this_file=Reboot.htm&next_file=index.htm&message=' \
http://192.168.0.1/setup.cgi

(replace password and IP address as appropriate)
  • Twitter
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)
  • Mixx Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)
  • Bloglines Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)
  • Technorati Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)
  • Fark this: Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to)
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at YahooMyWeb
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at Furl.net
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at reddit.com
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at blinklist.com
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at Spurl.net
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at NewsVine
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at Simpy.com
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) at blogmarks
  • Bookmark Linksys WAG200G-EU stops routing UDP after a while (scripted reboot how-to) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Diskless Ubuntu (Feisty Fawn NFS install)

Tonight I installed my first diskless Ubuntu system. The version I used is the latest available as of today, 7.04 "FeistyFawn". This article covers the client part.

My other diskless machines all run Gentoo (for the time being). I've described previously how I set up my SB 100, the rest of the setup was based on this article.

The following two articles were helpful:

https://help.ubuntu.com/community/Installation/OnNFSDrive
http://developer.novell.com/wiki/index.php/Feisty/HOWTO:_Convert_Ubuntu_to_Diskless

However I found some of the info to be uncomplete or outdated.

From what I have read, unlike with Gentoo, it seems that there is no easy way to get a working diskless Ubuntu system directly. Instead, you have to install to a disk first, and then make your setup diskless. I did not really want to open the box, so I tried first to install on a 2 GB CF card, which didn't work because the card was full before the install completed (du now reports that the system is 2.1 GB big). So I ended up putting a disk in the box, and I ran a regular install.

Note: As in the SB100 article, 10.0.0.10 will be my dhcp/nfs/tftp server ('fileserver'). 10.0.0.30 will be the Ubuntu desktop.

Once that was completed, instead of rebooting as suggested by the installer, I opened a shell (gnome-terminal), and ran:
sudo su -
mkdir /mnt/tmp
mkdir /mnt/nfs
mount /dev/sda1 /mnt/tmp
mount 10.0.0.10:/diskless/ubuntu /mnt/nfs
cp -a /mnt/tmp/* /mnt/nfs/

After that, there are just a couple of things that need to be changed:
chroot /mnt/nfs
mount -t proc proc proc
vi etc/initramfs-tools/initramfs.conf

and make sure you have:
BOOT=nfs

then run:
update-initramfs -u

Now check what you have in /boot, and update your network boot config files accordingly. I use pxegrub, and here is how /boot/grub.lst looks like:
default 0
timeout 10
title=Diskless Ubuntu
root (nd)
kernel /diskless/tv/boot/vmlinuz-2.6.20-15-generic ip=dhcp root=/dev/nfs nfsroot=10.0.0.10:/diskless/tv ro quiet splash
initrd /diskless/tv/boot/initrd.img-2.6.20-15-generic

Finally, don't forget to update etc/fstab and etc/network/interfaces. I've read several theories, here is what worked for me:

fstab:
# /etc/fstab: static file system information.
#
#
proc /proc proc defaults 0 0
/dev/nfs / nfs defaults 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto 0 0

network/interfaces:
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
address 10.0.0.30
netmask 255.255.255.0
network 10.0.0.0
broadcast 10.0.0.255
gateway 10.0.0.1

(note: commenting out eth0 as suggested in some places made the system hang during the boot process.)
  • Twitter
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Diskless Ubuntu (Feisty Fawn NFS install)
  • Mixx Diskless Ubuntu (Feisty Fawn NFS install)
  • Bloglines Diskless Ubuntu (Feisty Fawn NFS install)
  • Technorati Diskless Ubuntu (Feisty Fawn NFS install)
  • Fark this: Diskless Ubuntu (Feisty Fawn NFS install)
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at YahooMyWeb
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at Furl.net
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at reddit.com
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at blinklist.com
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at Spurl.net
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at NewsVine
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at Simpy.com
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) at blogmarks
  • Bookmark Diskless Ubuntu (Feisty Fawn NFS install) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca

Lightning for x86_64 Linux (amd64)

Lightning is a Thunderbird plug-in that adds calendar functions. More on the mozilla.org page. I tried to install the .xpi from there, but it failed with the following error message:
"Lightning" could not be installed because it is not compatible with your Thunderbird build type (Linux_x86_64-gcc3). Please contact the author of this item about the problem.

So I downloaded the source from this page, and followed the instructions from here. This page and the link to that one were also helpful.

In case you don't want to open all those links, I've put the resulting .xpi file here for you to download: lightning-0.3.1-x86_64.xpi. Or if you prefer to build it yourself, here is how I did it:
[untar/bz, cd mozilla]
make distclean
export CFLAGS="-O2 -pipe -fPIC"
export CHOST="x86_64-pc-linux-gnu"
export CXXFLAGS="${CFLAGS}"
export MAKEOPTS="-j3"
ac_cv_visibility_pragma=no ./configure --enable-application=mail --enable-extensions=default,lightning
make

(of course you may want to change some stuff to better suit your system, I've got a Core 2 Duo laptop running Gentoo Linux)

Then just select Tools > Extensions in Thunderbird and install the lightning.xpi you've just built (located in dist/xpi-stage/lightning.xpi).


UPDATE - 2007-06-28 - Lightning 0.5

After reading Matthew's comment I downloaded the newly released Lightning 0.5 from here, and built lightning-0.5-x86_64.xpi following the exact same procedure that I used for 0.3.1. Then I installed it from Tools > Extensions, restarted Thunderbird and immediately noticed the different appearance. (I did not uninstall 0.3.1 first, which apparently is ok.)

UPDATE - 2008-09-28 - Lightning 0.9

Download from http://releases.mozilla.org/pub/mozilla.org/calendar/lightning/releases/0.9/contrib/linux-x86_64/
  • Twitter
  • Bookmark Lightning for x86_64 Linux (amd64) at del.icio.us
  • Facebook
  • Google Bookmarks
  • FriendFeed
  • Digg Lightning for x86_64 Linux (amd64)
  • Mixx Lightning for x86_64 Linux (amd64)
  • Bloglines Lightning for x86_64 Linux (amd64)
  • Technorati Lightning for x86_64 Linux (amd64)
  • Fark this: Lightning for x86_64 Linux (amd64)
  • Bookmark Lightning for x86_64 Linux (amd64) at YahooMyWeb
  • Bookmark Lightning for x86_64 Linux (amd64) at Furl.net
  • Bookmark Lightning for x86_64 Linux (amd64) at reddit.com
  • Bookmark Lightning for x86_64 Linux (amd64) at blinklist.com
  • Bookmark Lightning for x86_64 Linux (amd64) at Spurl.net
  • Bookmark Lightning for x86_64 Linux (amd64) at NewsVine
  • Bookmark Lightning for x86_64 Linux (amd64) at Simpy.com
  • Bookmark Lightning for x86_64 Linux (amd64) at blogmarks
  • Bookmark Lightning for x86_64 Linux (amd64) with wists
  • wong it!
  • Bookmark using any bookmark manager!
  • Stumble It!
  • Print this article!
  • E-mail this story to a friend!
  • Identi.ca