Team Fortress 2 Segmentation Fault – Steam for Linux

After getting invited to join the Steam Beta for Linux, (after weeks of using the bypass) I decided to get playing some TF2. After the long install and download I booted it up. The Value splash screen with the tap-guy loads and the menu begins to load, but once it has finished, the game closed and returned to my desktop.

So I tried again, but this time ran steam through terminal in order to get some error messages. The following is what I found to occur when the game crashed:

response: CrashID=bp-ca59d62f-9c2b-47e4-8cd9-9d0b02121212
/home/alex/Steam/SteamApps/username/Team Fortress 2/hl2.sh: line 72: 4811 Segmentation fault ${GAME_DEBUGGER} "${GAMEROOT}"/${GAMEEXE} "$@"
Game removed: AppID 440 "Team Fortress 2", ProcID 4811
saving roaming config store to 'sharedconfig.vdf'
roaming config store 2 saved successfully

To fix it, there’s a pretty simple solution. This is to add the option “-nojoy” to the launch options of the game:

  1. Right click Team Fortress 2 in the Library pane of Steam.
  2. Click “Properties”.
  3. Click “Set Launch Options”
  4. Add the following: -nojoy
  5. Hit OK and launch the game, everything should be working!

If you’re running Fedora, some folk have found another solution to this fix, if the previous doesn’t work:

sudo setsebool -P allow_execheap 1

Where it seems SELinux isn’t allowing the game to start for whatever reasons.

 

How To Take Screenshots in Jelly Bean (Android 4.1.x)

To take a screenshot in Android 4.1.x (Jelly Bean) the same button combination from Ice Cream Sandwich (ICS) works:

Hold Volume Down & Power buttons for roughly a second.

You should know when the screenshot has been taken, the screen will flash white and a translation effect of the screen will take place. The screenshot should be saved in a folder /Pictures/Screenshots on your phones internal SD card, it’ll show up in the Gallery app under a “Screenshots” folder.

Taking a screenshot will also causes a notification (similar to in ICS), which display slightly different to those found in ICS,  they now show a cropped preview of the screenshot you’ve just taken.

 

This process works in Cyanongenmod 10, running on my Samsung Galaxy S (I9000) and should translate to all other phones and ROM’s. If it doesn’t be sure to leave a comment below.

 

 

Setting up a static external IP address on a Raspberry Pi (For Free!)

If you’re planning on setting up your raspberry pi as a server or a project that’ll want you to access it from a static external IP address, here’s a really simple and quick way to get that up and running for free.

First off, this guide uses the free service from no-ip (www.no-ip.com), so you’ll want to head over there and register for that. (http://www.no-ip.com/newUser.php)

Done? Ok, great. Next you’ll want to create a new host, this can be found under the “Hosts/Redirects” page (this link should work if you’re logged in: https://www.no-ip.com/members/dns/)

Click “Add a Host”

Enter a name and choose one of the free domains from the drop down box (alternatively you are able to use an existing domain name or sub-domain if you have one.) There are some other settings, if you know what you’re doing go ahead and choose which you prefer but from those who just want to get this set up you can now click “Create Host” and you’re done.

Now, in order for this system to know what your pi’s current address is in order to assign it that domain address you need to install the client on the pi (thankfully, they have a Linux one!).

Download the latest version of their client – http://www.no-ip.com/downloads.php?page=linux

tar -zxvf noip-duc-linux.tar.gz
make
sudo make install

One there, you’ll be promted for your email and password for no-ip.com.
It will then show you have a host registered, just hit enter.
Then it will ask to update the host you made on the site “Do you wish to have host [somedescriptivename.no-ip.org] updated?[N] (y/N)”. Type “Y” then hit enter.
It’ll ask for an update interval, this can be left at 30.
Then it’ll ask if you want to “run something on successful update”, basically this allows a script to run if it gets a connection. Choose N and hit return.

That’s it, you should be done. Just test out the connection via SSH or ping and compare the IPs.

HowTo: Restore Your Default .bashrc File in Ubuntu

If you’ve managed to find yourself deleting, overwriting or generally messing up your profiles .bashrc file there’s a really easy way to fix it. A default version of the file can be found under “/etc/skel/.bashrc”, simply coping that over your profiles one (found in your home directory) will restore it to default. Make sure to also source the file if you want to continue using it under that terminal or close and re-open the terminal.

I managed to have a blank bashrc after upgrading Ubuntu with a separate /home partition, while deleting all the old config files I must have also removed this.

The following commands should do this for you, be sure to make a back up of your current .bashrc file too, just to be safe.

cp ~/.bashrc ~/.bashrc.bkup
cp /etc/skel/.bashrc ~/
source .bashrc

You should be now back to a default terminal experience and continue to customise it how you like!

mlbviewer 2012 Installation guide for Ubuntu (MLB.TV on Linux)

Download mlbviewer:

Go and grab the latest version from the sourceforge page below:

http://sourceforge.net/projects/mlbviewer/

Unrar:

tar -zxvf mlbviewer2012.tar.gz

It doesn’t require any installation but you will need a few extras and the easiest way to install them is shown below:

Download PyXML:

PyXML is an XML processing tool for python which this project uses, sometimes it can be tricky to install python modules so we’ll be using setuptools which you can get from the link below.

If you’re unsure of what version you need, open terminal and type “python”, this will show the version of python you’re running. Mine was 2.7.4 so I downloaded “setuptools-0.6c11-py2.7.egg” I would imagine yours would be similar.

http://pypi.python.org/pypi/setuptools#cygwin-mac-os-x-linux-other

Once you have it, run it (replacing the version you downloaded for the one here):

sudo sh setuptools-0.6c11-py2.7.egg

Now to install PyXML it’s as simple as running:

sudo easy_install pyxml

That’s it, you’re done.

Optional – Install MPLAYER2:

MPLAYER2 offers at lot of advantages over MPLAYER however we’re most interested in it because it offers better streaming support and handle stream rate switches (important if you enable adaptive streaming in nexdef mode).

sudo add-apt-repository ppa:motumedia/mplayer-daily
sudo apt-get update
sudo apt-get install mplayer2

(Thanks to – Web Upd8)

Optional – Install mlbhls (for nextdef | HD):

Instructions as per in REQUIREMENTS-2012.txt in the mlbviewer package.

You’ll also need some extra packages which aren’t stated:

sudo apt-get install libconfig-dev libcurl4-gnutls-dev
svn co https://mlbtv-hls-nexdef.googlecode.com/svn/branches/experimental mlbhls
cd mlbhls
make
sudo cp mlbhls /usr/bin

Once that’s done, you should be able to get the higher bitrate streams too!

Using mlbplayer:

Setup:

The first time you run mlbviewer it will generate a config file which you’ll need to enter your Premium MLB.TV account details in, running mlbviewer will tell you where this file is located:

python mlbviewer.py

Go edit the file and enter your email as the “user” and your password after “pass”.

Now re-run mlbviewer and it should start up!

python mlbviewer.py

Sit back and enjoy!

fatal error: curl/curl.h: No such file or directory | Ubuntu 12.04

fatal error: curl/curl.h: No such file or directory

If you’re missing the curl/curl.h header file, chances are you’re just missing the correct dev package file for the curl library.

sudo apt-get install libcurl4-gnutls-dev

That should fix it.

fatal error: libconfig.h: No such file or directory | Ubuntu 12.04

If you’re getting the following error:

fatal error: libconfig.h: No such file or directory

Then you’re probably missing the libconfig-dev package from your system. Simply run the following command and it’ll fix it:

sudo apt-get install libconfig-dev

gimp: error while loading shared libraries: libgegl-0.0.so.0: cannot open shared object file: No such file or directory

After upgrading from Ubuntu 11.10 to 12.04 I found gimp couldn’t access the shared libraries it needed, most likely an error with symbolic links as described by lovelyindia in this post.

Fix 1:

He managed to fix the issue by removing gimp and purging the offending libraries and then letting apt deal with the libraries when he re-installed gimp, as per the below commands:

sudo apt-get update 
sudo apt-get purge gimp libgegl* libbabl* 
sudo apt-get install gimp 
sudo apt-get clean

While this is likely to work for most people encountering this issue, it didn’t for me.

Fix 2:

Then I remembered I had used the repogen source list generator, in which I chose to include the gimp svn build. While you may not have gone about it the same way, you may also have a different repository in your sources.list file which is causing this issue, if the previous method did not resolve the issue.

In order to fix this, I had to open the sources.list file and comment out the offending repo.

sudo gedit /etc/apt/sources.list

Now search for any reference to gimp, in my case this was the lines I changed:

#### Gimp SVN - https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn
## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB
deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main

I commented out the line linking to the repo by adding a ‘#’ to the front, as below:

#### Gimp SVN - https://launchpad.net/~matthaeus123/+archive/mrw-gimp-svn
## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 405A15CB
# deb http://ppa.launchpad.net/matthaeus123/mrw-gimp-svn/ubuntu precise main

I then uninstalled gimp, once I knew it may have been the newly added repository that I had added:

sudo apt-get purge gimp

Then I saved and exited the file and updated apt:

sudo apt-get update

I then re-installed gimp:

sudo apt-get install gimp

This solved the issue for me, I hope this helps!

10 Command Line Tricks I Wish I’d Always Known

One thing that Linux Guru’s and Terminal Wizards often argue is that it’s way quicker to use the command line to do anything in Linux than it is through menus and what not. While the jury is still out on this, there are a lot of things they know which do help put the ball in their court which can often take a lot of time exploring the terminal to discover. I’ve compiled a list of my favourite commands and tricks that I think that would have saved me a bunch of time if I’d been aware of them when I first ventured in to Linux.

1. Repeat Recent Commands:

Let’s say you’ve just ran a command but forgot you needed to run it as sudo, you can use !! to repeat it with the additional sudo at the beginning, as below:

alex:~$ apt-get install package
alex:~$ sudo !!
sudo apt-get install package

Additionally you’re able to use this to go back further than the last command by replacing the second ! for -n (where n is the number of commands ago you want to repeat).

alex:~$ ls
alex:~$ cd dir
alex:~$ cat file
alex:~$ !-3
ls

How about if you want to reuse the arguments from the last command but not the command itself, well it can do that too:

alex:~$ ls /home/alex/Desktop
alex:~$ cd !*
cd /home/alex/Desktop

2. Replace String In Last Command:

The use of the following command allows you to repeat the last command but replacing a string within it, useful if you made a mistake or typo. The follow example shows correcting a path for a change directory command.

alex:~$ cd /this/dir/is/wrong
alex:~$ ^wrong^right^
cd /this/dir/is/right

3. Reset:

Chances are, you’ll come across a situation where you’ve seemingly borked a terminal. Maybe you used cat on the wrong file or a program tried to export some strange characters which changed the settings. The following command should get you back to a fresh terminal quickly and you can often run it even when you don’t think you can. If the screen is really borked, try hitting enter before hand, typing reset and hitting enter again.

alex:~$ reset

4. Running A Command In The Background:

Adding an & after the command you run allows you to continue to use the terminal screen while keeping the process running. Below shows an example of opening gedit in the background but allowing me to continue using the terminal for other commands. Great for editing and compiling code with the minimal number of terminals open.

alex:~$ gedit &

Once ran it’ll give you the process ID which allows you to kill it easily once you’re done with it.

5. Exiting A Terminal & Keeping Background Processes Running:

If you’ve opened a bunch of processes in the background (as per previous command) but now you want to close the terminal screen but not these processes you can use the following to release the ownership of the processes and exit.

alex:~$ disown -a && exit

6. htop:

Similar to ‘top’ (which allows you to view tasks in real-time with other useful info such as memory and CPU usage) but it’s displayed in a much easier to understand and interactive. It allows you to kill tasks without entering its PID, search, filter, sort and a bunch of other features.

alex:~$ htop

7. Reverse History Search:

Ctrl + r

Using this will allow you to start typing and it’ll find the last command that contained the string you’re typing, hitting enter will execute that command. For example:

alex:~$ cd /home/alex/this/is/a/dir
ctrl+r & typing "a/dir"
(reverse-i-search)`': cd /home/alex/this/is/a/dir

8. Piping (Combining) Commands:

Piping commands allows you to pass the data that would usually be outputted to be directly passed as an input to another command, for example below is a list command being passed in to the less command to allow for scrolling of the data. This will work for most commands and experimentation is the best form of learning in this case.

alex:~$ ls | less

9. Auto Complete Command & File Names:

Half way through typing a command you can hit the Tab key and it’ll auto complete the word for you, if there are more than one other possible combinations a double tap of it will show you the possibilities. This also works for directory and files and can save some serious typing time.

10. Other useful Keyboard Shortcuts:

A few other keyboard shortcuts that are also useful to know (and not always as obvious as they should be):

Ctrl + c – kill current process
Ctrl + z – put current process in to the background
Ctrl + l – clear the terminal
Ctrl + a – set cursor to the start of the line
Ctrl + e – set cursor to the end of the line
Ctrl + shift + c – copy
Ctrl + shift + c – paste

Ubuntu 12.04 – Removing conflicting operating system files…

If you’re trying out the latest version of Ubuntu, 12.04 or Precise Pangolin and you want to keep your old /home partition, chances are you’ve come across the installation hanging on a process “Removing conflicting operating system files…”. No worries, this seems to be a common bug and there’s a pretty easy work around.

Continue with the installation, without asking for the /home partition to be mounted. Only set the root partition (/) and your swap space.

Once the installation is complete, reboot and load it up.

Now, you’ll want to find the partition that /home is mounted under, this will likely be /dev/sdxN, where x is the drive letter and N is the partition number (i.e mine is located under /dev/sda5).

If you’re unsure, you can list the possible drives using the following command:

ls /dev/ | grep sd

And then you can mount each drive under in a temp directory and check what’s in there:

mkdir temp
mount /dev/sda1 temp

Once you know which partition you want, it’s time to edit your /etc/fstab/

sudo gedit /etc/fstab

For those who don’t go digging around in the config files of linux, this may look pretty daunting, but it isn’t. All you really need to do is add a new line to mount your home partition. Here’s mine:

/dev/sda5	/home/		ext4	defaults	1	2

The first part is the partition that’s being used, next what the partition is. Next is the file system type. Followed by default options and then the dump and pass values.

Once you’ve saved this file with the appended line, reboot your system. Now you should find your old home partition is mounted normally and you can get on with your install.