Posts Tagged ‘ubuntu’
Space combat simulation games may not be in vogue much any more, which is a shame, but that hasn’t stopped people creating new games based on the (now) open source FreeSpace 2 engine. One of these is Diaspora: Shattered Armistice, a space combat game based on the reimagined Battlestar Galactica universe.
If you’ve a hankering to pilot a Viper in massive space confrontations with Cylons, this is the game for you. It’s available on Windows, Mac and Linux although the team has admitted that they have neither the time or experience to create a native Linux installer. So we’re going to set up Diaspora to install under Ubuntu with the latest patch and package the whole thing up as a deb file for future ease of installation and hopefully learn a bit along the way about creating deb file packages with dependencies for pre-existing programs.
I’m using a Ubuntu 12.04 LTS x64 system for this and so an Ubuntu 64-bit deb file is what I’ll be producing.
First off, you need to make sure you have all the required dependencies to build and install the game. Execute the following to be sure: -
sudo apt-get install libopenal-dev libvorbis-dev build-essential automake1.10 autoconf libsdl1.2-dev libtheora-dev libreadline6-dev libpng12-dev liblua5.1-0-dev python-markdown cmake libwxgtk2.8-dev libwxgtk2.8-dbg libjpeg-dev lzma
Next, you obviously need the game. The recommended way to download is via torrent file here for the Linux version or if you have something against torrent, the direct download link is here. You will also need the patch, which as of the time of writing is 1.0.4 and can be downloaded here.
As I’m going to be creating a deb file which includes the installation path, I’m going to install Diaspora to /usr/share/games on my Ubuntu system. This is where quite a lot of games installed from the Ubuntu Software Centre install so it seems a good generic location. So copy your lzma file to /usr/share/games and then unpack it with: -
sudo tar --lzma -xf Diaspora_R1_Linux.tar.lzma
If that doesn’t work, try: -
sudo unlzma -z -k Diaspora_R1_linux.tar.lzma
sudo tar -xf Diaspora_R1_Linux.tar
This is a non-user location so sudo needs to be used to prevent the system from denying access. This will give you the directory “/usr/share/games/Diaspora_R1_Linux”. Within this directory is the actual game directory, called simply “Diaspora”. Move this to the root of /usr/share/games with: -
sudo mv /usr/share/games/Diaspora_R1_Linux/Diaspora /usr/share/games
Enter this directory now so that your current working directory is /usr/share/games/Diaspora. From here, enter the “fs2_open” subdirectory with: -
cd fs2_open
From here, we need to compile the FreeSpace2 engine code. Run the autogen shell script with: -
sudo ./autogen.sh
This will create a properly configured configure script that we will use to compile. Assuming you have no errors, compile with: -
make
Don’t worry about any warnings produced. This process can take a while, so go and make a cup of tea or something and come back when it’s done. Next, move the freshly compiled code with: -
mv code/fs2_open_3.6.13 ../fs2_open_diaspora
Now we need to configure the launcher. Move to the launcher subdirectory with: -
cd ../wxlauncher/build
Configure the launcher for compilation with: -
cmake -D USE_OPENAL=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -D DEVELOPMENT_MODE=1 ../
Compile the launcher using: -
make -j2
…where the number after the “j” is the number of CPU cores you wish to devote to the compilation. I simply use two here. Once this is done, move back to the Diaspora directory with: -
cd ../..
You should now be in the root Diaspora directory.
Next, you need to copy the default launcher template and set appropriate permissions on it.
cp pro00099.template.ini pro00099.ini
chmod 644 pro00099.ini
Edit this file using your favourite text editor and change this line: -
folder=/PATH/TO/YOUR/DIASPORA/FOLDER/HERE
to this line: -
folder=/usr/share/games/Diaspora
You might also want to change the following lines under the [video] tag to set your default screen resolution.
[video]
depth=32
height=768
texturefilter=Trilinear
width=1024
Then you need to apply the profile to your installation with: -
./wxlauncher/build/wxlauncher –add-profile –profile=Diaspora –file=pro00099.ini
./wxlauncher/build/wxlauncher –select-profile –profile=Diaspora
Okay, that’s it for the initial set up. You’re welcome to try out the game at this point to make sure it runs. Next we’re going to apply the 1.0.4 patch that we downloaded previously. Go back to the /usr/share/games directory and make sure the lzma file for the patch is located here. Unpack it with: -
sudo tar --lzma -xf Diaspora_R1_Patch_1.0.4.tar.lzma
Then move into the new directory.
cd Diaspora_R1_Patch_1.0.4
Unpack the enclosed tar file actually containing the files to your working Diaspora directory with: -
tar -xf Patch_Files.1.0.4.tar -C /usr/share/games/Diaspora/
If you have any previous patches installed, you need to delete the R1.0.2_Patch.vp and R1.0.3_Patch.vp files from your Diaspora directory if they exist. Next, you need to rebuild the source code for fs2_open like you did before with: -
cd fs2_open
./autogen.sh
make clean
make
Once it’s compiled, move it out into it’s own directory as you did before with: -
mv code/fs2_open_3.6.13 ../fs2_open_diaspora
Choose “y” to overwwrite what is already there. Next we need to rebuild the launcher again.
cd ../wxlauncher/build
Remember to run “make clean” first!
make clean
cmake -D USE_OPENAL=1 -D CMAKE_BUILD_TYPE=RelWithDebInfo -D DEVELOPMENT_MODE=1 ../
make
Once this is done, you can run the launcher with: -
In the launcher’s basic settings tab, ensure that the selected resolution is correct, and in the launcher’s advanced settings tab, add “-cap_object_updates 0″ to the box labelled “Custom flags” if it is not already added. Run the game to make sure everything still works.
Okay, now that we’ve patched and compiled the game, it’s time to package everything up into a nice installable deb file for future installation or giving to friends who didn’t want to wade through this article :)
First, go back to your home directory and create a directory which will be our “root” of the filesystem within the deb package. I’ll just call mine “Diaspora-Shattered-Armistice-1.0.4″
cd ~
mkdir Diaspora-Shattered-Armistice-1.0.4
As far as packaging up our game, this directory is now the “root” of the file system for our package. I’ll explain what this means in a bit, but for now we need to create a control file structure that tells our installing system something about the deb file we’re creating. For this you need a control file in a specific directory. Create the following: -
cd Diaspora-Shattered-Armistice-1.0.4
mkdir DEBIAN
cd DEBIAN
vi control
This control file explains to the system some basic information about our package, it’s relative size and any dependencies it needs. I’ve just added all the dependencies we needed in order to compile Diaspora – no doubt some of those (like the -dev packages) are not required simply to run the game, but what the hell. Anyway, here’s my control file: -
Package: diaspora-shattered-armistice-r1-1.0.4
Priority: optional
Section: games
Installed-Size: 3066608
Maintainer: Jonathan Baker
Architecture: any
Version: 1.0.4
Depends: libopenal, libopenal-dev, libvorbis, libvorbis-dev, build-essential, automake1.10, autoconf, libsdl1.2, libsdl1.2-dev, libtheora, libtheora-dev, libreadline6, libreadline6-dev, libpng12, libpng12-dev, liblua5.1-0, liblua5.1-0-dev, python-markdown, cmake, libwxgtk2.8, libwxgtk2.8-dev, libwxgtk2.8-dbg, libjpeg, libjpeg-dev
Description: Compiled version of "Diaspora: Shattered Armistice" version 1.0.4
Save this file and return to the command line. Go back up to the “root” of our package directory with: -
cd ..
Remember that we want to install Diaspora to “/usr/share/games/” so you’ll need to create this path under your package directory.
mkdir usr
cd usr
mkdir share
cd share
mkdir games
cd ../../../
You should now be at the root of your package directory again. Now to copy the compiled Diaspora game that we previously created to this location under our package file structure: -
sudo mv /usr/share/games/Diaspora ~/Diaspora-Shattered-Armistice-1.0.4/usr/share/games
Once this is done, you can create the deb file with: -
dpkg-deb -z8 -Zgzip --build ~/Diaspora-Shattered-Armistice-1.0.4
After a while, you should end up with a deb file called /home/youruser/Diaspora-Shattered-Armistice-1.0.4.deb which you can install in the usual way. That’s basically it. This was a very rough and ready approach to building binary deb files, but that’s the general idea. If you want to get more serious about building your own deb files for distribution, check out the following links. Me, I just wanted to try and compile and package Diaspora: Shattered Armistice to see if I could :D
Rolling Your Own Debian Packages
Debian Binary Package Building HOWTO
Despite early promises, Left 4 Dead 2 was noticeably absent from the Linux launch of Steam. Now however, the beta version of Left 4 Dead 2 is finally on Steam. If you’ve purchases the game for Windows or OSX already, the beta should appear in your Linux steam client. Otherwise you can simply purchase it through the Linux client.
Finally.
Okay, this guide will take you through ripping the contents of a regular DVD movie to an xvid-encoded avi file step by step using Linux command line tools only. I’ll concentrate on Ubuntu and Fedora but it should be easy on other distros too. Before we start, this article hinges on the use of libdvdcss. Depending on your country and Linux distribution, this may be easy or difficult. Google your distro name and “libdvdcss” if you can’t get hold of it.
For Fedora, you’ll need to get the libdvdcss package from a different repo than the standard ones. Add it with: -
rpm -Uvh http://rpm.livna.org/livna-release.rpm
yum install libdvdcss
If that doesn’t work, you can download the RPM file directly here. You can install the RPM manually with: -
rpm -ivh libdvdcss2-1.2.9-1.i386.rpm
For Ubuntu, you can install the libdvdcss package with: -
sudo apt-get install libdvdread4 && sudo /usr/share/doc/libdvdread4/install-css.sh
You’ll need some other tools too. Under Ubuntu, install with: -
sudo apt-get install vobcopy ffmpeg libxvidcore4 lame
Under Fedora, this is slightly different with: -
yum install vbocopy ffmpeg xvidcore lame
Next, create a mount point directory for your DVD files. I’m using /mnt/dvdrom but you can choose anything, anywhere although if you’re not root (as in Ubuntu), you might need to prefixing “sudo” to this.
mkdir /mnt/dvdrom
After you’ve done this, insert the DVD movie you want to burn and mount the DVD-ROM drive. For this example, I’m using the DVD of David Carradine’s 1976 classic “Carquake” also known as “Cannonball”. Man, I love me some of those old muscle cars. Anyway, I digress – but choose a DVD you want to backup :-)
Depending on your distribution, this may be one of the following devices under /dev. On modern distributions this is usually /dev/sr0, so the following will work.
mount /dev/sr0 /mnt/dvdrom
Again, under Ubuntu you might need to use “sudo” for this. Some older Linux distros have /dev/cdrom or a symlink from /dev/cdrom to /dev/sr0. It may even be auto-mounted under /media.
Anyway, one way or another you have your DVD mounted under /mnt/dvdrom. Now you need to use “vobcopy” to copy the VOB chapter files. Create a directory to hold these files. Make sure it’s on a partition with at least 10GB on it as this process can be heavy on file space. I’m using “/home/myuser/tmp” for this. Make sure you’re inside the directory. I’m using /home/myuser/tmp so the following will work: -
cd ~/tmp
Once you’re inside your chosen work directory, run the following command assuming your DVD movie is mounted on /mnt/dvdrom.
vobcopy -m -i /mnt/dvdrom -F 5 -v
This will mirror (-m) the contents of the DVD to your current directory from your chosen mount point. This process can take a long time. So go do something else for a while and come back. Also if you’re worried about your session dying or you want to push this process to the background, you can use: -
nohup vobcopy -m -i /mnt/dvdrom -F 5 -v > output.txt &
…which will to the same thing in the background but write it’s output to output.txt. Check the date/time on the last modifed column with a “ls -lah” on that directory or do a “ps -elf | grep vobcopy” to see if it’s still running. You can check the progress of the output with “tail -f output.txt” to see the percentage done updated in real time.
Once this is done, change to the new subdirectory VIDEO_TS – this is the directory structure of the DVD. If you do an “ls -lah” on that directory, you’ll see the VOB files listed. Mine for the rip of “Carquake” looks like this: -
total 1.2G
drwxr-xr-x 2 root root 4.0K Mar 25 02:11 .
drwxr-xr-x 3 root root 4.0K Mar 23 20:03 ..
-rw-r--r-- 1 root root 12K Mar 23 20:03 VIDEO_TS.BUP
-rw-r--r-- 1 root root 12K Mar 23 20:03 VIDEO_TS.IFO
-rw-r--r-- 1 root root 14K Mar 23 20:03 VIDEO_TS.VOB
-rw-r--r-- 1 root root 50K Mar 23 20:03 VTS_01_0.BUP
-rw-r--r-- 1 root root 50K Mar 23 20:03 VTS_01_0.IFO
-rw-r--r-- 1 root root 4.0K Mar 23 20:03 VTS_01_0.VOB
-rw-r--r-- 1 root root 283M Mar 24 03:29 VTS_01_1.VOB
-rw-r--r-- 1 root root 314M Mar 24 10:24 VTS_01_2.VOB
-rw-r--r-- 1 root root 252M Mar 24 17:45 VTS_01_3.VOB
-rw-r--r-- 1 root root 287M Mar 25 00:52 VTS_01_4.VOB
-rw-r--r-- 1 root root 64M Mar 25 02:11 VTS_01_5.VOB
Looking at this, we can surmise that the film itself is probably on the files VTS_01_1.VOB – VTS_01_5.VOB. So the next thing you’ll want to do is to convert these multiple VOB files into one. This is easily done with: -
ffmpeg -i concat:"VTS_01_1.VOB|VTS_01_2.VOB|VTS_01_3.VOB|VTS_01_4.VOB|VTS_01_5.VOB" -c copy concat.vob
This will give you one file called CONCAT.VOB. Now we need to convert the VOB file to our Xvid AVI file. Do this with: -
ffmpeg -i concat.vob -f avi -vcodec libxvid -acodec libmp3lame -qscale 3 output.avi
This should give you a file called “output.avi” which has xvid video encoding and mp3 audio encoding. Consider your DVD ripped :-)
Update 28/03/2013: If you have a DVD with dual audio, for example English and Japanese or something, you can choose to extract one for the audio in your xvid avi. Check out the -map switch to ffmpeg here. Using the -map option, you can choose to extract one of the specific audio tracks to embed in the xvid avi file.
Popular Unity3D powered simulation game, Kerbal Space Program gets a Linux port with the latest release, 0.19. Since Unity3D (not to be confused with Unity, Canonical’s desktop manager for Ubuntu) got a Linux export option back with version 4.0, it’s only been a matter of time until developers released Linux versions for their Unity3D powered software.
Kerbal Space Program is a space simulation game where you have to help the cute little inhabitants of Kerbin get into space. Currently, there are no fixed objectives as the game is going the Minecraft route of releasing beta software with continuous updates for paying customers.
It’s very much like Microsoft’s Space Simulator program from the early nineties with added construction of your own spaceships, rovers, space stations and landers. New features are being added all the time and if you ever wanted to know about thrust to weight ratios or orbital dynamics in order to help your little Kerbals into space, head on over to the official site to try the demo or to buy your copy (around £15 in the UK). Windows, Mac and Ubuntu Linux officially supported but it shouldn’t take much to run on other Linux distributions. If you want to know more there is an active subreddit for KSP or you can check out the wiki.
The official site is getting hit hard right now as returning and new users all try to download/buy the update at once so be patient if you can’t get in immediately :-)
Happy launching, Linux users!
NetFlix clients are on pretty much every device now from Windows to Xbox to PS3 to Android. All except Linux! There is a new Chromebook version (ChromeOS is technically Linux) which uses HTML5 which made certain Linux folks sit up but sadly it uses some sort of hadrware DRM thing on Chromebooks which isn’t available in a regular Linux PC. Until Netflix wants to make this magic native on Linux we’re stuck.
Until that time, you’ll have to resort to a bit of hackery using Firefox and the Windows API layer for Linux, WINE. Luckily for you, somebody has taken the time to bundle up the hack into a nice easily-installable desktop app for Ubuntu. Thanks to NixiePixel for the PPA information :-)
Okay, so NetFlix doesn’t have a Linux native client. On Windows, it uses Microsoft’s Silverlight Web platform to do the devil’s work and decrypt the content from NetFlix. Some Linux users have a problem with DRM in general but since the content is so easily available for free elsewhere on the Internet, I’ll throw NetFlix a bone and pay for some content. I’m not getting political on the use of DRM. Support the companies you like and vote with your wallet for those you don’t *cough EA*. Anyway, Linux doesn’t currently have an alternative to Silverlight which will do the DRM work for us so this NetFlix bundle includes WINE and Mozilla’s Firefox to simulate the use of Silverlight.
I’m using Ubuntu for this as it’s my regular desktop Linux distro. If you’re using Fedora or something like that, there is a version of this bundle elsewhere on the Internet. If you’re desperate for it, leave a comment and I’ll post it.
Okay, so you’ll need to add a new Ubuntu PPA for this. Open a terminal and type: -
sudo apt-add-repository ppa:ehoover/compholio
Update your repository cache with: -
sudo apt-get update
…and then install the NetFlix bundle with: -
sudo apt-get install netflix-desktop
Done! Search for NetFlix in the dash and add it to your Unity launcher or whatever. Once it starts, WINE will install some Firefox plugins and you’re good to go. Restart the NetFlix app, login and enjoy!
Update 15/04/2013: If you get a prompt asking for a Silverlight update, you can do the following: -
sudo apt-get update
sudo apt-get upgrade netflix-desktop
rm -rf ~/.wine-browser
That should fix the issue.
Do you want to access your Ubuntu desktop from pretty much any device? VNC has got you covered. Using the VNC client/server software we can see what our Unity desktop is doing on Ubuntu from a suitable VNC client, in this case Android, but VNC client software exists for pretty much every platform including iOS, Windows and Ubuntu itself. VNC stands for Virtual Network Computing and it’s a graphical remote desktop sharing system that uses a special network protocol called RFB (if anyone is interested) to remotely control another computer via it’s normally displaying desktop much like Remote Desktop Connection under Windows. It transmits the keyboard and mouse events from one computer to another, relaying the graphical screen updates back in the other direction over the network. Very useful for operating systems like Windows and OSX but optional for Linux users with a good grasp of the command line interface and SSH :-)
In this example, we’re going to install and configure the VNC server software on our Ubuntu desktop and get it to automatically start at boot and access our Unity desktop (or Gnome Classic if you prefer) via the VNC client software that you can get for Android from the Google Play store. I’ll also show you how to access Ubuntu from another Ubuntu machine for completeness sake.
So let’s get started. First we need to install the VNC server software onto Ubuntu. I’m using 12.04 for this but the process shouldn’t have changed much for 12.10 as of time of writing.
So first let’s refresh our software repository cache and install a couple of gnome packages that are required for what we want to do.
sudo apt-get update
sudo apt-get install gnome-core gnome-session-fallback
Next, we install the VNC server itself: -
sudo apt-get install vnc4server
Right, now we’re going to start the VNC server using the default settings. We’ll change those in a minute. The reason for starting the server before we’ve actually configured it to be useful is because it’ll ask you for a default password. Enter one and remember it as this will be needed to sign into VNC later. This password can only accept 8 characters or less – anything longer than that will be truncated to 8 characters. Start the server with: -
vncserver
once you’ve entered your password, kill the default VNC server we started with: -
vncserver -kill :1
We’ll back up the default configuration for the VNC first before we do anything in case something breaks.
cp .vnc/xstartup .vnc/xstartup.backup
Now that we’ve safely got a backup file, we can edit the original with: -
vi ~/.vnc/xstartup
Edit the file so that it looks like this: -
#!/bin/sh unset SESSION_MANAGER unset DBUS_SESSION_BUS_ADDRESS # exec /etc/X11/xinit/xinitrc gnome-session --session=ubuntu-2d & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot --solid grey vncconfig --iconic &
Notice the “gnome-session” directive’s session parameter which is set to “ubuntu-2d”. This is to show the Unity desktop. If you’re prefer to use Gnome Classic (and plenty don’t care for Unity), change that line so that it looks like this: -
gnome-session --session=gnome-classic &
Save that file and return to the command line. Since we’re going to be using an Android tablet to access this VNC installation, I’m going to set the desktop to a small resolution or 1024×768 although this can be anything you like depending on the size of the VNC client’s display. We’ll also use 16-bit colour depth as 32-bit doesn’t appear to display Unity’s launcher correctly from a VNC client and looking garbled. However, 32-bit will work with Gnome Classic’s GUI, so depending on what desktop session you’ve chosen use one of the following to start the VNC server: -
vncserver -geometry 1024x768 -depth 16
…or Unity or try 32-bit colour depth if you’re using Gnome Classic. You can always swap :-)
vncserver -geometry 1024x768 -depth 32
You can check the log for errors. The log file is stored in [USER_HOME_DIECTORY]/.vnc/[SERVER_HOSTNAME]:1.log where [SERVER_HOSTNAME] is the name of your Ubuntu machine.
If you have an error, you can kill the VNC server again with: -
vncserver -kill :1
…and check your xstartup config file for errors. If all looks good, VNC server should be running.
If you’re using Ubuntu’s firewall (and you should) you’ll need to open a port for the VNC server to listen for connections on. If you’re unsure if it’s running or not you can check the status of Ubuntu’s firewall with: -
sudo ufw status
If it’s active you’ll need to open a port. The default port for VNC server is 5901 so open that port with: -
sudo ufw allow 5901
Run the status command again and you should see that 5901 now has a rule of ALLOW. The VNC server is successfully running.
You might also want to add the following command to your /home/[USER]/.bash_profile file if you want VNC to start automatically upon your Ubuntu user login with by adding the following to your .bash_profile. This file doesn’t usually exist by default in Ubuntu but you can create it with vi with: -
vi ~/.bash_profile
Add the command line you used to start your VNC server with into this file and save it.
Next we’ll need to access this from an Android tablet (I’ll get to accessing Ubuntu via VNC from another Ubuntu machine in a moment). There are various VNC/RDP remote desktop clients on the Play store. I use Jump Desktop which is free for one VNC host. If you want more than one, you’ll have to pay a little bit, but for our purposes the free version is fine.
Download and install it on your Android device from the Play store. Fire it up and choose Manual Setup. Add a new connection with the following details: -
Address: [VNC_HOSTNAME] (IP address or hostname of the VNC server) Type: VNC
Save this new connection and then you can change the Display name (“My VNC Server” or something) and more importantly, the port, Change the Host Address entry so that it reads: -
[VNC_HOSTNAME]:5901
…rather than the default port of 5900. Back out of this menu and select the new host – you should be prompted for a password before connecting, this is the password you created initially. Jump Desktop allows you to use auto-login with this password if you prefer.
You should now be able to connect to your Ubuntu machine’s desktop. Hooray! If you want to connect to the VNC server from a different Ubuntu machine, you’ll have to install a VNC client for Ubuntu. I find that Ubuntu’s Remote Desktop Viewer works fine and can be installed with: -
sudo apt-get install xtightvncviewer
Start this up and click Remote->Connection to enter a new host. Again, use VNC as the thype of connection and I personally use Scaling and Fullscreen as well.
There you go. You can also get VNC server software for Windows if you want to access a Windows machine’s desktop from Ubuntu or Android. A good Windows VNC server is here.
I wouldn’t recommend running VNC over the Internet although obviously you’re free to. If you’re going to do that, I’d recommend using SSH tunnelling techniques to keep your communications secure.
Also it’s implied in this article that this is setting up a VNC session from an already running Ubuntu desktop session as the configuration file is specific to a server as is the running VNC server. System-wide, this ain’t. If you want a system-wide VNC server set up, you can look here for how to set that up. Personally I don’t use VNC outside of my home network as the only desktop I want to use is probably one already running in my study. If I need remote access to a machine, it usually isn’t for desktop purposes. For that I just use SSH :-)
Using Ubuntu, I’ve never found a way to disable bluetooth to save battery life on my laptop. However, I’ve finally found a way to disable it upon boot. As an added bonus, you can also disable WiFi with the same technique.
Login to your Ubuntu machine and then type: -
sudo vi /etc/rc.local
Add the following lines: -
rfkill block bluetooth # Disable Bluetooth
rfkill block wifi # Disable WiFi
To make sure the /etc/rc.local file gets run, flip on it’s executable bits with: -
sudo chmod +x /etc/rc.local
Sorted.
