Java + Fedora = esplode.

If you ever install Fedora 7, avoid their open implementation of the JDK at all costs. I’m not sure how or why, but for a week I was unable to run any java program from a jar file, or even from Eclipse. Even command line arguments using the standard java -jar foo.jar broke. Any jar files that I transferred over to windows failed with an Error: Unable to load main class attribute message. I finally got so frustrated that I blew away my current Fedora installation and started over.

Instead of installing java via the Fedora 7 package manager, do it manually by downloading the jdk from Sun’s website, stashing it somewhere safe–on my dev machine at work it lives at /home/jduv/dev/extools/jdk_1.5.0_12/ and use environment variables similar these inside my .bashrc:

# Set java home
export JAVA_HOME=/home/jduv/dev/extools/jdk1.5.0_12
 
# Tell path bout java home so I can use java stuff
export PATH=$PATH:$JAVA_HOME/bin

I haven’t quite figured out how to get java applets running in Firefox using my installation method, but methinks it won’t be terribly complicated. I’ll post it when I figure it out.

Oh, and if you use open office you will need to install that manually since it depends on java.  The Fedora package manager will install OpenJDK as a dependency for Open Office, thus screwing up all our hacking handiwork.  Just download all the vanilla rpm’s and follow the installation instructions on their site.

Comments

Fedora 7: The Bad

Fedora 7 is a very good Linux distribution. However, it is not without it’s faults. Last post I outlined the things that I liked about Fedora 7. This time, I’ll discuss the shortcomings of the distribution. Note that all of these are opinions and based on my own experience and user level. I am in no way an authority on this =D. Let’s get started shall we?

The Bad

XGL/Compiz/Beryl
I usually judge a distribution on how easy it is to set up Beryl and the cooresponding native drivers. Fedora actually isn’t too bad, but it’s not good enough to get a mark in the good column for this category. Since everything is handled through its package manager, theoretically I should simply be able to search for my NVidia drivers, install them, and then install all the Beryl packages. Unfortunately this did not work. I ended up with a white screen, even after adding beryl –use-copy to my Gnome session. So, in short, I’m sure I could get it to work, but it’s not as easy to set up as it was for me using Suse 10.2 for this particular Dell at work.

Sudoers Access Denied
Seems like Fedora took a page out of Madriva and Ubuntu’s book for this one. The default user that you create during installation is not granted sudo rights. This results in you having to edit the sudoers file in /etc/sudoers. This is a hassel if you are a pseudo power user because you have to find the file (thank google for that), and then decipher its cryptic syntax in order to be able to give yourself sudo rights. I simply created a group called sudoers, and edited the following line:

## Allows people in group wheel to run all commands
# %wheel  ALL=(ALL)  ALL
 
becomes
 
%sudoers All=(ALL) ALL

Package Manager Searches
You can forget using the search function on the package manager to look for any librarys you think you may need. It appears that the search is not very smart. You need to know the exact name of the library or software that you are looking for in order to find what you need. For example, say we are looking for a plugin for xmms that would enable mp3 playback. An obvious query that comes to mind would be: “xmms mp3.” Sadly it yields nothing.

Random Updates
It appears that Fedora will only check for updates after a reboot. I am unsure if they have a daemon running in the background to check for updates to packages, or if I simply don’t know how to configure it. I also have not found a way as of yet to run a manual update, and the update manager tends to be a little flakey.

Despite its annoyances, Fedora is quite impressive. It definitely deserves a high place on my favorite Linux distribution list; of which it currently holds third =).

Comments

Fedora 7: The Good

Been a while since I launched a Linux post. What better catalyst than the recent release of Fedora 7. Note the omission of ‘core.’ Since one of my companies proprietary tools had a domestic disagreement with how SuSE 10.2 handles USB devices, I was forced to replace my usual distribution with Fedora. Despite all the purple in the default theme, so far it has been a great experience. There are a couple of things that Fedora does right, and a couple of things it does wrong. Let us begin our two post discussion of Fedora with the good:

The Good

Installation
First on the list of good things is the installation procedure. It took me less than 20 minutes to install Fedora 7 from a DVD. That is very impressive. Additionally, all the installer screens are sleek, intuitive, and very well designed. Creating a custom harddrive partition schema was much faster than in any other distribution I have used so far.

Fonts
Fedora’s biggest big green check in my book is the way it renders fonts. Or maybe it’s just because SuSE 10.2 does this horribly. Fonts in Fedora are beautiful, crisp, and sub-pixel hinted straight out of the box. No screwing around with byte-code values or dpi settings. It just works.

Hardware Compatibility
Something should also be said about Fedora’s hardware compatibility. Hands down this has to be the most hardware friendly distribution of Linux on the market. It automatically detected my NVidia Quadro and configured the xorg perfectly.

Package Management
One thing that confuses lots of Linux newbies is how to get software on their machine. These days most Linux distributions have jumped on the package manager bandwagon–to the advantage of users everywhere, but users must still install package repositories because of legal issues with some software that cannot be shipped with any distribution (mp3 support is a good example). Fedora simplifies the repository setup process by having the Red-Hat Package Management (rpm) system do all the work for you. To install a new repository like LIVNA, simply go to the website and install the repository rpm. That’s it. No more configuration needed. New software can be browsed relatively easily via Fedora’s dependency resolving package manager.

So far I am quite happy with Fedora, but it is not without it’s annoyances and room for improvement. I’ll save that for next post =D.

Comments (3)

RAID is good.

I’m currently slammed with finals week stuff–my last finals week ever I must add–so I haven’t had a chance to write anything substantial as of late. I had a drive go out recently =(. Luckily–and luck seems to be the theme of the week, I had just reinstalled SuSE 10.2 and set up a RAID 1 mirror for all my data. W00t!

As a result of todays hardware mishaps, I just wrote a little script that copies some stuff from my home directory to a default directory or the directory of my choice. As a result, I figure it should be a great chance to educate some newbie Linux users in the ways of bash shell scripting. Consider:

#!/bin/sh
 
default_dir="/storage/array0/backups"
timestamp=`date +%m-%d-%Y_%H%M`
 
if(test -z "$1") then
    path=$default_dir
else
    # 2>dev/null; black magic supresses output from cd
    if cd $1 2>/dev/null; then
        path=$1
    else
        echo "Bad Directory"
        exit
    fi
fi
 
cd ~
tar cf dev.tar dev
bzip2 dev.tar
mv dev.tar.bz2 ${path}/${timestamp}_dev.tar.bz2
echo "Created backup: ${path}/${timestamp}_dev.tar.bz2"
 
cp "/etc/X11/xorg.conf" .
tar cf config.tar .Xresources .bashrc .emacs xorg.conf
bzip2 config.tar
mv config.tar.bz2 ${path}/${timestamp}_config.tar.bz2
rm xorg.conf
echo "Created backup: ${path}/${timestamp}_config.tar.bz2"

This script is very basic. It simply compresses and copies a single directory called dev and some customized config files from my home directory to another directory of my choice; or a default one given no arguments. It illustrates that you can use any command in a script that you can use in everyday terminal use. The first line of any interest is this one:

timestamp=`date +%m-%d-%Y_%H%M`

Notice the backwards ticks–the little guy on your tilde key; no no, upper left hand side of the keyboard. You need those around any command you wish to evaluate and stick inside a variable or echo. All we do here is call the date command with some format strings. This will result in a timestamp that goes little like: mm-dd-yyyy_hm. Primitive, yet satisfying. The next part is a little more confusing:

if(test -z "$1") then
    path=$default_dir
else
    # 2>dev/null; black magic supresses output from cd
    if cd $1 2>/dev/null; then
        path=$1
    else
        echo "Bad Directory"
        exit
    fi
fi

I’m going to assume that you are at least familiar with basic control structure like if…then…else. If you aren’t, then take a gander over here for a good basic tutorial. Anywho, the usage for our script allows us to pass in a directory that the backups will be copied to if we want too. Our first conditional if(test -z "$1") then will check to see if our script has a parameter passed into it. If not, then we simply assign the path variable to be our default path. If we do have a directory passed in, we need to make sure that it exists before copying anything there. Our nested conditional will handle that problem by trying to cd into the directory. If it fails, we print “Bad Directory” to the console and exit.

The rest of the script is pretty bland. It just tars and bzips a directory and some customized config files, moves them to our target directory, and renames them appending the timestamp we collected earlier to the front. It’s not a robust script, and not a substitute for real backups. Nevertheless, it is fun, educational, and quite useful. Feel free to modify it to your liking.

Comments

Mp3ize

I recently won a black 30GB video iPod for second place in Georgia Tech’s campus iMovie fest. It’s really sexy. I can understand now why all the Apple fanboys are drooling all over themselves. It has a slick interface, sounds much better than my little 512MB rio, and it works as removable storage.

After I got it I brought it to my office, unpacked it, and hooked it up to my system. Amarok and SuSE found it, initialized it, and it was automagically ready to transfer music/files/videos. No annoying restarts because of driver installs, or waiting on the OS to find my device. Were I on Windows I would have to go through the pain of downloading and installing[sic] iTunes, waiting for Windows to figure out that something new has been connected, wait for the driver installs, and then begin transfers.

Something most unfortunate for consumers is the restriction of file formats for certain branded mobile audo devices. I am not about to convert my entire 6000+ song archive from .wma to .aac. First off, aac is DRM, and second off, they all sound nearly the same.

Depressing? Fret not ye who ripped all your cd’s to wma. Linux to the rescue.

I wrote two small shell scripts that search a directory structure for wma’s and convert them to 250kbps VBR LAME encoded mp3. I won’t go into the details of CBR vs. VBR, but trust me when I say it’s better. Also, word is from Lorenzo the compression expert that conversion from high bit rate wmas to VBR mp3s should not result in too much signal degradation. W00t.

mp3ize

#!/bin/bash
 
# look for wma's and run convert on them
find . -name "*wma" -exec convert {} ;

convert

#!/bin/bash
 
set -e
old_name="$1"
cat_name=`basename "$1"`
path=`dirname "$1"`
nospaces=`echo $cat_name | sed -e 's/  */_/g' -e 's/_-_/-/g'`
new_name="${path}/${nospaces}"
 
#echo ---------
echo $old_name
#echo $path
#echo $cat_name
echo $new_name
 
if [ "${path}/${old_name}" != "$new_name" ];
then
   mv "$old_name" "$new_name"
fi
 
mplayer -ao pcm:file="${new_name%.wma}.wav" "$new_name"
lame -V 0 --vbr-new "${new_name%.wma}.wav" "${old_name%.wma}.mp3"
rm -f "${new_name%.wma}.wav"
 
mv "${new_name}" ~/.Trash/

Copy the source into two files named mp3ize and convert respectively, and toss them in your usr/bin/ directory. Then cd into the top directory where the files you wish to convert live, and type mp3ize. Watch for commas in path names because it will cause the script to skip those files or misname them. It will often cut off everything after the comma. This is a limitation of bash scripting, so we will have to live with it.

One thing that I would like everyone to note is my CPU usage graph:

System resource graph

Notice that it’s pretty much pegged at around 100%. As of right now I am typing this blog, running eclipse, seeding a DVD on bittorrent, and running around 9 other terminal tasks all while the mp3ize script is running. When’s the last time you could actually use your Windows system when CPU usage was near 100%? Never. Ever. It should also be noted that I do not have a dual core CPU.

Comments (2)

« Previous entries