Fight for the Internet 1!

Wednesday, April 15, 2009

KDE3.5 an official option for Kubuntu Jaunty

So the Kubuntu team, in their wisdom, is offering an official "remix" version of Ubuntu 9.04 Jaunty pre-setup to use KDE 3.5 instead of KDE4. This is pretty cool in my opinion. I know a lot of users, myself and many of my friends included, are still using KDE 3.5.

The official news posts about it is here: https://wiki.kubuntu.org/Kubuntu/Kde3/Jaunty

I like I have said before in my previous posts, I won't give KDE4 a serious try until their release of KDE4.3 scheduled for June sometime. Prior to this news, I was planning on installing Ubuntu and then throwing KDE3.5 on top. In the meanwhile, this Jaunty with KDE3.5 release saves me a bunch of work.

Saturday, April 11, 2009

Speed up Firefox with TmpFS

Introduction
This shows how to speed up Firefox by running it entirely from RAM to improve speed. Most of the credit for this article should go to here, from which I have taken most of this information, with the exception of improving his shell-script understandability.

Firefox uses SQLlite to store most of its information. As SQLite accesses are I/O bound, Firefox suffers when from disk drive bottleneck and competition for read/writes with other processes.

Create RAM partition

Add this entry in /etc/fstab:

firefox /home/xxxx/.mozilla/firefox/xxxxxxxx.default tmpfs size=128M,noauto,user,exec,uid=1000,gid=1000 0 0
Shell Script
#!/bin/bash

WORKING_LOCATION="/home/jondoe/Sata/Linux/presets/home-configs" # Directory where RAM_DIR and LOCAL_DIR exist
RAM_DIR="/home/
jondoe/Sata/Linux/presets/home-configs/firefox3_ram" # Location mounted TmpFS
LOCAL_DIR="/home/
jondoe/Sata/Linux/presets/home-configs/firefox3_local" # Harddrive folder for out-of-RAM storage

#cd "$WORKING_LOCATION" # Switch to location of working location -- unnecessary if using absolute paths

if [ -z "$(mount | grep -F ${RAM_DIR} )" ]; then # Check if firefox TmpFS already mounted
# Not mounted
mount firefox # Mount it now
fi

# The file '.unpacked_to_ram' is an indicator that we have synced into RAM
if [ ! -f "$RAM_DIR/.unpacked_to_ram" ]; then # Check if we have sync into RAM
echo "No file found indicating synced to RAM"
echo "Executing sync to RAM"
rsync -av --delete --exclude .unpacked_to_ram $LOCAL_DIR/* $RAM_DIR # Execute sync to RAM
echo "Creating note for synced to RAM"
touch "$RAM_DIR/.unpacked_to_ram" # Create note for synced into RAM
else # Already in RAM.
echo "Syncing Firefox3 TmpFS to local folder..."
rsync -av --delete $RAM_DIR/* $LOCAL_DIR # Sync back down to disk
fi

exit
Crontab
*/5 * * * * jondoe bash /home/jondoe/.tmpfs_firefox.sh >> /home//cronlog.txt 2>&1

Thursday, April 9, 2009

Funny Manpage for apt-get

My friend Jeff discovered this today. Thought I would share it.

Tuesday, April 7, 2009

LLVM-GCC vs GCC

So I have been reading up on the LLVM, and on integrating it with GCC. I care about a possible integration of the system because I want Linux programs to continue to be fast. The compiler is an important component in that speed. Furthermore, unlike Microsoft, the GCC project does not have direct communication with Intel Compiler designers, so it is important that GCC compiler be damn good.

From what I read online, it seems like some people like to decry the GCC project as being difficult to contribute to, and perhaps it is... or was. I don't personally believe this after reading experts from The Cathedral and the Bazaar. But I also do not have a lot of experience with the GCC project personally. If nothing else, the history of the GCC since the late 1990s has definitely been one of better community involvement.

Benchmark Data
There is a project called LLVM-GCC which is the combination of GCC and LLVM and I have been trying to collect information on performance between the two compilers. Here follows some of the things I have found.

To note at the beginning, the speed of the compilers is dramatically effected by the CPU architectures they are compiling on. So, an X86_64 architecture compared to Darwin/PPC could give wildly different results for the same code. Many of these tests don't even mention their architectures.

At Cliff Hacks, we see the GCC outperforming LLVM when maximum optimization is enabled (-O3). Unfortunately comparing GCC with -O0 and LLVM standard is fairly invalid, since -O0 effectively ties GCC's hands for speed.

At Laurovenancio, we see LLVM-GCC outperforming GCC by about 2-4%, but this is using GCC 4.1.x. I know from other research that there have been some serious speed improvements in 4.2 and 4.3, and I know that 4.4 is continuing these efforts with Stack management improvements. Because of these updates, I would not take these results as very reliable now.

Leonardo-m's blog is the most recent (2008-12-14) and best illustration of results I have found so far.



These results seem to indicate an overall small speed increase when using LLVM-GCC. The nbody section was a bug which has been reported and fixed already.

If nothing else, the GCC is still an amazing piece of work to be competing so well, even with all of "supposed shortcomings" that I see frequently mentioned in relation to LLVM.

One reason that LLVM has not been adopted into GCC officially is that there are license conflicts between the two projects. I don't really care to list them now, but basically the GCC want to keep things GPL'd and LLVM is more interested in a BSD style license. This is probably because of funding and influence from Apple, their sponsor. I don't fault either party for their intents.

A Final Thought
If LLVM-GCC should become a significantly better/faster/superior/prettier compiler over the GCC, I wonder if there will be a movement to adopt it as the official compiler for Linux distribution packages? I mean, would Debian or Ubuntu start to build their packages with LLVM-GCC if it was a superior compiler? Or would they stick with GCC? Does license matter more than speed? Does "the official Linux compiler" stamp from GCC matter more the perceived performance?

I just hope that if LLVM-GCC should become a "better" compiler that the Linux community, specifically the package maintainers, will consider it as a possibility.

Sunday, April 5, 2009

Quest for a Music Player

Abstract
My experiences personally and impressions while looking for a music player in Linux today.

Introduction
So I have used the music player program Audacious for years. I did this because before it, I used BMP, which is the successor to XMMS, which is a WinAmp Clone and I have used WinAmp ever since I started listening to music on my PC.

Why the search for something new? I have been stuck in Ubuntu Hardy for various reasons, and their version of Audacious has some bugs, because it seems to fail to load a bunch of files that are perfectly valid. Also, because of Hardy's libraries I cannot compile and use their latest version myself.

Another bigger reason is that, I have started to really listen to my entire music collection of a few thousand songs, and Audacious is not really a music manager, just a really good player. So my needs have grown beyond Audacious, though I still think it is a stellar program and the best WinAmp clone ever.

Today I looked around to find a music player that suited my needs. Namely, it needed to the following:
  • Support MP3, OGG, WAV, MPC (very very important), FLAC and WMA (yeah, I have a few, though the format is terrible).
  • Make use of the keyboard for control, preferably something like Audacious/WinAmp
  • Have a mini-mode. (A mode where the GUI is small and unobstrusive). This could be anything from a System Tray icon, to the mini-mode that Audacious/WinAmp do.
  • Support thousands of songs in a massive single playlist.
  • Additionally, it should be easy to use. (Believe me when I tell you this is not the case for most music players out there).
  • Normalization of audio.
JuK
Got me off to a pretty fast start. They were able to import my music quickly and start playing. However, when I reconfigured their shortcut keys, the program stopped working properly. Most of what I assigned did not seem to function properly and soon after the program crashed.

The program also lacked various extra features usually provided by plugins.

In the end, the playlist system seemed quite clunky and did not work very well for me. Doubtless there is a proper way to do it, but it was not apparent to me. The display is not very informative at points, so sometimes I did not know exactly what songs I had queued up. Perhaps it is my style of use, but again I found the keyboard interfering with controlling the system instead of helping it.

Amarok
Amarok and I have a history. Each time I have tried it, I did not like it, but I don't clearly remember why. This time around, after trying to use the program three times, I figured out the trick to the Playlists. Not exactly intuitive but still useable.

Their interface is pretty nice actually. Nice shortcuts. Good random playback system. Nice SystemTray icon.
  • File Information: Initially had some trouble using the interface to examine the filetype and bitrate information for my audio files. But figured it out at last.
  • Volumes Synchronization Problems: I cannot figure out how to make Amarok use KDE's volume. I end up having to control two volume systems and this is kind of annoying. I suspect there is a way to do this, because it would seem like a very important feature.
Amarok hung for a bit when I tried to seek forward/back while certain visualizations were enabled.

Aqualung
Simply failed to load. I'm pretty surprised actually. Normally these things don't happen.

Listen Music Player
Simply not enough control as well as customization for me. It looks like a nice little player but not enough for me.

Exaile
Tried it. I could not customize the keys, and I did not really like their default keys. The big deal was that I simply could not get it to play my music. I was unable to load anything into the play lists. I tried on three separate occasions over a few days. It cannot be done without knowing the black magics I guess. Too bad. Not a usable program.

Conclusion
I went with Amarok and I'm generally quite pleased. The program has a lot of things I wanted in Audacious and I'm organizing my music far more easily than before. There are two things I really want though:
  • Good normalization system: I downloaded and enabled ReplyGain (which was annoyingly not available through Get More Scripts option system within Amarok itself). ReplayGain works alright. There is no AAC/Musepack options in my Linux distro so that is a pity. I believe the plugin is going through and putting Replay Gain values onto my music files, which is cool, but if it is not, then I'm in trouble because a lot of my files don't have a gain value stored in them, certainly not some of my WMAs. (Again, yeah I know they suck).
  • Slim Player Window Like Audacious/XMMS: I really want a slightly slimmer player window for Amarok. Something like Audacious. Even after tweaking the window with KDE's configuration options, it is still rather large.
Update: There is a bug with Amarok 1.4.9. It will not skip forward or back nicely on certain file types, like FLAC or Musepack. This annoying and I hope this behavior has been fixed in Amarok 2.

Wednesday, April 1, 2009

Daemon Tools utility for Linux


Update: Alternatively I have found Furius ISO Mount, to also be a good program for mounting ISO and other CD image formats. Perhaps even better than Gmount. You can find it under the package name 'furiusisomount'.

Just a quick post here: For those of you that use the program Daemon Tools in Windows, you may have lamented the lack of such a program in Linux. (Even though the ability to mount something in Linux with the mount command has been around for longer than Windows itself).

Lament no longer! The program Gmount-ISO comes to the rescue! The package name in Ubuntu/Debian is simply gmountiso. Like Daemon Tools in Windows, Gmount-ISO provides a graphical user interface for mounting ISO files.


See this wiki page for more details.
http://swik.net/gmountiso

One important piece of information for non-Gnome users! You must have the program 'gksu' installed. This is a password authentication program for Gnome, similar to kdesu (used by KDE). You need this or Gmount-ISO won't work.

Though I have never tried it, another program worth looking into would be CDEmu, specifically the linux port of it, GCDEmu. It has more features that Gmount-ISO, but it is not in the repositories of Ubuntu/Debian.

Monday, March 30, 2009

Use Tor in Ubuntu Linux

This post deals with setting up Tor (with Privoxy) and the Tor related GUI TorK on your Linux system.

Frequently Asked Question: What is Tor?
Simply put, it is a program that helps to keep your activities over the Internet more anonymous. It's free to use and damn useful. For a more detailed definition, see here: https://www.torproject.org/faq#WhatIsTor.

Why Use Tor?
There are a lot of reasons. You can be more anonymous when doing things online. For example, when doing something that is.... tenuously legal... this is just another layer of protection. You can also claim your IP is in another country.

The Number #1 thing I use Tor for is whenever I have to do something with proxies. Using Proxies can be a colossal pain because you have to find a good free one, sometimes in a different country, and lets hope that proxy does not have bandwidth limits.

Tor just makes it so damn easy for me. I seriously never have to deal with finding useful Proxy IPs and then swap them in-and-out of my browser. I just let Tor handle all that for me and it is a like a dream.

There is a downside to using Tor: Since your connection's download/upload speeds depend on the Tor-Node you randomly connect to, it can be slow sometimes. (I say slow like only getting 45kbps down for example). But for the sake of anonymity, it is usually worth it and patience is a virtue they say.

Getting the Latest Version of Tor
You should try to have the latest version of Tor is possible.

For details on how to get the latest tor packages for Linux distribution (Debian or Ubuntu), go here:
http://wiki.noreply.org/noreply/TheOnionRouter/TorOnDebian

Install Tor and Privoxy
In a Debian/Ubuntu system, installing Tor is as easy as running the following from command line:

sudo apt-get install tor privoxy

Note, you will need to have the "Universe" apt-repositories enabled if you are running Ubuntu (I believe this is default now). If you get a message about packages not found for Tor, you probably need to enable it and run:

sudo apt-get update

Configuration Setup Tor and Privoxy after Installation
The default Tor configurations work generally well but you MUST enable the listening port for controller programs.

1. Edit the file /etc/tor/torrc with root permissions (using sudo or kdesu or gksu or as the root user). Find the lines for ControlPort. It will look something like this:

## The port on which Tor will listen for local connections from Tor
## controller applications, as documented in control-spec.txt.
#ControlPort 9051

You need to remove the '#' from the beginning of the ControlPort line. NOTE (important): This should not be confused with SocketPort line!

2. Edit the file /etc/privoxy/config with root permissions (using sudo or kdesu or gksu or as the root user). Add this line anywhere in the file:

forward-socks4a / localhost:9050 .


NOTE 1: The trailing space and period after the number must be included.
NOTE 2: These two port numbers must NOT be the same for both Privoxy and Tor

3. Restart the prixovy and tor services. You can do this on the command line with:

sudo invoke-rc.d tor restart
sudo invoke-rc.d privoxy restart

4. Setup TorK. See the section below.

Installing TorK

Tork is a GUI for using Tor+Privoxy. It is very useful. In a Debian/Ubuntu system, installing Tor kis as easy as running the following from command line:

sudo apt-get install tork

Run the program 'tork' from either command, or your applications menus. It should lead you through the rest of the setup. The interface is fairly straightforward and quite useful for running your applications anonymously.

Additional Information
See the Tor homepage: https://www.torproject.org/
The Onion Router: http://wiki.noreply.org/noreply/TheOnionRouter