29a.ch

Entries tagged “ubuntu”

rvm on ubuntu 11.10

When trying to install ruby 1.9.2 using rvm I got a nasty suprise:

ossl_ssl.c:110:1: error: ‘SSLv2_method’ undeclared here (not in a function)
ossl_ssl.c:111:1: error: ‘SSLv2_server_method’ undeclared here (not in a function)
ossl_ssl.c:112:1: error: ‘SSLv2_client_method’ undeclared here (not in a function)
make[1]: *** [ossl_ssl.o] Error 1
make[1]: Leaving directory `/var/cache/ruby-rvm/src/ruby-1.9.2-p180/ext/openssl'
make: *** [mkmain.sh] Error 1

The solution

sudo apt-get install ruby-rvm
# make sure we have $rvm_path
source /etc/profile
# don't use ubuntus openssl
rvm package install openssl
rvm install 1.9.2 --with-openssl-dir=$rvm_path/usr

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.

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.

Getting audio to work on a HP Pavilion dv5 / Ubuntu 9.10

It looks like the problem is still there in Ubuntu 9.10, and it looks like the old fix still works. But it looks gorgeous.

How to disable pulseaudio on ubuntu 9.04

PLEASE DO NOT FOLLOW THE INSTRUCTIONS IN THIS POST UNLESS YOU KNOW WHAT YOU ARE DOING.

Pulse audio seems to be a constant source of trouble for me while providing no benefits at all (at least not any noticeable ones). So here's how to get rid of it:

Open /etc/X11/Xsession.d/70pulseaudio in a text editor and comment out everything (put a # in front of every line) and then save it.

This will prevent pulse audio from being started when you log in.

Getting audio to work on a HP Pavilion dv5 / Ubuntu 9.04

I bought myself a new HP Pavilion dv5 notebook because my old Lenovo broke. It's a bit too shiny for my taste but anyway. Installing the new Ubuntu was a breeze. After installing I noticed that audio playback using the speakers didn't work. Too bad. So here's the solution that worked for me.

Open /etc/modprobe.d/alsa-base.conf and add the following lines at the end of the file:

alias snd-card-0 snd-hda-intel
alias sound-slot-0 snd-hda-intel
options snd-hda-intel model=dell-m4-1
options snd-hda-intel enable_msi=1

Reboot and everything should work again (or just reload the snd-hda-intel with the new parameters).

I hope that helps,
Jonas

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)