6 Ubuntu Package Management tips for the Fedora User

After deciding that compiling Boxee for Fedora was quite a futile attempt, I installed Ubuntu 8.10 (Intrepid Ibex) on my desktop PC, just to run it.

One of the first things I needed to do was install the latest updates for it. Thats when I realised that I didn’t know nuts about software installation in Ubuntu, other than it was apt-get something.

After reading up the ubuntu docs, and a little googling around, I’ve compiled a list of common tasks I do with yum on Fedora and its Ubuntu equivalents.

  1. yum upgrade is apt-get upgrade

    This one is a little tricky. You should first run apt-get update to get the updated list of files in from the repository. Then follow up by the apt-get upgrade.

  2. yum search packagename is apt-cache search packagename

    The indispensable yum search is apt-cache search. Good to look through the repositories to determine which package you need to install. Just like yum, you could search for terms or keywords, apt-cache will give you the packages that have matching descriptions.

  3. yum info packagename is apt-cache show packagename

    Like yum info, this provides descriptions on the packages you want to install. An interesting addition comapred to Fedora is the Suggests: column, which gives you additional packages that you might want to install to enhance functionality of the program.

    Here’s a sample:-

    raja@atom:~/Examples$ apt-cache show mplayer
    Package: mplayer
    Priority: extra
    Section: multiverse/graphics
    Installed-Size: 10088
    Maintainer: Ubuntu MOTU Developers <ubuntu -motu@lists.ubuntu.com>
    Original-Maintainer: Ubuntu MOTU Media Team <motumedia @tauware.de>
    Architecture: i386
    Version: 2:1.0~rc2-0ubuntu17
    Replaces: mplayer-nogui
    Depends: libaa1 (>= 1.4p5), libartsc0 (>= 1.5.9), libasound2 (>> 1.0.17), libatk1.0-0 (>= 1.20.0), libaudio2, libaudiofile0 (>= 0.2.3-4), libc6 (>= 2.7), libcaca0 (>= 0.99.beta13b-1), libcairo2 (>= 1.2.4), libcdparanoia0, libcucul0 (>= 0.99.beta13b-1), libdbus-1-3 (>= 1.0.2), libdbus-glib-1-2 (>= 0.71), libdv4, libenca0 (>= 1.9), libesd-alsa0 (>= 0.2.35) | libesd0 (>= 0.2.35), libfaac0 (>= 1.26), libfontconfig1 (>= 2.4.0), libfreetype6 (>= 2.3.5), libfribidi0 (>= 0.10.9), libgcc1 (>= 1:4.1.1), libggi2 (>= 1:2.2.2), libgif4 (>= 4.1.6), libgl1-mesa-glx | libgl1, libglib2.0-0 (>= 2.12.0), libgtk2.0-0 (>= 2.14.1), libjack0 (>= 0.109.2), libjpeg62, liblircclient0, liblzo2-2, libmad0 (>= 0.15.1b-3), libmp3lame0 (>= 3.98), libmpcdec3, libncurses5 (>= 5.6+20071006-3), libogg0 (>= 1.0rc3), libopenal1 (>= 1:1.3.253), libpango1.0-0 (>= 1.21.6), libpng12-0 (>= 1.2.13-4), libpulse0 (>= 0.9.8), libsdl1.2debian (>= 1.2.10-1), libsmbclient (>= 3.0.24), libspeex1 (>= 1.2~beta3-1), libstdc++6 (>= 4.1.1), libsvga1, libtheora0 (>= 0.0.0.alpha7.dfsg-1.1), libvorbis0a (>= 1.1.2), libx11-6, libx264-59 (>= 1:0.svn20080408), libxext6, libxinerama1, libxt6, libxv1, libxvidcore4 (>= 1:1.0.0-0.0), libxvmc1, libxxf86dga1, libxxf86vm1, zlib1g (>= 1:1.1.4), ttf-bitstream-vera, mplayer-skins, ttf-dejavu
    Suggests: w32codecs, libdvdcss, mplayer-doc, ladspa-sdk
    Conflicts: mplayer-nogui
    Filename: pool/multiverse/m/mplayer/mplayer_1.0~rc2-0ubuntu17_i386.deb
    Size: 4425834
    MD5sum: c34e4650c294bf0277d37432bdd81bde
    SHA1: da382398f120a0ecb421ac160d4d5676c081b27a
    SHA256: edf9c491e09c9f215a57db60df2ba94d17561ea20d890d576f5202a760dd5ad0
    Description: The Ultimate Movie Player For Linux
     It plays most mpeg, avi and asf files, supported by many native and win32
     DLL codecs. You can watch VCD, DVD and even DivX movies too. The other
     big feature of mplayer is the wide range of supported output drivers. It
     works with X11, Xv, DGA, OpenGL, SVGAlib, fbdev, but you can use SDL (and
     this way all drivers of SDL) and some lowlevel card-specific drivers (for
     Matrox/3dfx/SiS) too! Most of them supports software or hardware scaling,
     so you can enjoy movies in fullscreen.
     .
     This version includes the Gtk GUI
    Bugs: mailto:ubuntu-users@lists.ubuntu.com
    Origin: Ubuntu
    </motumedia></ubuntu>
  4. yum deplist is apt-cache showpkg

    Provides similiar information, giving you an idea of the additional dependencies required to run the program.

  5. yum grouplist is tasksel –list-tasks

    Yum in Fedora has groups. So does Ubuntu. Finding it involved a little google-fu, but they work relatively the same. I sort of like the way tasksel lists its already installed / available packages. Seems more neat to me, eventhough new users may encounter a WTF??? moment looking at the the u & i prepended on the task names.

  6. yum groupinfo a combo of 2 separate tasksel commands

    yum groupinfo gives you a description of the task or group, as well as a list of packages that need to be installed To get similiar info from tasksel, run tasksel –task-desc lamp-server to get a brief description on the task. e.g.

    raja@atom:~/Examples$ tasksel --task-desc lamp-server
    Selects a ready-made Linux/Apache/MySQL/PHP server.

    To get a list of packages that task installs, run tasksel –task-packages taskname.

    raja@atom:~/Examples$ tasksel --task-packages lamp-server
    libwrap0
    apache2
    mysql-client-5.0
    tcpd
    libapache2-mod-php5
    apache2.2-common
    apache2-utils
    php5-common
    libaprutil1
    php5-mysql
    libmysqlclient15off
    libdbi-perl
    libplrpc-perl
    mysql-server
    openssl-blacklist
    libdbd-mysql-perl
    mysql-server-5.0
    libnet-daemon-perl
    libapr1
    libpq5
    ssl-cert
    apache2-mpm-prefork
    mysql-common

I guess that would be it for this post. I’ll post more if I find anything else that I may be missing.

Sources for my info:-

F*** my life via bash the pythonic way

Being a little bored today, I decided to surf around. Thanks to my friend Thaweesak, I got this site called F*** My Life.

A few hilarious stories and minutes later, I realised they had a web api. Thats when I got an epiphany!!! Why not get a random story from here to cheer me up on demand? And for a linux junkie, what better way than through a terminal?

Since I have been experimenting with python for awhile, what better way to practice a new language than something fun?

Here’s my script:-

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env python
# Ugly script to get a random quote from www.fmylife.com
# Yeah, so ugly I dont even bother catching exceptions
#
# Meant to run on python 2.5++ as I'm using the inbuilt ElementTree package
#
 
import urllib
import xml.etree.ElementTree as ET
import cStringIO
 
FML_SITE_RANDOM = 'http://api.betacie.com/view/random'
paramsDict = { 'language':'en', 'key':'readonly'}
encodedParams = urllib.urlencode(paramsDict)
 
try:
	fmldata = urllib.urlopen(FML_SITE_RANDOM, encodedParams).read()
	fmldata = ET.XML(fmldata)
	author = fmldata.findtext('items/item/author').strip()
	if len(author) == 0:
		author = 'anonymous'
 
	peopleAgreed = fmldata.findtext('items/item/agree').strip()
	peopleDisagreed = fmldata.findtext('items/item/deserved').strip()
	story = fmldata.findtext('items/item/text').strip()
 
	print "Think your life sucks?\n"
	print 'This happened to ' + author + '.'
	print ''
	print story + '\n'
	print peopleAgreed + ' reader(s) agreed'
	print peopleDisagreed + ' reader(s) have seen worse. '
	print
	print 'F*** My Life'
	print 'http://www.fmylife.com'
 
 
except:
	msg = '''Whoops!!! Some error, probably your connection. I guess
	your life sucks after all.... :('''
	print msg

Just chmod 755 it and place it in your ~/bin directory. Then just type in fml in your terminal for some random F*** ups.

Assuming you have Fedora 10 or Python 2.5++ installed, it should work perfectly.

Here’s a shot of it running:-

My F*** My Life script in action.

My F*** My Life script in action.

Sources I used to create this program:-

The wonders of Open Source Technology. w00t!!! :)

Create Multiple Firefox Profiles For Different Uses

Ever had a problem where your Firefox crashes during development because you were browsing multiple tabs in another window?

Or using the latest Firefox beta always messed up your current extensions / settings?

Use Profile Manager.

This keeps separate instances of firefox running, so one crash won’t affect the other windows.

To access the Profile Manager, first open Firefox as usual, then from the your os command prompt, launch the profile manager by typing the following command:-

firefox -profilemanager -no-remote

My FireFox Profile Manager

As you can see, I have created 3 profiles here, my default profile, a Development profile as well as another beta profile for me to test the latest firefox beta, Minefield (www.mozilla.org/projects/minefield/). I set the default profile as my default (duh!), for normal web browsing.

The ‘-no-remote’ option allows you to start a new Firefox process that is invisible to the first process.

The ‘-P’ option allows you to specify which profile to start. Look at your profile manager for the names in case you forgot ;)

I then created some scripts in my ~/bin directory to launch the Development & Beta profiles seperately.

Here’s a sample script, note that I piped all of ‘em ugly error messages to /dev/null and made sure the process ran in the background. This frees up your terminal for more important things.

1
2
3
#!/bin/bash
echo "Starting devfox ;)"
/usr/bin/firefox -P "Development" -no-remote > /dev/null 2>&1 &

Another tip, getting confused with which profile(s) you have open? Use Themes to differentiate them ;)

For more information, read on the following links:-

Opening Firefox With Another Profile
Firefox Profile Manager

Other uses for this include, your own ‘incognito’ mode for firefox, ala Chrome.

Hope you find this helpful ;)

Some Mplayer Tips

Basically a reminder for me as well as a reference for others. ;)

  • Audio Volume

    Sometimes the default volume in videos are pretty low, even after you turn up the speakers. This is where the audio filter option of mplayer comes in handy. By default, the value is 10:0, and by using the -af switch, you can increase it. e.g.

    mplayer some-video.avi -af volume=20:0

    This amplifies the default volume to double what it currently is. Experiment with the settings, you might find it handy.

  • Subtitle Font Size

    For some insane reason, the default font size for subtitles in mplayer are like the gargantuan contraptions used by the aliens that invaded earth in War of the Worlds. Usually occupying at least a fourth of your viewable screen, they make your viewing experience well, less pleasurable.

    Fix this by adding the following switch to your commandline:-

    mplayer -subfont-text-scale 2 video.avi

    where the number refers to the percentage of scren size used render the subtitles. I find 2 a pretty good value, as it achieves a fine balance between readability and screen estate usage.

Remember, as with other command line programs in Linux, you can chain these options, so all together, it would look like this:-

mplayer -af volume=20:0 -subfont-text-scale 2 video.avi

Happy viewing!!! :)

How to convert .cue / bin file to .isos in Fedora Linux

For those of you who need to, here’s how to convert those .bin/.cue files to .isos in Fedora Linux.

First install bchunk from yum:-


yum install bchunk

Then, in the directory with your .bin/.cue files, run the bchunk program like this:-


bchunk -v name_of_bin_file.bin name_of_cue_file.cue new_iso_name

For example:-


[raja@atreides ]$ bchunk -v name_of_bin_file.bin name_of_cue_file.cue new_iso_name
binchunker for Unix, version 1.2.0 by Heikki Hannikainen
Created with the kind help of Bob Marietta ,
partly based on his Pascal (Delphi) implementation.
Support for MODE2/2352 ISO tracks thanks to input from
Godmar Back , Colas Nahaboo
and Matthew Green .
Released under the GNU GPL, version 2 or later (at your option).

Reading the CUE file:

Track 1: MODE1/2352 01 00:00:00 (startsect 0 ofs 0)

Writing tracks:

1: new_iso_name.iso
mmc sectors 0->117357 (117358)
mmc bytes 0->276023664 (276023665)
sector data at 16, 2048 bytes per sector
real data 240349184 bytes
229/229 MB [********************] 100 %
[raja@atreides ]$

There you go, a new .iso file named new_iso_name.iso should be created. ;)

Monsters Vs Aliens

Here’s a movie I’ll be waiting for. Looks Extremely hilarious.

For those of you having trouble getting the 1080p hi def trailer, I’ve downloaded it for you, available on rapidshare. Here it is ;) :-

http://rapidshare.com/files/193910331/monstersvsaliens-tlr2_h1080p.mov

The Super Bowl Porn Glitch

Yeah, some people can’t blame the recession for losing their jobs. Imagine this in Malaysia during a Liverpool vs Manchster United match, heads will roll ;)

SuperBowl Porn Glitch

The Romantics – Talking in You Sleep

Well, I haven’t blogged in a long while, so I thought I’d just add something random. This damn son is playing in my head since I accidentally heard it again on radio.

So what better thing to do than spread it among my friends and get them hooked to this as well? ;)

Just for the heck of it, lets give you guys the lyrics as well:-

When you close your eyes
And go to sleep
And it’s down to the sound
Of a heartbeat
I can hear the things
That you’re dreamin’ about
When you open up your heart
And the truth comes out

You tell me that you want me
You tell me that you need me
You tell me that you love me
And I know that I’m right
‘Cause I hear it in the night

I hear the secrets that you keep
When you’re talking in your sleep
I hear the secrets that you keep
When you’re talking in your sleep

When I hold you in my arms at night
Don’t you know you’re sleeping in the spotlight
And all your dreams that you keep inside
You’re telling me the secrets
That you just can’t hide

You tell me that you want me
You tell me that you need me
You tell me that you love me
And I know that I’m right
‘Cause I hear it in the night

I hear the secrets that you keep
When you’re talking in your sleep
I hear the secrets that you keep
When you’re talking in your sleep
I hear the secrets that you keep
When you’re talking in your sleep
I hear the secrets that you keep
When you’re talking in your sleep

Aww come on.. hooked already, well me being all nice and stuff, here is the song as well.
Download

Creating Partitions with GNU Parted

Hi, this is my second screencast. This time I talk about parted, an alternative to fdisk.

There is audio skipping towards the end of the screencast, which I discovered only after uploading this video to youtube. :(

I’ll add a link to the full video on rapidshare once I have posted this on Danny’s site.

The Perfect Song

One of the most catchy songs I’ve heard recently, A Perfect Lie (Gabriel & Dresden Remix) by The Engine Room deserves a very special mention. My friends and I have nicknamed it ‘The Perfect Song’ in reference to its lyrics. Heck, I even blogged about the soundtrack in an earlier post.

Well, this song being too catchy n all, I decided to make it a ringtone. I have linked to the original version here, so you guys can edit it to your hearts content ;)