Sunday, 3 May 2009

Installing the FCEUX NES Emulator on Fedora 10

FCEUX is a Famicom/NES emulator that merges the different branches of the FCE Ultra project in to a single project. It is a great tool to have if you are a fan of classic NES games such as "Super Mario Brothers" and want to play them on your Linux machine. FCEUX has a host of features such as recording, Lua scritping etc. But as a casual gamer, you are probably only interested in getting the emulator up. For serious ROM hackers and advanced users, www.fceux.com is the place to start looking for additional info.

Installing FCEUX

FCEUX comes in two flavours. The Win32 edition and the SDL edition. We are only interested in the SDL version here. For Debian/Ubuntu users, a pre-packaged deb file already exists, but for the rest of us, it needs to be compiled from the source.

Step 1 : Install dependencies
sudo yum instal scons SDL SDL-devel zlib zlib-devel lua lua-devel zenity

Step 2 : Download and extract FCEUX
Download the source tar ball from http://fceux.com/web/htdocs/download.php and extract it.
wget http://downloads.sourceforge.net/fceultra/fceux-2.1.0a.src.tar.bz2
tar xvf fceux-2.1.0a.src.tar.bz2

This will create 2 folders names fceu and gfceux

Step 3 : Compile and install FCEUX command line tool
cd fceu
scons
sudo scons install


Step 4 : Install GFCEUX GUI
cd ../gfceux
sudo python setup.py


Step 5 : Run the emulator
gfceux

You will need to download NES ROMS to start playing. This part is left as an exercise to the reader ;)


Sunday, 26 April 2009

Useful Bash Tips

TuxRadar has a very useful list of Bash keyboard shortcuts at http://www.tuxradar.com/content/bash-tips-power-users. Scroll to the bottom to see the list.

Sunday, 1 March 2009

Convert videos for Sony Walkman

I own a Sony Walkman NWZ-S639F. It's a great mp3 player possibly much better than the ipod itself. Best of all it integrates well with Linux without needing any extra libraries or software. Rhythmbox can be used for syncing music files from my computer to the Walkman and Nautilus can be used to simply drag and drop pictures or videos.

When copying videos however, the Walkman is only capable of playing mp4 files of size 320x240. It also needs a jpg file of the same size and name as the mp4 file to display a nice thumbnail in the player interface. ffmpeg can be used to achieve all this very simply.

To convert a flv video downloaded from the internet to Walkman compatible video:
ffmpeg -i video.flv -s 320x240 -ac 2 video.mp4
To generate the thumbnail:
ffmpeg -i video.flv -s 320x240 -an -ss 00:01:00 -r 1 -vframes 1 video.jpg

All that is left now is to copy the generated mp4 file and the jpg file to the video folder in your Walkman.

Monday, 9 February 2009

Office 2007 On Linux

I recently managed to get Office 2007 working on Fedora 10 with Wine 1.1.14. I was helped along the way by this article at the excellent wine-reviews blog.

1. Download the latest Wine source tarball from http://www.winehq.org
2. Extract the source. tar xvf wine-1.1.14.tar.bz2
3. Run the installer. This may take a long time. On my Dual Core 1.8GHz laptop with 2GB of RAM, the compilation took about an hour. cd wine-1.1.14
./tools/wineinstall

4. Download winetricks. wget http://www.kegel.com/wine/winetricks
5. Install the MSXML parser, .NET Framework 2, GDI+, RichEdit controls and Visual C++ 2005 Runtime. sh winetricks msxml3 dotnet20 gdiplus riched20 riched30 vcrun2005sp1
6. Run the Office 2007 installer. wine setup.exe

Office 2007 should now be installed in your machine.




Sunday, 25 January 2009

Enable Guest USB Access on VirtualBox

Although I have been using Linux exclusively for a long time now, there are still occasions where some pesky applications demand a Windows environment. For those rare moments, I have Windows XP installed as a guest OS on VirtualBox. VirtualBox is an absolutely wonderful virtualization tool that provides almost every function I need from a Windows box.

Recently however, I had to plug in a USB device to the Guest OS and I found out that the USB device menu is grayed out, preventing me from switching the device over from the host to the guest. I tried messing with the settings but none seemed to have an effect. A quick search of the internet revealed this article which worked like a charm!

First create a new group and add yourself to it
sudo groupadd usb
sudo usermod -G usb `whoami`

Find out the gid of the new group by running the following command
MYGID=`cat /etc/group | grep usb | awk -F ":" '{print $3}'`
Create a new entry in fstab
sudo echo "none /sys/bus/usb/drivers usbfs devgid=$MYGID,devmode=664 0 0" >> /etc/fstab
Restart the computer
sudo reboot

Now when you start VirtualBox, the USB devices can be freely assigned to the guest OS.

Monday, 19 January 2009

Mobile Phone Management With Wammu

I recently needed to backup the contents of my Sony Ericsson K750i. Since the utilities provided with the phone only work on Windows, I had to hunt for a similar application for Linux.

Wammu is a GUI application that can be used to manage a vast number of mobile phones. It uses the Gammu utilities in the back-end and provides a nice GUI front-end to control every aspect of the mobile phone such as the Address book, Calendar, Task list, Call lists, Messages etc. A large number of mobile phones are supported by this tool, a comprehensive list can be found here. Phones can be connected either via USB, IrDA or Bluetooth.


The setup was straightforward.
sudo yum install wammu pybluez

The pybluez package is only required if you want to connect to the phone via bluetooth.

The GUI is quite easy to navigate through. Therefore I am not going to go in to specifics. A screenshot is more than enough to see how intuitive the interface is.

Thursday, 1 January 2009

Fixing Bluetooth and PackageKit problems in Fedora 10

I began to suspect that something was wrong with the D-BUS permissions on my Fedora 10 system when I started getting the following error at the end of a Yum session:
ERROR:dbus.proxies:Introspect error on :1.46:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.AccessDenied: A security policy in place prevents this sender from sending this message to this recipient, see message bus configuration file (rejected message had interface "org.freedesktop.DBus.Introspectable" member "Introspect" error name "(unset)" destination ":1.46")

This seemed to have affected the Bluetooth daemon as well. No matter how I tried, I could not get bluetooth-properties to remember my preferences. My computer was not visible to other Bluetooth enabled devices and I could not browse my phone via Bluetooth. (It used to work flawlessly in Fedora 9). I diagnosed that the problem is with D-Bus by running the following command:
sudo bluetoothd -n -d
bluetoothd always terminated with the error:
Unable to get on D-BUS

I tried mucking around with D-Bus policy settings in /etc/dbus-1/system.d/ but had no luck until I came across this helpful post at FedoraForums.

After editing /etc/dbus-1/system.conf as mentioned, I restarted the computer and voila ! Bluetooth started working and yum stopped complaining !!

For completeness, this is the interesting bit from my new /etc/dbus-1/system.conf
<!-- allow sending valid replies -->
<!-- commented out part
<allow send_requested_reply="true" send_type="method_return"/>
<allow send_requested_reply="true" send_type="error"/>
-->
<!-- Newly added line to fix permission problems -->
<allow send_requested_reply="true" />


Kudos to all the helpful people at Fedora Forums !