Linux Blog

Red5 On Fedora 11 Howto

Filed under: General Linux — TheLinuxBlog.com at 9:05 am on Tuesday, September 22, 2009

This is how I quickly set up the Red5 streaming server for testing and evaluation. It worked on Fedora 11 and older Fedoras, and it might work on other distributions, or it may not. Here’s how I did it.

Downloaded the latest Java JDK:

(Read on …)

Fedora 9 Thunderbird Update Fix

Filed under: Linux Software — TheLinuxBlog.com at 12:01 am on Wednesday, January 14, 2009

Fedora 9 Thunderbird
While updating a Fedora 9 installation I ran across an error. The error was with the Mozilla Thunderbird package that I use on a regular basis.
The error looked like this:

 Running Transaction
Updating       : thunderbird                                                                                                                                                  1/2
Error unpacking rpm package thunderbird-2.0.0.19-1.fc9.i386
error: unpacking of archive failed on file /usr/lib/thunderbird-2.0.0.19/dictionaries: cpio: rename

Obviously any fix that I implemented couldn’t loose my mail. The problem was with the dictionaries more specifically the /usr/lib/thunderbird-2.0.0.19/dictionaries file. The error is not very specific but lets us know its having trouble unpacking the archive and ends with cpio: rename. So here is what I did to solve the problem:

 cd /usr/lib/thunderbird-2.0.0.19/
sudo mv dictionaries dictionaries-old

Thunderbird data is stored in ~/.thunderbird it is advisable you make a backup of your mail if it is that important to you. I didn’t since this directory is a library directory and all of my mail can be downloaded again with imap. If you use pop you may want to consider doing a backup. After doing this it fixed Thunderbird and I’m all up to date. Horray!

Let me know if it worked for you and I’ll let you all know if there are any problems.

shell script argument lists too long

Filed under: Shell Script Sundays — TheLinuxBlog.com at 11:19 am on Sunday, September 21, 2008

Sometimes you will run into the problem of having too many files in a folder. This results in basic programs like rm and mv to not be able to process your commands. For example, I recently had to extract 52628 jpgs from seven zip files. Once extracted I realized that I had them in the wrong folder. Now, there are other ways I could have accomplished the same goals, such but for various reasons sometimes the easiest way (renaming the folder) was not feasible. Here is the solution: (Read on …)

RSS Feeds

Filed under: Shell Script Sundays — Kaleb at 11:43 am on Sunday, April 20, 2008

The other day I was playing around with AwesomeWM and I wanted to have the newest article from digg.com/linux_unix to be displayed in the statusbar. I thought to myself:

“I roughly know how RSS works, so I should be able to do this.”

It turns out it was extremely easy to do.

First how does RSS work. It’s easy just an xml file that gets downloaded with a list of the articles on the site. Well that’s pretty simple so I wrote a little script that will do all the things I need.

First I needed to download the list

wget -c http://digg.com/rss/indexlinux_unix.xml

done with that. Now for what I wanted and to make it a little cleaner i moved this file:

mv indexlinux_unix.xml ~/.news

this way it was in a file that i can easily access.

After that it was just some simple editing of the file using sed. If you don’t know much about sed I suggest you read up on it. It is an extremely powerful tool for quick editing and scripting. For the editing of
the file it was actually quite simple:

cat ~/.news | grep “<title>” | sed -e ‘s/<[/]title>//’ | sed -e ‘s/<title>//’ | sed -e ’2,2 !d’

now no worries I will explain this its actually quite simple.

I will assume you know what cat ~/.news does but if you don’t, it outputs the contents of the file until the end of the file.

| grep “<title>” is a very important part of the command. As I looked at the xml file i realized that i would get a simple list of all the articles if I greped the title. However thats not all.

It was a very messy output with <title> at the beginning and </title> at the end. Nobody wants to look at that, what I wanted was the text in between. | sed -e ‘s/<[/]title>//’ will get rid of the </title> in the line. I am almost certain that | sed -e ‘s/<\/title>//’ would have done that same thing but you can test that if you want. It needs to be done like this because “/” is a special character so it needs to be escaped.

The next part | sed -e ‘s/<title>//’ should be self explanatory. Basically it just gets rid of the <title> in the line. So now using the first 3 pipes you will get a nice pretty list of all the articles.

This is not what we wanted though. We wanted the newest article. so that’s why we use | sed -e ’2,2 !d’. This command will cut out everything except the second line in the list. “Hmm but why the second line Kaleb?”
well because while creating this script I found that the first <title> line was the line that told me where I was getting this information from. So it was http://digg.com/linux_unix now I don’t want that. so I went with the second line for the first article. Easy right.

Now as I mentioned at the begining of this article, I wanted to make this give me a clickable link for the awesome statusbar. I will go over awesome piping later this week but basically the only information you will need. Is to go threw your xml file for your RSS feed and find out between what tags the link for your article is and use the above command to show you that link instead of the title then have Firefox open that
link (or whatever browser you use). It was a very simple thing to do.

Kaleb Porter

porterboy55@yahoo.com

http://kpstuff.servebeer.com (website currently down)

Slackware 12 – MPlayer Setup in 3 Easy Steps

Filed under: General Linux — TheLinuxBlog.com at 9:46 am on Thursday, September 6, 2007

I made a quick installer script that will install MPlayer 1.0rc1 with the essential codecs pack and the Firefox plugin on a new installation of Slackware 12. With this script you should be able to get MPlayer set up on Slackware 12 in 3 easy steps.

1. Download The MPlayer Installer that I made (Right click Save Link As).
2. Change to root user and run the MPlayer Installer OR run the MPlayer Installer with sudo as followed:

bash-3.1$ su root
Password:
bash-3.1# sh mplayer_setup.sh

OR

sudo sh mplayer_setup.sh

3. If everything installed smoothly you can remove the mplayer directory and all files inside it. If it failed then all you need to do is (as root) removepkg on all of the .tgz files and do a rm /usr/lib/codecs/*.

Firefox should be restarted after the script has run. Test Firefox by going to various media sites, one I like to use is Apple Trailers (Because of the quality and speed). If you could contact me and let me know if the installer worked or failed I would appreciate it.

Line by line breakdown of the installer:

mkdir mplayer; cd mplayer;

Creates the mplayer directory and moves into it.

wget http://www2.linuxpackages.net/packages/Slackware-12.0/X11/MPlayer/mplayer-1.0rc1-i486-1goa.tgz; installpkg mplayer-1.0rc1-i486-1goa.tgz

Gets the mplayer-1.0rc1-i486 package from linuxpackages.net then installs the package

wget http://www2.linuxpackages.net/packages/Slackware-12.0/Library/mplayerplug-in/mplayerplug-in-3.45-i686-1amg.tgz; installpkg mplayerplug-in-3.45-i686-1amg.tgz

Gets the mplayer plug-in for Firefox and installs it

wget http://www4.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2

Downloads the essential codecs pack from mplayerhq.hu

tar xvjf essential-20061022.tar.bz2; mv essential-20061022/* /usr/lib/codecs; rm -rf essential-20061022

extracts the essential codecs package to one of the directories MPlayer looks for codecs in and removes the directory.