Blog Image

MikeK's software notebook

What you will find

This used to be the place where I wrote stuff I was thinking about while working on the Mozilla project.

Maybe in the near future I'll start to update it again as I'm involved in a couple of new open-source projects - updates pending...

MacBook Pro freezing on Ubuntu Studio (64-bit) 9.04

Why did I reboot? Posted on 30 May, 2009 18:18:21

I partitioned the disk of my MacBook Pro into three parts (one for OS-X, one for Linux and one as swap space) since I gave up booting Ubuntu from a USB drive.

Got it kind of working, but had the choice of booting Ubuntu from the USB or WinXP from the internal drive – since I couldn’t have both and really wanted a “native” Ubuntu boot, I removed WinXP from the system (I can run WinXP from a virtual machine inside Ubuntu if I want to).

After the succesfull install I started to get a problem with seemingly randomly freezes of the Mac – bummer, it took me a day or two to figure out that it was because the machine was overheating. Yes, it was warm, but it has always been warm – guess it just got a little warmer 🙂

So how to fix it? I made a small app that monitors the temperature of the system and then increases the MinFanSpeed if it gets warmer – and decreses it again if it gets colder.

This is more safe than directly controlling the fan speed, as the worst that can happen if my program crashes is that the fan speed is set too high.

BatTemp Monitor
Temp ↑65.5°C MinFanSpeed 5200 LFanSpeed 5191(5200) RFanSpeed 5191(5200)

The output from the program above tells me that the current max temp that is meassured from any of the temp sensors inside the MacBook is 65.5°C and going up – the min fanspeed is set to 5200 RPM and the actuall speed of the left and right fan is 5191 RPM, and has a set target of 5200.

The program takes measurements every second and increases the fan speed if the temp is > 65.5°C and going up, and decreases the fan speed if the temperature is < 65.0°C and going down. A simple program and the best is that my machine haven’t had a freeze since I started to use the program 🙂

Changing colors of directory listings in Ubuntu Studio (bash)

Why did I reboot? Posted on 30 May, 2009 17:18:21

So I had the problem that directories that had read and write enabled for all users on the system came up in an hard-to-read color on my MacBook Pro

The colors were stored in an environment variable called LS_COLORS, to change it I added a new line at the bottom with the following content (I have underlined the ow entry that controlled this specific one):


So type export, and see if you have an LS_COLORS entry, if you do, you can change the ow=xxx to what you like (or any of the other entries).

The meaning of the numbers are:

Attribute codes:
00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
Text color codes:
30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
Background color codes:
40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white

(Copy pasted from the output of dircolors –print-database )

You can try the new setup by typing (without linebreaks):

export LS_COLORS=’no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=04:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.svgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:’;

at the command line, or make it permanent by copying it without the “export” to your ~/.bashrc file (I put it at the end).