29a.ch

Entries in the Category “GNU/Linux”

Review: Ubuntu Linux 11.10 on Thinkpad X1

logoI got myself a new toy - a Thinkpad X1. I wasn't really sure whether I should get the X1 or a Macbook Air. The main reason I decided to get the Thinkpad is because I prefer Linux for coding and I actually prefer the style of the hardware. It looks like a hackers tool and not like a shiny fashion accessory, but that's of course just my taste. It's also a lot more powerful in terms of CPU and connectivity (RJ45 jack, HDMI out, USB3, built in 3G modem). The downside is the display, the IPS displays Apple uses are just SO much better. But hey, I'm a developer not a designer.

This post describes the tweaks I did to make this notebook even better. They are also a documentation for myself. It targets advanced users.

TL;DR

Everything works out of the box, but a few tweaks make it way more awesome.

Thinkfan

The default fan settings are very aggressive and result in a lot of noise. I use thinkfan for manual fan control. This reduces the noise significantly.

#/etc/thinkfan.conf
sensor /sys/devices/platform/coretemp.0/temp1_input
sensor /sys/devices/platform/coretemp.0/temp2_input
sensor /sys/devices/platform/coretemp.0/temp3_input
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input

(0,	0,	60)
(1,	60,	70)
#(2,	76,	61)
#(3,	52,	63)
#(4,	56,	65)
#(5,	59,	66)
(7,	70,	32767)

Note that those are pretty extreme settings, use with caution and don't blame me.

Reducing power consumption

In order to improve battery life and to keep the device cool I tweaked some settings and disabled all unused devices in the bios. The changes save almost 10 watt!

#/etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i915.i915_enable_rc6=1"
# run update-grub after change
#/etc/rc.local
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
for i in /sys/bus/usb/devices/*/power/autosuspend; do echo 1 > $i; done
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy
echo min_power > /sys/class/scsi_host/host1/link_power_management_policy

Also you should consider using flashblock for firefox/chrome. Flash will drain your battery. If you don't believe it just look at the cpu wakeups it creates using powertop.

SSD TRIMing

I use an Intel SSD in the Notebook. The installation was a bit fiddly but the performance is just incredible. The thing boots in seconds. In order to get TRIM support I added discard to the partition options in /etc/fstab.

#/etc/fstab
UUID=b38561bd-9ca9-44a6-848d-ec90f31e1955 /               ext4    discard,errors=remount-ro 0       1

Wireless

802.11N seemed to create problems with my WLAN so I disabled it.

#/etc/modprobe.d/_wlan.conf 
options iwlagn 11n_disable=1

HDAPS

HDAPS offers you access to the accelerometer and advanced battery functions. It's simple to install:

sudo apt-get install tp-smapi-dkms
sudo modprobe -a tp_smapi hdaps
# get battery details
grep -r . /sys/devices/platform/smapi/BAT0/
# load on boot
echo "tp_smapi" >> /etc/modules
echo "hdaps" >> /etc/modules

Conclusion

With all those tweaks done the Thinkpad X1 becomes a durable, light, quiet and fast notebook with a lousy screen.

Controlling a usb rocket launcher with kinect

I got myself a kinect to play around with. I decided to hook it up to a usb rocket launcher that I had lying around. I did it with a little bit of python, libfreenect and pyrocket. And no comments about the video editing - that was WAY more difficult for me than the hack itself!

The source code is on github:
https://github.com/jwagner/kinect-experiments

Oh, and thanks to my little brother Nils for filming. ;)

Play it slowly 1.3.1

I was close to complaining that there was virtually nothing new in ubuntu 10.10. Well there was something new, it broke play it slowly. This should be fixed in 1.3.1. In addition to this I have fixed a bug that caused an exception when the mimetype of a file could not be detected.

I hope you like it. Feedback is appreciated!

screenshot

Get it Now

Play it slowly 1.3

After more than a year there is finally a new release of play it slowly. It does pretty much what you would expect, play back audio files at a different speed or pitch. Special thanks goes to Michael Donovan for helping me out with ideas and patches! I also created a debian package (what a pain).

New Features

  • Settings are now saved per file
  • There is a recent files button
  • There is a finetuner for changing the pitch in steps of 1 cent
  • The shortcuts for seeking were changed from 0 to ctrl+0 etc.
  • Moved sourcecode to github
  • Fixes all known bugs

I hope you like it. Feedback is appreciated!

screenshot

Get it Now

HTTP Ripper 1.1.0 released

logoI have finally made a new HTTP Ripper release. For those who don't know, HTTP Ripper is a tool that acts as http proxy to get (media) files out of websites. It is now translated into 42 languages. That's 40 languages more than I speak! The git repository has been moved over to over to github, play it slowly is now also there. Feel free to fork them.

HTTP Ripper Website

Generating SSL Cert for Apache

This is mostly just a note to myself, because I have to look it up every time I need to generate one, and the make-ssl-cert script that comes with debian doesn't appear to work.

openssl req -new -x509 -days 365 -nodes -out /tmp/cert.pem -keyout /tmp/cert.pem

Converting midi2wav using fluidsynth

Converting midi to wav using fluidsynth is not entirely trivial. Here is how I do it:

# convert opensolo.mid to fluidsynth.raw using the soundfont /usr/share/sounds/sf2/FluidR3_GM.sf2 
fluidsynth -l -i -a file -z 2048 /usr/share/sounds/sf2/FluidR3_GM.sf2 opensolo.mid
# convert fluidsynth.raw to fluidsynth.wav using sox
sox -b 16 -c 2 -s -r 44100 fluidsynth.raw fluidsynth.wav

You can use this together with the midi export of tuxguitar to export tuxguitar and guitarpro files to wav files.

m-audio Axiom 61 on Linux (Ubuntu 9.10)

I bought myself a M-Audio Axiom 61 to play around with. It works nicely on Linux, plug & play, literally. I tried it with the demo version of Pianoteq and Fluidsynth. Both worked perfectly on the first try. I'm happy so far.

Trick 37: Sniffing http traffic with tcpdump

Sniffing http traffic can be quite useful to find out what's going wrong on a webserver. Here is a simple way to do it using tcpdump:
tcpdump -X tcp port 80

Installing the nvidia opencl driver on ubuntu 9.10

Yesterday, I messed up my system by trying to install a NVIDIA beta driver in order to use opencl. Today I tried again with more success. Here is how I did it:

  1. Download the driver from the NVIDIA website
  2. Open the hardware driver manager of Ubuntu (Sytem/Administration/Hardware Drivers)
  3. Select the NVIDIA accelerated graphics driver (the active one) and click remove
  4. Log out
  5. Press CTRL+ALT+F1 to get to the console
  6. Login with your username and password
  7. sudo stop gdm
  8. chmod +x ./nvdrivers_*.run
  9. sudo ./nvdrivers_*.run
  10. sudo init 6
  11. Enjoy OpenCL goodness

A WORD OF WARNING don't try this unless you understand all the steps involved and know how to recover your system in case something goes wrong!

Stay tuned for some nice opencl experiment.

Author

Jonas Wagner Jonas Wagner
Software Engineer
Zürich, Switzerland

More about me

Follow 29a_ch on Twitter

Experiments

screenshot screenshot screenshot screenshot

More Experiments

Latest Posts Tags Archive Links

guitarmasterclass.net (guitar lessons)