May 10th, 2008 at 9:36am
My struggle for the perfect dual-monitor setup with my laptop and an external monitor finally came to an end.
I always wanted the following features to work:
- Big Desktop Setup (two Screens, laid out horizontally)
- Different Resolutions (I have a non-widescreen external monitor and a widescreen laptop screen, so i wanted
the Resolutions to be 1280×800(laptop) and 1280×1024 (external) in this case.
This is how i did it:
- Edit /etc/X11/xorg.conf
- Put the following lines in bold into your device section:
Section “Device”
Identifier “aticonfig-Device[0]”
Driver “fglrx”
Option “DesktopSetup” “horizontal”
Option “Mode2″ “1280×1024″
Option “PairModes” “1280×800+1280×1024″
Option “Capabilities” “0×00000800″
EndSection
Explanation:
- DesktopSetup “horizontal” means your Screens are laid out horizontally. Another Option would be “vertical” if your
Screens are on top of each other
- Option “Mode2″: This is the Resolution of the secondary Monitor (the external one in this case)
- Option “PairModes”: This line describes the valid Resolution pairs for both monitors
- Option “Capabilities”: Don’t know yet what this is, please tell me
If you insert the bold lines into your xorg.conf, you should get the desired Resolutions after restarting XOrg.
Unfortunately, this configuration has a small bug: The mouse cursor can be moved below the primary screen. Anyone know how 2 fix?
April 23rd, 2008 at 4:31pm
I was looking for a nice easy to use GUI for the Streamripper commandline program, which is used to record online radio streams to disk, e.g. if you want to listen to them in your car.
Each of them had something i didn’t like, so i stopped looking and started coding. Streamtastic is the result. It’s an easy to use GUI for Streamripper written in Java/Swing,
and it is thus cross-platform.
I put up a simple homepage for it, you can find it in the Menu to the right.
February 20th, 2008 at 6:34pm
If you (like me) have always wanted to automatically run your unit tests before commiting your work to git the following steps might be of interest to you.
Let’s assume we have a small python app we want to automatically test on git-commit.
For this purpose i use “nose“, a python extension which recursively discovers all unit tests in the current directory and runs them after issuing a quick “nosetests” in the desired directory.
Fine. But how do we run that command automatically when using git? The commit should of course be aborted if there are errors.
The first thing to do is to add some lines to the pre-commit hook in the .git directory. This hook is executed every time we do a git commit.
I added the following lines to the top of the script:
# Run test suite
nosetests
# Check its output
if [ "$?" = "0" ]; then
echo "Testsuite passed. Commiting..."
else
echo "Testsuite failed. Aborting commit"
exit 1
fi
And we’re almost done. If the “nosetests” command fails (which means that a test failed) we exit the pre-commit hook with exit code != 0. Git will then abort the commit. The only thing left to do is make the pre-commit hook script executable:
chmod +x .git/hooks/pre-commit
If you now try to commit some buggy code git should give the expected error message “Testsuite failed. Aborting commit” like we specified in our code.
February 14th, 2008 at 12:23pm
I just uploaded my “atNight” colorscheme for (g)vim. It’s dark and generally easy on the eyes.
atNight uses some Elements from the “moria-dark” colorscheme and from koehler.
Here are the obligatory screenshots: C-Source and Py-Source.
You can get the colorscheme from here.
If you have any suggestions or improvements, please let me know. Other than that: Have a lot of fun with it 
February 12th, 2008 at 12:43pm
Vim is my favorite editor. I grew so accustomed to it i nearly use it everywhere
The default installation, however, misses some settings which i set up in my .vimrc configuration file.
This is primarily meant as a starting point for developing your own configs.
Features
- Smart indent
- Syntax highlighting
- Dark colorscheme
- Default settings for tabs and whitespaces (expand to whitespaces, 1 tab = 4 whitespaces)
- Hide toolbar (not needed for power users, i think)
- Custom function for inclusion of text snippets from the ~/.vim directory (especially useful for gpl headers, etc.)
- Custom key mappings
- F2: Save & Build (call :make)
- F3: Next Error
- Shift-F3: Previous Error
- F12: Open Directory browser in the current file path
- Toggle Insert/Normal mode with CTRL-Enter (it’s faster for me)
Of course all these settings only reflect my personal taste and you are in fact encouraged to modify them.
Some other plugins i recommend (those can be found at vim.org)
- A.vim (Toggle .c / .h files easily)
- EnhancedCommentify (Comment / Uncomment lines in many programming languages)
- NERDtree (IDE-style sidebar treeview)
February 12th, 2008 at 11:02am
At the moment i am developing a small application for recording online radio streams in python / pygtk and gstreamer. It can browse the Shoutcast yellowpages service (a list of all available stations). For that purpose i developed a small wrapper, which i call python-shoutcastfeed.
I am aware that there already exists a python class for that, but it doesn’t seem to be maintained any longer and i couldn’t find a valid download link. It used to be available at http://www.excentral.org.
This version has two main features:
- Getting a list of all genres
- Getting a list of stations for a given genre (limiting the number of received stations to a user-defined value)
So, first you have to call get_genres() to get a list of the genres available on shoutcast. Then call get_stations_for_genre() to get a list of dicts for each station.
Further notes:
- This needs cElementTree. It should be integrated in Python starting from 2.5. Otherwise you might have to install it manually
- No caching: The class should dump the received stations to a file on-disk which can be re-used later. This saves time and bandwidth. The Cache’s TTL should be user-defined.
- Could use some more error checking. If it works “for me” it doesn’t mean it will always work.
Those features will probably be implemented in later versions, so stay tuned. In the meantime you can get the current version from HERE
Oh, yeah, and it’s GPL Software, so feel free to modify, change, improve it!