Category Archives: ubuntu

How To: Download Any Flash Video with flashrip in Ubuntu

Downloading flash videos in Linux was already not too difficult, but thanks to flashrip, it has gotten very easy. Here is a little demo how it works:



Once installed, you basically use one click to get a video preview and then a prompt with the filename to save the file. The script works by looking into the newest flash files in your /tmp folder, and creates a hardlink to the save destination. When the video has fully loaded, you can close the browser window. The temp file will get deleted, and the linked copy will remain.

Installing flashrip

Open a terminal like gnome-terminal or konsole, and run these commands:

wget http://martin.ankerl.com/wp-content/uploads/2009/11/flashrip.sh
chmod 755 flashrip.sh
sudo mv flashrip.sh /usr/local/bin

Now all thats left to do is to create a link in your gnome panel for ease of use: Right click the gnome panel, “Add to panel…”, choose “Custom Application Launcher…”. Choose a proper name, and a command like this:

/usr/local/bin/flashrip.sh /home/manker/Videos

For the command, replace the second parameter with the default location where you want to save the ripped videos (you have to use the full path here!)

I have tested this in Ubuntu, but it should work on any linux where gnome is installed.

Have fun!

Beautiful Font Hinting in Ubuntu 8.10 and 9.04

Even though I have an LCD monitor, I always have the subpixel hinting switched off because it is just painfully ugly to my eyes. Even when hinting is switched to maximum, the fonts are quite blurry (if you don’t believe me, type xmag and take a screenshot of your font. You can see red and blue linese everywhere). My eyes hurt when I see this.

Thanks to Johan Kivinemi I have just found out how to bring back the excellent legacy subpixel hinting engine. This has a much more crisp hinting, and uses subpixels only where it really is an improvement:

Just open these files in your home directory, and copy the content into them:

~/.fonts.conf

[sourcecode lang="xml"]





true


true


hintfull


lcdlegacy


rgb



[/sourcecode]

~/.Xresources

[sourcecode lang="xml"]
Xft.antialias: true
Xft.hinting: true
Xft.hintstyle: hintfull
Xft.lcdfilter: lcdlegacy
Xft.rgba: rgb
[/sourcecode]

This should work in Ubuntu 8.04, 8.10, and 9.04 too, and makes all fonts much more crisp. Of course, your mileage may vary.

UPDATE: Comparison Screenshots

As promised on reddit, I got back from an awesome snowboard trip so I am able to put up extensive comparison screenshots of the two subpixel hinting engines. Move your mouse over the following images to see the differences. Watch especially out for letters like “m” where the spacing between the lines is very small. You might have to wait a bit for the image to load.

I have used all of the most important fonts that I usually use, and just for fun I have added “Dijkstra”, which just looks cool.

Sans Fonts

Mouse to see the same fonts with the legacy hinter.

 

Mono Fonts

Mouse to see the same fonts with the legacy hinter.

 

Zoomed Comparison Screenhots

Here is an excerpt with 400% magnifications. Mouse over the pictures to see the legacy hinter.

Zoomed Sans

 

Zoomed Mono

 

Top 10 Posts of 2008

Everybody loves top 10 lists. It is amazing how much traffic they can generate with the least bit of effort. So, without further ado, here is the list of the top 10 articles on this blog for 2008.

10. Top 10 Eclipse Hotkeys

Ironically, this list starts with another top 10 list, namely Top 10 Eclipse Hotkeys. This article from 2006 has just made it onto this top list. With 3,302 pageviews it seems that these keys are still relevant.
9. Human Compact Themes for Ubuntu 8.10
Number 9 is a modification of the Ubuntu’s default theme that is optimized for small screens. With the recent rise of netbooks this becomes more and more wanted.
8. Logical Volume Manager Cheatsheet
sudo pvcreate /dev/sdg1
sudo vgcreate ext_vg /dev/sdg1
sudo lvcreate -L 450G -n ext ext_vg
sudo mkfs.ext3 -m 0 /dev/ext_vg/ext

A compact little cheat sheet that explains how to easily combine two harddisks into one large volume. I have used this to combine two 500GB disks into one large 1TB filesystem.

7. Comprehensive Linux Terminal Performance Comparison
In this highly controversial article I have compared how long several different terminals (xterm, gnome-terminal, etc.) take when displaying one large textfile. I still believe this is relevant, especially when compiling stuff and text flies by. You don’t want your terminal be the limiting factor for your compile speed! I would perform the test yourself, as this seems to be highly dependent on the graphics card driver.
6. Howto Create MANIFEST.MF Classpath from Ant
[sourcecode lang="xml"]

[/sourcecode]
This HOWTO describes a simple way to create the classpath in a MANIFEST.MF file automatically from the libraries available on the harddisk. I have been using this since 2005, and it has never failed me.
5. Human Compact Gnome Theme (for Ubuntu 8.04)
Another Compact theme has made it on the list, this time for 8.04. I have used this theme for quite a while, even on a large 1680×1050 monitor because it really saves a lot of screen space. For everybody still using Ubuntu 8.04, this is the best choice to use a compact layout while still having the default Human look.
4. Optimized pow() approximation for Java, C / C++, and C#
[sourcecode lang="java"]
public static double pow(final double a, final double b) {
final int x = (int) (Double.doubleToLongBits(a) >> 32);
final int y = (int) (b * (x – 1072632447) + 1072632447);
return Double.longBitsToDouble(((long) y) << 32);
}
[/sourcecode]
Through some funny floating point representation tricks it is possible to create an approximative calculation of the pow() operator, that is a hell of a lot faster than the standard calculation which has to be extremely precise. This might be useful for games, Artificial Intelligence applications, and everywhere else where performance is an issue and not precision.
3. Ajax Dojo Comet Tutorial
One of the most often seen article contains 3 buzzwords at once: Ajax, Dojo, Comet. This page was linked several times, and it is getting quite a bit of attention. The article was written by an intern at my workplace and he allowed me to put it up here.
2. Clearlooks Compact Gnome Theme
Yet another theme! This startet it all. The Clearlooks Compact Theme was the first compact theme I have created. It is just a modification of the original Clearlooks theme, with tighter spacing. This has been linked quite a lot of time and I get a continuous stream of visitors who are in the need for a compact theme.
1. How to get Enough Sleep Despite StumbleUpon With Ubuntu
This post about me struggling with getting enough sleep despite StumbleUpon was by far the most viewed article on the blog, it has received more than 4 times as much visits as the second best. I guess I hit some nerve with it in the large Linux using StumbleUpon crowd. The article is almost a year old, and I still get lots of visitors each and every day. Happy stumbling!

Thank you everybody for coming to this site and posting your thoughts. I appreciate each and every feedback. Happy christmas and happy new year!

Human Compact Themes (for Ubuntu 8.10)

This is a new release of the compact theme, based on the original Ubuntu 8.10 (Intrepid) theme. It was created by Jan Suhr almost a month ago, based on my little howto.

I have now two versions of the theme: one with normal icon sizes, and one with the smaller 16×16 icons for even more compactness. Here is a comparison animation of the standard Human theme vs. the compact theme:



You can download the themes here:

Download and Installation

  1. Save the theme to your computer.
  2. Open the gnome’s appearence dialog with System > Preferences > Appearance.
  3. Drag and drop the downloaded file into the Theme tab of the appearance dialog. If you get an error message “Can’t move directory over directory”, you have already installed a theme with the same name. To be able to reinstall it, remove the directory ~/.themes/Human Compact or ~/.themes/Human Compact Small Icons.
  4. Choose “Apply new theme” in the popup dialog.

Most changes will occur immediately, but for e.g. the icon sizes it is best to log out and log in again. When you change the theme, you can get the Human Compact theme back by clicking on Customize, and then selecting Human Compact.

Any question, praise or flames? please post them!

Install for root (e.g. Synaptic)

Some readers asked how to get this to work for applications that run as root (e.g. synaptic), so here it is: simply copy the copy the theme file into the root’s home directory, like this (exchange username with your own name):

sudo cp /home/username/.themes/Human\ Compact/gtk-2.0/gtkrc /root/.gtkrc-2.0

Afterwards synaptic uses the human compact theme.

Older Themes

Here is some information about the original compact themes I have created: