Posts Tagged ‘ubuntu’

linux ath9k slow wireless

December 5, 2013

I was setting up a new wifi card on Kubuntu 12.04 and the wireless was really slow and inconsistent. Websites would not load and pings would be anywhere from 2 ms to 5000 ms. Some didn’t return at all. I found a post about reducing the wifi tx power but it didn’t help. However, changing some modules settings did the trick.

To test I did

sudo modprobe -r ath9k
sudo modprobe ath9k nohwcrypt=1

Immediately wireless started behaving better. Great speed, pings consistent. To make this change permanent I did

sudo -s
echo "options ath9k nohwcrypt=1" > /etc/modprobe.d/ath9k.conf

Flash plugin not detected after upgrade

March 21, 2013

After a recent upgrading of all packages on my Ubuntu 12.04 machine, which included upgrading to Firefox 19.0.2, Firefox could no longer find the Flash plugin. This was weird because:

  • Chrome did have the flash plugin and was working fine.
  • Package manager software said the flashplugin-installer package was installed.

But about:config showed no flash plugin and /usr/lib/mozilla/plugins/ contained no flash*.so file.

To resolve this I closed Firefox, then ran

sudo agt-get --reinstall install flashplugin-installer

After the install ran, flash was back.

Non-root wireshark capturing in Linux

May 29, 2012

 On Debian-based platforms (such as Ubuntu) by default you can’t capture data unless you are root. Some information about this is given here. However you can change this so anyone in the wireshark group can capture.  There is a security concern in this but it seems to me not much worse than starting a root shell to do the capture.

First reconfigure the wireshark install.

$ sudo dpkg-reconfigure wireshark-common

Select ‘Yes’ to enable SUID in wireshark.

Now add the users you want to the wireshark group.

$ sudo adduser user1 wireshark

You may also need to set caps.

$ sudo setcap 'CAP_NET_RAW+eip CAP_NET_ADMIN+eip' /usr/bin/dumpcap

Before you are able to capture you will need to log out and log back in again for the groups change to take effect.

More info on capture priviledges.

KDE Debugging / Synergy Plasmoid

March 2, 2012

I’m setting up a new laptop and trying out Kubuntu 11.10 (Oneiric Ocelot). KDE 4 has a nice widget for easily turning Synergy on and off. I was able to get the widget by going through the Add Widgets menu and clicking on Get New Widgets, then Download New Plasma Widgets. There I searched for synergy and it was the first result. I installed it with no issues. However, when I went to add it to my desktop I got the following error.

Could not create a ruby-script scriptengine for the Synergy widget

I figured this was a dependency issue and did some searching for the packages I would need. Then I installed these.

$ sudo apt-get install ruby-kde4 ruby-plasma korundum4 ruby plasma-scriptengine-ruby

This automatically installed a lot of other packages too. I removed the widget and added it again, but now I got a different error.

Script initialization failed.

Starting to dig a little deeper I found out about a useful tool kdebugdialog that allows enabling debugging on different levels of KDE components. However, I also found that I could launch the plasmoid from a shell and see the debug output directly.

$ plasmoidviewer /home/user/.kde/share/apps/plasma/plasmoids/synergy

This started the plasmoid and I saw an error in the logs

in ‘const missing’: uninitialized constant KDE::UrlRequester (NameError)

I tried some other packages but was unable to avoid the error. I finally found the official page for the Synergy plasmoid and saw that it appears to be broken as of KDE 4.5.

So no solution, but maybe the troubleshooting steps will be helpful elsewhere.

Heroku on Ubuntu 10.04 (Lucid)

February 10, 2012

I was setting up my laptop for development and production on Heroku. I followed the guide for ubuntu linux and ran the installer, but when I tried

heroku login

I got this error

/usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/restclient.rb:9:in `rescue in ': no such file to load -- net/https. Try running apt-get install libopenssl-ruby (LoadError)
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/restclient.rb:5:in `'
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/rest_client.rb:2:in `require'
from /usr/local/heroku/vendor/gems/rest-client-1.6.1/lib/rest_client.rb:2:in `'
from /usr/local/heroku/lib/heroku/client.rb:2:in `require'
from /usr/local/heroku/lib/heroku/client.rb:2:in `'
from /usr/local/heroku/lib/heroku.rb:3:in `require'
from /usr/local/heroku/lib/heroku.rb:3:in `'
from /usr/local/heroku/lib/heroku/cli.rb:1:in `require'
from /usr/local/heroku/lib/heroku/cli.rb:1:in `'
from /usr/bin/heroku:29:in `require'
from /usr/bin/heroku:29:in `'

Installing libopenssl-ruby didn’t help. It turns out that the heroku binary depends on ruby 1.9.1. The default ruby on Lucid is 1.8. So I did

apt-get install libopenssl-ruby1.9.1

Running heroku login again got this error

/usr/local/heroku/lib/heroku/command/run.rb:1:in `require': no such file to load -- readline (LoadError)
from /usr/local/heroku/lib/heroku/command/run.rb:1:in `'
from /usr/local/heroku/lib/heroku/command.rb:14:in `require'
from /usr/local/heroku/lib/heroku/command.rb:14:in `block in load'
from /usr/local/heroku/lib/heroku/command.rb:13:in `each'
from /usr/local/heroku/lib/heroku/command.rb:13:in `load'
from /usr/local/heroku/lib/heroku/cli.rb:8:in `start'
from /usr/bin/heroku:30:in `'

I installed libreadline to resolve it.

apt-get install libreadline-ruby1.9.1

Now all the heroku getting started steps work.

Thanks to this post for giving me some insight.

Linux Kernel Debugging with kgdb

April 28, 2010

I’ve gone through a fair amount of pain the in the past couple of weeks while trying to debug in the linux kernel. To debug as you would with gdb you need to use kgdb. As of the linux kernel 2.6.26 kgdb is part of the kernel. The documentation is a little bit confusing as some of the components, kgdb8250 and kgdboe, don’t seem to be present. So the only option is serial debugging.

This was a bit of a problem as neither of my machines had a serial port. Well the desktop has the hardware on the motherboard, but no physical port actually connected to it. So the first step was to add a PCI-serial card. I linked the port to ttyS2 with the following line in /etc/serial.conf

/dev/ttyS2 uart 16550A port 0xe480 irq 16 baud_base 115200 spd_normal skip_test

Using a USB-Serial dongle allowed me to verify a connection with my laptop. Now I was ready to try making the kgdb connection. I verified that kgdb is enabled in the generic ubuntu kernel, then added a boot item in grub with the following options.

kgdbwait kgdboc=ttyS2,115200

I followed this process to connect but unfortunately at boot time ttyS2 is not linked properly.  So I changed the kernel options to


After booting the machine I had to manually enable kgdboc.

$ sudo -s

$ echo ttyS2,115200 > /sys/module/kgdboc/parameters/kgdboc

At this point the machine totally freezes waiting for the debugger to connect. So I started gdb as noted before and the connection was made. I issued continue on gdb and the desktop started responding again.  To break again I press Alt+SysRq g on the desktop.

Now that the connection is there I need debug symbols. To make sure I had symbols for the kernel I built my own kernel image.  The process for building on ubuntu is found here with special information for karmic here.  I ended up making a new sub-flavour as described here. Once the kernel was installed and booting I turned to getting symbols for my kernel module.  I compiled my module with CONFIG_DEBUG_INFO=y to ensure it contained the symbols. Then I had to make gdb load the symbols. That process is detailed on pages 100-101 of Linux Device Drivers chapter 4(PDF).  It’s also available here.

Now I could set a breakpoint in my module and step through it.  However when it came to setting a breakpoint in the kernel code I also got this error:

Cannot insert breakpoint 5.
Error accessing memory address 0xffffffff813a40fb: Unknown error 18446744073709551615.

I disabled CONFIG_DEBUG_RODATA in my kernel compile and was able to set breakpoints. I’m not certain that this was the fix as there were some other changes in the process I was using to debug at the same time as this change. But it’s worth a try if you’re getting this error.


April 17, 2009

Useful for restricted codecs.


Ubuntu on Compaq Presario V2000

October 21, 2008

A few months ago I installed Ubuntu (8.04 Hardy Heron) on my Compaq Presario V2000 laptop. The install went pretty well, except that wifi didn’t work.  It turned out that my laptop had a Broadcom BCM4318 wifi card which has a proprietary driver. So it required some extra steps to get going.  I scanned the internet for a bit and found that it ended up being pretty simple.  Note that I had ethernet connected so I would have access to the internet.

apt-get install b43-fwcutter

After installing I gave it a reboot (probably not strictly necessary but Windows has conditioned me this way) and my wifi LED lit up!  A bit of setup to connect to my router and I was back on wireless!

Unfortunately I didn’t have enough time to get everything set up that my wife would need (mostly an iTunes replacement and streaming video in firefox) so I ended up putting WInXP back on.  I didn’t see enough of a performance improvement to justify the time it would take.  Maybe later though… If so I will put a more full install guide on here.