Blog Entries tagged linux
Feeds: RSS | Atom

Fancontrol not working after resume on Ubuntu

Published: 2013-03-02 08:18 UTC. Tags: linux

Bought a new computer. Had some trouble with the fan controller built into the chassis, so got a couple of PWM fans instead since the motherboard can control 1 CPU and 3 chassis PWM fans.

The BIOS however was a bit limited when it came to how slow you could make the fan run. So turned to the fancontrol package in ubuntu, and after some fiddling it worked as intended, even turning off the case fan when the temperature was below the configured threshold.

However, after suspending then resuming, the fan would go at 100% again, and not spin down. There's a launchpad bug that tells me I'm not the only one with this problem.

Here's a workaround. Create /etc/pm/sleep.d/20_fancontrol with the following contents:

#!/bin/sh

case "${1}" in
    resume|thaw)
      /usr/sbin/service fancontrol restart
      ;;
esac

This will restart the fancontrol service after resume, which solves the problem. The fan will run at 100% for a little while at resume, since it takes a couple of seconds before this script is being run.

0 comments.

Java SIGBUS - an unclear way of saying /tmp is full

Published: 2011-05-02 19:27 UTC. Tags: linux java

I had the following happen for every new java process on one of my servers the other day:

server:~$ java
#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0x7) at pc=0x00007f3e0c5aad9b, pid=17280, tid=139904457242368
#
# JRE version: 6.0_24-b07
# Java VM: Java HotSpot(TM) 64-Bit Server VM (19.1-b02 mixed mode linux-amd64 compressed oops)
# Problematic frame:
# C  [libc.so.6+0x7ed9b]  memset+0xa5b
#
# An error report file with more information is saved as:
# /home/user/hs_err_pid17280.log
Segmentation fault

Turns out this is Java's way of telling you that the /tmp directory is full. It's trying to mmap some performance/hotspot-related file in /tmp which succeeds, but when it's trying to access this area, it will get the SIGBUS signal.

More info here

0 comments.

Command Line Copy and Paste in Gnome Terminal

Published: 2010-04-10 11:08 UTC. Tags: linux

In the category Stuff I really should have learned several years ago, I now know that the keyboard combinations for copying and pasting in gnome-terminal is Shift-Control-C and Shift-Control-V

Now, if I could find out how to do select text without using the mouse...

0 comments.

Playing with a SkyTraq Venus GPS logger under Linux

Published: 2009-07-28 21:40 UTC. Tags: linux gis

I got a new toy today - a GPS logger. Got it as part of a magazine subscription deal - two issues + GPS logger for about $12. That magazine was not my kind of magazine, but getting a GPS logger delivered home for $12 was worth having to throw away two magazine issues :-). For other people trying to get this to work under Linux, the magazine in question was Aktiv Träning.

After some fiddling, I came to the conclusion that the device is based on the SkyTraq Venus chipset:

skytraq: Venus device found: Kernel version = 1.3.3, ODM version = 1.4.5, revision (Y/M/D) = 07/12/11

After plugging the device into an USB port, it appears as a serial port, in my case /dev/ttyUSB0. The data can be retrieved using GPSBabel, but it has to be the development version - the stable version does not feature the skytraq driver required. The development version is available via CVS from sourceforge, see http://sourceforge.net/projects/gpsbabel/develop for details on how to access CVS.

Once you have the development version of gpsbabel, getting the data is as easy as:

./gpsbabel -D 9 -i skytraq,initbaud=38400,baud=38400,erase -f /dev/ttyUSB0 -o gpx -F out.gpx

This will write the GPS coordinate log to out.gpx in the GPS Exchange format - a lightweight XML format.

The above command will also erase the log from the device, so the next download contains just the latest log.

Since I like playing with Google Earth, I also learned that the GPX can be converted into KML - the format Google Earth can read, by running:

./gpsbabel -i gpx -f out.gpx -o kml -F out.kml

Just open out.kml with Google Earth, and you'll see where the GPS logger has been.

On popular request, here's a few images of the device.

Skytraq Venus device Inside the battery compartment of a Skytraq Venus device

The label inside the battery compartment has the following text:

GT-750F/L-Lite
GPS Receiver(Data Logger)
RoHS CE FCC ID:VHP-750F
Made in Taiwan CANMORE
0 comments.

Calculating the Distance of a GPS log

Published: 2009-07-28 21:20 UTC. Tags: linux gis

Playing with my GPS logger, I wanted to know the distance travelled between all the points in a GPS log. For example, if I went for a bicycle trip and brought the logger, it would be nice to know how many kilometers I have travelled.

Trying to find a tool that did this without being cumbersome to use proved more difficult than I thought, so I did a quick hack with the help of the python bindings for gpsd. It's a very simple script:

$ ./distance.py promenad2.gpx
427.077378454

Given a GPX file, it will print out the number of meters travelled.

Fetch it in the fgpstools repository on github

0 comments.

ATI RS690+dualhead+resume from disk

Published: 2009-02-12 17:23 UTC. Tags: hardware linux

The ATI fglrx driver I run against my ATI RS690 chip in my dualhead setup definitely has its quirks. When resuming from disk, both monitors must be turned on when I press the computer's power button, or the X server will behave very odd.

Hard to describe what happens, but when moving the mouse, the whole desktop image is moved instead of only the mouse pointer.

Hardware! I hate hardware! I want all of it to be emulated in software.

1 comments.

Finally, Suspend to Disk is working!

Published: 2009-02-06 22:05 UTC. Tags: linux

I've never had any luck with the suspend to disk functionality on Linux, but now, after upgrade to Ubuntu 8.10, it's working, even at my home workstation with mirrored disk setup.

Some people had it working years ago, so I guess I've been having bad luck with my hardware combos or something. Still, this is an area where Linux has definitely been behind Windows - where this stuff just works. That is on the other hand probably mostly because the hardware manufacturers only test on Windows.

Regardless of who's to blame for the previous trouble, I'm happy with the fact that it's now working - I enjoy being able to shut down the computer and then start it again in the state I left it. Leaving it on just for that purpose is not something I want to do, trying as I am to be a responsible energy consumer.

0 comments.

Dualhead at home

Published: 2009-02-04 19:27 UTC. Tags: open source hardware linux syncmaster_204b
Dualhead setup

I upgraded my home workstation to Ubuntu 8.10 the other day. I was kind of worried that this would cause trouble with my X Window System setup. I've had major trouble with my Samsung Syncmaster 204b before, with its faulty DVI implementation being the major source of trouble.

My worries were well justified - no image on DVI after reboot. Tried connecting it via VGA, and that kind of worked - a slight fuzziness, which almost went away after pressing the auto-adjust button on the monitor.

I got tired of the monitor and decided to go for a new one - so I ordered a Benq FP241W 24" WIDE TFT. It's using the less common MVA display technology instead of the more common TN. This is supposed to mean that it's colours and viewing angle are superior to standard panel.

Thinking about it, I came to the conclusion that I might be able to stand a slight fuzziness on my 20" samsung if using it as a secondary panel in a dualhead setup. So, when the new panel arrived, I connected the 20" Samsung via VGA, and the new monitor via DVI.

With my usual luck, I got the same problems with the new panel as with the old one - problems syncing the DVI signal, with the result being that the panel went black.

However, after switching from the open source ATI driver to the proprietary fglrx driver, things started working, and using amdcccle, the ATI driver control program, setting up dualhead was really easy.

The result - a resolution of 3840x1200 at home. That's even slightly better than at work, where Opera Software have equipped me with a 19"+24" combo.

I'm not looking forward to the next Ubuntu upgrade, though. Sometimes, I just hate the X window system.

1 comments.

Ripping 300 CDs..

Published: 2009-01-19 19:52 UTC. Tags: linux squeezebox

I'm currently in the process of transferring my CD collection into digital format for use with my Squeezebox. This is a major project when you own around 300 CDs..

Stack of CDs

Ripping CDs, but to what format?

I did some thinking and evaluation before choosing format for the storage of my CDs in digital format;

Ogg Vorbis

Ogg Vorbis was one of the alternatives. It is patent free, which would fit my free software background. There are a whole bunch of devices supporting it, but with the SO buying a new mp3 player that didn't support Ogg, and the Squeezebox only half-supporting it, Ogg was unfortunately not an alternative.

FLAC

FLAC were another alternative. Free, and also lossless - the thought of actually storing the CDs without loss of data was tempting. Again, it fell on compatibility. Finding devices such as mp3 players and car audio equipment.

One option would have been to store as FLAC and then recode everything to mp3, possibly on demand, but I demeed that out as too much work with little gain.

MP3

So, as you might have guessed, for compatibility, I choose to rip my CDs to mp3. I'm using the LAME encoder with the best quality variable bitrate (VBR) encoding. According to the Hydrogen Audio Wiki, LAME has the best VBR encoder out there.

The resulting MP3's play directly on the Squeezebox hardware without problems, and works as intended in the SO's mp3 player as well.

1 comments.

QNAP TS-109 II - First Impressions

Published: 2008-12-02 20:06 UTC. Tags: linux review ipv6 turbostation

I bought a second hand Squeezebox the other day. The Squeezebox must read its files from a server running Squeezecenter, and since I don't want my workstation running all day (it's consuming energy. I'm trying to be environmentally friendly when I can), I had to find a low-power alternative.

I have been thinking about getting some kind of server running at home for a while. There are other things I want it to do as well:

  • Keep a SixXS IPv6 tunnel up, and route an IPv6 subnet for home.
  • Be able to Wake-on-LAN my main workstation.
  • Get better network throughput than from my stupid 3com NAT box.
  • Etc, etc..

After some consideration, I bought a QNAP TS-109 II. It has a 500MHz ARM processor, 256Mb of RAM and consumes 14Watts of energy when active, 6,6W when not. That's quite OK. I bought a WD Caviar Green 500Gb hard drive for it. That drive is supposed to be quiet and energy efficient.

Another killer fact about the QNAP is that the upcoming Debian Lenny will have official support for all TurboStation models from QNAP. It's even listed as a press release on QNAP's webpage. The installation link from the press release doesn't seem to work anymore, though. The Debian on QNAP TS-109 pages are very helpful, though.

The QNAP + hard drive arrived today, and I unpacked and assembled the two (very easy), plugged it in, found its IP address from the list of DHCP entries in my NAT box, and tried to connect to it via a web browser on both port 80 and port 8080.

Unfortunately, I was met by a message in several languages basically telling me that "This box is not initialized, do what the manual says". And the manual says that you need a Windows computer to initialize the TS-109.

Doh!

I don't own a Windows computer!

Fortunately, my girlfriend has an XP box which I could use to run the "QNAP Finder" to install the QNAP. Still, I find this irritating. There's support for Mac as well, but I don't have any Mac neither.

I'm sure there's some way of initializing the device without Windows, but that might require lot's of knowledge on the RPC protocol used to talk to the device. Presumably, it's some kind of RPC over HTTP, as the only ports the device has open at initial startup is 80 and 8080.

Navigating around in the menus for a while, I was not surprised to see that running Debian on the machine would be the best option for me. Specifically:

  • There's no support for NFS on the TS-109 II. You need the TS-109 II Pro for that.
  • There's no network routing support in the standard firmware, and that's not surprising - this is a NAS box afterall. But with Linux and it's VLAN support and iptables, it should work well. We'll see about that... :-)
  • The configuration can't be easily handled via Puppet when running the standard firmware. That's something I do for other servers I manage.

Anyway, I think I'll be happy with this box. I might add an external eSATA enclosure later to provide backup of the stuff I keep on the QNAP. We'll see. Backing up stuff to Amazon S3 is another option.

0 comments.

Enabling IPv6 in Dovecot and Postfix

Published: 2008-11-29 20:20 UTC. Tags: linux network ipv6

I realized after some testing that neither Postfix (my MTA), nor Dovecot listened to IPv6 by default. In both cases, enabling IPv6 was easy.

(This is where I found out that my algorithm for getting parts of an entry and showing it on the front page doesn't work that well.. so therefore, this text has been added, as it works as a workaround).

Postfix

Set the inet_protocols parameter in /etc/postfix/main.cf:

inet_protocols=all

The default value is ipv4.

Dovecot

Set the listen parameter in /etc/dovecot/dovecot.conf:

listen=[::]

At least on Linux, this will make Dovecot listen to both IPv4 and IPv6. Setting the value of listen to *, will make it listen only to IPv4.

Apache

My apache server happily picked up the presence of an IPv6 interface after a restart. This is probably due to the fact that I have a the following in my Apache configuration:

listen=*
0 comments.

Samsung 204b + ATI Radeon 9250 SE - the saga continues

Published: 2007-11-18 19:21 UTC. Tags: hardware linux review syncmaster_204b

I've previously written about my adventures in getting my Samsung 204b, made in Slovakia, to work properly in 1600x1200 at 60Hz (short story: Can't be done due to bugs in their DVI implementation).

Yesterday, I decided to upgrade my home workstation from Ubuntu 7.04 to 7.10, and of course, the flickering screen syndrome came back.

After lot's of tests with many different options in /etc/X11/xorg.conf, I got some help in a local forum, and came to the conclusion that modifying xorg.conf doesn't help. Using the xrandr command does however offer a way to solve the problem.

I how have the following list of commands in my /etc/kde3/kdm/Xsetup (I use kdm to start my X server, if you use another display manager, adjust the path to one that makes sure the commands are run right after X server startup):

xrandr --newmode "1600x1200@55" 150.0 1600 1804 1996 2160 1200 1201 1204 1250 +hsync +vsync
xrandr --addmode DVI-0 1600x1200@55
xrandr --output DVI-0 --mode 1600x1200@55

Gosh. Seems like there's some kind of bug in the ATI driver in the X.org 7.2 packaged with Ubuntu Gutsy, or perhaps in X.org itself.

0 comments.

Samsung Syncmaster 204B [R] on DVI - don't try that at home!

Published: 2007-01-03 01:08 UTC. Tags: hardware linux syncmaster_204b

Note: This instruction is valid for the ATI driver included with Ubuntu Feisty Fawn (7.04). There's another entry on how to get it working in Ubuntu Gutsy (7.10).

I recently decided that it was time to replace my old trustworthy Nokia Multigraph 446XPro CRT display with a flatscreen. The 446XPro has server me well at various computers at home since 1998 (that's eight years!) but it was time for something less space-consuming on my desk. Also, I like the feeling of not sitting in front of an electron beam several hours a day.

My list of specifications for the replacement was rather short:

  • Must handle a resolution of 1600x1200 (I've been working with this resolution for many hours a day for the past 8 years, so I'm quite used to it)
  • Adjustable height
  • Reasonable price
After some research, I bought a Samsung Syncmaster 204B which seemed to be a reasonable fit given my specifications. As we'll see, the word Syncmaster is somewhat ironic in the name of the product... Also, it turned out that I got a Samsung Syncmaster 204B [R], which turned out to be very significant..

I got the screen just a few days after ordering it, and connected it to my graphics card, a ATI Radeon 9200SE, via analog VGA. After adjusting the vertical refresh to the recommended 60Hz, I got the display working, but with some distortions which made it hard to work with given the high resolution and the small font I use for displaying information. This was a disappointment. Obviously, the VGA decoder in the screen is not good enough to handle the recommended solution.

As a colleague of mine had similar trouble at work and solved them by switching to a graphics card with DVI output, I decided to go the easy way and buy a new graphics card, as the graphics card I had lacked DVI output. It turned out that the 9200SE was the very last card in the series that only had analog VGA output. My usual luck with hardware..

I bought a ATI Radeon 9250 as replacement and installed it. This gave me a sharp image. Yay! Or so I thought, because now, the screen started to go blank now and then with irregular intervals. It went completely black and then came back after half a second or so. Boy, that's irritating!

After many attempts, I managed to find the right words that made Google lead me right. This forum article led me to this forum article which describes the problem - it's a bug in the DVI implementation of Syncmaster 204B [R]. It can't handle the bandwidth. Gah! My usual luck with hardware..

The forum articles says this bug appears only on Syncmaster 204B [R], and only on models made in China. The latter seems not to be true, as mine is made in Slovakia.

There's a workaround - by lowering the vertical refresh to 56Hz, the problem goes away.

I'll do what I can to get a new screen without this bug anyway.

Here's my xorg.conf I use with the Radeon 9250 and the Syncmaster.
4 comments.

Installing Ubuntu on a machine with no CDROM drive

Published: 2006-11-29 21:35 UTC. Tags: software linux

Today I had to install Ubuntu on one of the older machines in the computer room. It's a 1U server without CDROM drive.

Ubuntu doesn't seem to ship any floppy images. It does ship a utility to boot from IDE CDROM drives in the case where the BIOS is too old or full of bugs preventing it to boot from the CDROM. You can do that by creating a floppy that has drivers for the CDROM and allows booting from the CD. To be specific, the image shipped with the CD contains Smartbootfloppy which has a webpage (sort of) at http://btmgr.sourceforge.net/

However, since this machine had no CD at all, this didn't solve the problem.

My initial thought was to try using a CDROM drive connected to the USB port (at least the machine is new enough to have two USB ports). This however proved impossible due to the BIOS lacking functionality to recognize and boot from USB CDROM drives. And the boot manager from Ubuntu doesn't recognize USB drives either. Dead end.

I did some research on this, and found several places where people were asking how to do, but no places where people actually got good answers.

The solution to my problem was to create a boot floppy with etherboot. I went to http://www.rom-o-matic.net and located my network card in the dropdown. I was lucky enough to know the exact PCI ID numbers of the network card which helped in finding the correct driver. If you don't know, try to locate the card by name in the list. Opt for a bootable floppy image, download it and then write it to a floppy per the instructions on the site.

You then need to configure a tftp server on another machine on the same network. The server should be configured to serve the contents of /install/netboot directory of the Ubuntu CD as root directory. This way, when the computer you are about to install asks for the file pxelinux.0, the pxelinux.0 in /install/netboot on the Ubuntu CD will be served.

I did this by installing the atftpd package, mounted my ubuntu CD on /media/cdrom and added /media/cdrom/install/netboot as commandline argument to in.tftpd in /etc/inetd.conf. Don't forget to restart inetd after doing this.

I then configured my DHCP server as follows:

host tobeinstalled {
        hardware ethernet 00:80:C8:F8:51:25;       
next-server myinstallhost;
        filename "pxelinux.0";
        allow bootp;
        allow booting;
}      
This will make dhcpd tell the client that it should ask myinstallhost for pxelinux.0 at boot.

Inserted the floppy in the computer to be installed and rebooted it. It downloaded a bunch of files via TFTP, and then gave me the regular Ubuntu install prompt. Yay!

3 comments.

'locate' on SuSE-based Distributions

Published: 2006-01-30 13:01 UTC. Tags: software linux

One of the things that always get me irritated when I have to work with a SuSE-based Linux distribution is the missing locate command.

For future reference, it's available in the findutils-locate package, so the next time I forget the name of the package, I can search my blog :-).

1 comments.

New Keyboard at Home - trying out the Microsoft Natural Ergonomic Keyboard 4000

Published: 2006-01-21 21:13 UTC. Tags: hardware linux

I accidentally poured too much water into my old trusty MS Natural Keyboard (bought sometime in 1999 or so). Very sad, since I very much enjoyed it. I still use this kind of keyboard at work, though.

I tried to take it apart to let it dry, but unfortunately, it didn't help. Must be some corrosion somewhere in the layers of metal-covered plastic that keep track of which key was pressed, since only some of the keys are malfunctioning.

As a side note, the old keyboard had the text "Keytronics" printed on some of its internal parts.

Since I've really enjoyed this keyboard, I decided to try the new generation of MS Natural Keyboard, and tried a MS Natural Ergonomic Keyboard 4000 at a local hardware store. It felt nice, so I bought it.

I unpacked it yesterday, and to much irritation, the F3-F12 buttons didn't work at all, not giving any keycode back. Mumbling about Microsoft doing stupid things, I went to bed.

This morning, after doing some google queries, I found out that you must have the "F Lock" button pressed to get all F-keys working. Not 100% obvious, if you ask me.. but I guess that's what I guess for not following the instructions about installing the software before plugging the keyboard in. Not that I expect a Linux version of the software on the CD.. :-)

There are some keys on the keyboard that don't give any keysyms, including the zoom key in the middle. There seems to be ongoing work on a Linux driver for this hardware, that will enable this as well. All important keys do however work.

So, what about the ergonomics and feeling of the keyboard? Well, after typing a while, my initial impression is that I really like it. I've had to adjust my armrest's positions a bit to compensate for the slightly higher keyboard (I'm currently trying it using the piece of plastic that makes it higher in the end faced to me. It does make the keyboard look like an UFO, but it feels right!).

The feeling of each keystroke is quite similar to the old one, perhaps being a little bit softer. The space button is a bit harder to press down, and the enter key is a bit smaller, but so far, I haven't managed to hit it.

I usually don't enjoy products from Microsoft, being a user mostly of Linux and other UNIX derivatives, but their keyboards are very good.

2 comments.