Jan 2010

Fri, 08 Jan 2010

Controlling the fan speed of a Lenovo X300 under Linux

The Lenovo X300 has a really annoying fan running with high speeds already at low (40C) CPU temperatures. The lm-sensors package comes with a fancontrol daemon which does user space fan regulation. Just put this in your /etc/fancontrol
INTERVAL=10
FCTEMPS=hwmon0/device/pwm1=hwmon0/device/temp1_input
FCFANS= hwmon0/device/pwm1=hwmon0/device/fan1_input
MINTEMP=hwmon0/device/pwm1=60
MAXTEMP=hwmon0/device/pwm1=70
MINSTART=hwmon0/device/pwm1=32
MINSTOP=hwmon0/device/pwm1=32
MINPWM=hwmon0/device/pwm1=32
MAXPWM=hwmon0/device/pwm1=128
This will give you 1800 rpm for CPU temperatures > 50C and 5500 rpm (the next level) for temperatures higher 70C. As the fan is barely noticeable at 1800 and 70C is only reached by running two processes with 100% CPU load for more then 5 minutes (even at 30C ambient temperature) this will give you a nearly totally silent laptop :-). A pwm value of 255 sounds like a jet starting (8000 rpm)...

posted at 12:14 | path: /unix | permanent link to this entry

How to back date a subversion checkin

While setting up a new subversion (svn) repository for my old blog entries, I wanted to keep the original dates (mtime of the file) in the checkin commit (for use with the pyblosxom svn plugin). After a quick online research I came up with the following script:
#!/bin/sh
# svn-ci-date.sh
# Jan Dittmer <jdi@l4x.org> 2008
# Use at your own risk
#

D=`ls -l "$1" | cut -f6-7 -d' ' | sed 's/ /T/'`
D="${D}:00.000000Z"
echo "Date: $D"
if ! svn add "$1"; then exit 1; fi
if ! svn ci -m "Date $D" "$1"; then exit 2; fi
R=`svn info "$1" | grep "^Revision: " | cut -f2 -d' '`
echo "Revision: $R"
if [ "$R" == "" ]; then exit 3; fi
if ! svn propset --revprop svn:date -r$R "$D"; then exit 4; fi
Please note, that subversion does not do any sanity checking on the svn:date property. If svn log reports a 'Bogus Date' afterwards, make sure your dates have the format 'YYYY-MM-DDThh:mm:ss.uuuuuuZ'.

posted at 12:14 | path: /unix | permanent link to this entry

MP3_Compare

Today I found some old forgotten pages about MP3 Compare and as a nice excercise to get used to this system I added them. You can find them under the articles section. Up to now I'm quite impressed with drupal.
MP3_Compare_Help

Help for MP3-Compare

Possible options on the 'Your MP3s' and 'Your friends MP3s' tabs:

[image:514]

You may enter a path, or select one with the browse button. The program searches for a file called 'mp3list.mcz' in the specified directory. On success this file is loaded, otherwise the specified directory is scanned. If 'Scan subdirs' is checked, it will scan recursively. If 'Add to list' is selected, the files found (file or scan) are added to the current list, so you're able to read a whole disc-set in one file.
The button 'FN2TAG' converts the filename(s) of the selected mp3(s) to tags, if they're after the scheme 'artist - title'!

Help for MP3-Compare

Possible options on the 'Your MP3s' and 'Your friends MP3s' tabs:

[image:514]

You may enter a path, or select one with the browse button. The program searches for a file called 'mp3list.mcz' in the specified directory. On success this file is loaded, otherwise the specified directory is scanned. If 'Scan subdirs' is checked, it will scan recursively. If 'Add to list' is selected, the files found (file or scan) are added to the current list, so you're able to read a whole disc-set in one file.
The button 'FN2TAG' converts the filename(s) of the selected mp3(s) to tags, if they're after the scheme 'artist - title'!
The button 'TAG2FN' does exactly the reverse thing, renaming the file to 'Artist - Title'.
Pressing 'Scan' will rescan the currently selected directory.
With 'Search' you can easily search for an mp3 in your mp3list. simply enter the search terms. mp3compare will do an 'AND' search.
With 'Load list' you can load a list of mp3s which will replace the current list, if 'Add to list' isn't checked.
With 'Save list as' you can save your list to another than the default name. You can also select 'HTML' as output format, and a html list of your mp3s will be created.
'Mail list' simply mails the list to a friend. Be sure to check the eMail - Setting on the config tab!
'Cancel' will cancel every running operation - Scanning / Comparing
'Play' plays the currently selected mp3 using Winamp, 'Enqueue' will enqueue it, and 'E and P' will add it to the current playlist and plays it afterwards.
'Exit' will exit the program - but who wants to?? ;-)

Possibilities in the context menu:

[image:517] 'Refresh Item': Refreshes currently selected items
'Remove Item after file operation': Will remove the selected items after successful move/copy/del
'Delete, Move, Copy': Does exactly the same as in the windows explorer
'Fileinfo/Edit Tag': Let you edit the ID3 tag for one or more (!!) files, see special section at the bottom of the page
'Normalize Tag': oNe tOtAly UNConvEntional WRITTEN tag -> One Totaly Unconvential Written Tag for Artist and Title 'Play','Enqueue','Enqueue and Play': The same as the tool buttons

Possible options on the result tab:

[image:515]

Just self explaining i think. Go will check for duplicates in either your or your friends MP3s. Load/Save loads a list of results, for example to send your friend a list, he could give you as a gift ;-)

Possibilities in the context menu:

[image:516] 'Remove pair from list': Simply removes a pair from the list, no physical harm is done!
'Remove pair after file operation': Will remove the selected pairs after successful move/copy/del
'Delete, Move, Copy': Does exactly the same as in the windows explorer for either the TOP files or the BOTTOM files
'Select all': Selects all files
'Play': Plays either TOP or BOTTOM file

Possible options on the config tab:

[image:520]

General
'Auto save mp3list after scan' will automatically save the list in the default file 'mp3list.mcz'
'Hitbarrier': Selects above which percentage two files are suspected to be the same (for compare/duplicates)
'Show complete path in results': Toggles path in results
'Path to winamp': Your winamp executable. Auto-Determined on first start-up
HTML-List Creation
'Relative path to CSS': Points to a Cascading Style Sheet for formatting the list.
'Insert links to files': MP3s will be linked so click in webbrowser opens it
'Relative path': ...
E-Mail Setting
For sending your list to a friend, common settings, self-explaining i think
Warn user before
Self-explaining, isn't it?

What you can do in the edit-tag box:

[image:518] [image:519]
Edit a single file
Simply edit the attributes of the file, ok writes them to disk.
Edit multiple files at a time
Edits the attributes of multiple files simultaneously. When the checkbox to the right is checked, the attributes will be written. So you can give all your files the same comment or equalize the artist names.

posted at 12:14 | path: /projects | permanent link to this entry

Some really small quadrocopters

It's always fascinating how far you can minaturize nowadays. A selection of really small quadrocopters (UAV, VTOL, Mikrocopter):

posted at 12:14 | path: /qc | permanent link to this entry

Linux_kernel_compile_tests

Since a while I'm doing cross compile tests for all supported linux archs. Check out the results here: http://l4x.org/k/.
So far it seems that about half of the in-tree archs are at least sometimes successfully build.

posted at 12:14 | path: /projects | permanent link to this entry

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.