Categories
Fedora HowTo Linux Ubuntu

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.

 

Categories
Arch Linux Fedora HowTo Linux Ubuntu

Heat Management in Linux

When you first switch from Windows or OSX to Linux, one of the things you’ll probably first notice (especially if you’re using a laptop) is that it can run considerably hotter than the alternatives. There are a few things you can do to remedy this, however. The following software packages help you keep track of and cool down your laptop/netbook, how much will depend per machine but my HP Pavilion dm1 goes from around 60-70degrees without these tools installed to around 50-60degrees and the same goes for my older Acer Travelmate which dropped from 70-80degrees to 60-70degrees. Hopefully this information will help you shave off 10degrees from your laptop, making it cooler, easier to use and hopefully extending its life a little too!

lm-sensors

First thing that you’re going to want to do is be able to see what the temperature readings of the components (that have temperature sensors) inside your computer/laptop. This can be done by installing lm-sensors:

sudo apt-get install lm-sensors

Now you’ll want to run the script which probes all the possible sensors in your laptop:

sudo sensors-detect

You’ll be asked if you want to scan for sensors and what not, follow the on-screen instructions, mostly just pressing enter, if YES is written in capitals this is the default answer and it will scan. After several times it’ll ask you if you want to save the changes, make sure you do and then you’re done.

Now you can see the temperature the sensors are reading by using the following command:

sensors
cpufreq

cpufreq is a utility which scales the frequency of the CPU, either by monitoring the systems status (if it needs more, it’ll get more) or by user controlled settings. This essentially underclocks the CPU while it isn’t in use, reducing power usage and thus heat.

Installation:

sudo apt-get install cpufreq

The best choice would be to set cpufreq to on-demand (default) or to power-saving. Alternatively, if you’re using a laptop or netbook let jupiter take care of it for you:

jupiter

Jupiter is a light weight power and hardware control applet for Linux. It is designed to improve battery life of a portable Linux computer by integrating with the operating system and changing parameters of the computer based on battery or powered connection.

Additionally, Jupiter provides quick access to some of the commonly needed hardware controls like screen output and resolution, WIFI, and bluetooth.

If you use Linux on a portable computer, let Jupiter take the effort out of going mobile.

By using this to intelligently control the CPU frequency when on battery and AC along with the tuning to the kernel and hardware, it can make a huge difference to the temperature expelled by your laptop.

Ubuntu 11:10 installation instructions: here

Graphics Card Drivers

If you have a dedicated graphics card in your laptop, you’ll also be better off installing the proprietary graphics drivers provided by the hardware vendor. While the open source ones do an awesome job of getting the card to work, more often than not they don’t include any control over the frequency scaling and keep the card running at max, along with all those other little features the card has, they’ll probably all always be running.

Nvidia : Link
ATI/AMD : Link

Categories
Arch Linux Fedora HowTo Linux Posts Ubuntu

Setting Up Surround Sound in Linux

It’s been a while since I bothered, the reason being it’s always seemed like an un-worthwhile struggle to get it working but either things changed or I was doing something to overcomplicate the process but it’s actually pretty simple to get surround sound up and running on your Linux machine. Now, I’m not going to go in to how to install the drivers for your specific sound card, because there are so many and I don’t have them all and most times on most popular distributions (Debian, Ubuntu, Mint, Fedora, OpenSuse etc) you’re going to notice that the sound card is actually already supported. What I will be doing is showing you how easy it was to get my 5.1’s set up (and the same will be said for 7.1’s).

Step 1:

First off you’re going to want to edit the pulseaudio configuration file to add the number of speakers you’re using, it’s default is set to 2.

sudo gedit /etc/pulse/daemon.conf

Near the bottom of the file, there will be a line which looks like this:

;default-sample-channels = 2

The semi-colon is a comment, so this line isn’t actually doing anything unless you remove that. I would suggest leaving that line alone and adding a new line at the bottom:

default-sample-channels = 6

If you’re using 5.1’s the number of channels will be 6, 7.1’s will be 8 and I think you get where I’m going with this? So in this example, I’m using 5.1’s.

Now save and close that file. You’ll need to reboot your system now too, so that these changes will take effect.

Step 2:

So you’re back? Good..

Now you’re going to want to open up the Sound Preferences, usually you can do this by clicking on the little sound icon in your panel, or System > Preference > Sounds from the menu.

From here, you’ll want to click on the Hardware tab. Near the bottom it’ll say Profile: with a drop down box next to it. Here you can select the type of set up you have, as you can see in the screenshot I have an “Analogue Surround 5.1 Output”, yours might be different and that’s cool and if you don’t know feel free to try a few out. Next to that drop down box is a button which says “Test Speakers”, this didn’t work for me so I have to use an online test but give it a try as it might work!

That’s it, you should be done!

Categories
Command Line Fedora Linux Posts Ubuntu

Linux USB Errors with usb-creator-gtk “stdin: I/O error stdin: error 0 /init: line 1: can’t open /dev/sr0: No medium found”

After installing Ubuntu on a USB stick with the Ubuntu USB Startup Disk Creator (usb-creator-gtk) you might encounter an error such as the following:

stdin: I/O error
stdin: error 0
/init: line 1: can't open /dev/sr0: No medium found

This is actually a bug with the software and isn’t anything you’ve done wrong. It seems to be a bug that’s effecting users running Karmic, Lucid, Maverick and Natty so it’s a pretty wide spread issue.

The best way I have found to get around this issue is to install and run unetbootin to create live USBs. If you’re using linux it should be found in the usual place you can install things.

Installation:

Ubuntu/LinuxMint/Debian:

sudo apt-get install unetbootin

Fedora/OpenSuse:

sudo yum install unetbootin
Create a live USB:

To install a distro it’s pretty simple, either select it from the “Distribution” option and pick a distribution and version, UNetbootin will then actually download it and install it for you. Alternatively you can pick an Diskimage and browse for the ISO file you download (and would usually burn to a CD/DVD) and install from that. Select the USB Drive at the bottom and hit ok and it’ll install a bootloader, the system and you’ll be up and running in no time.

Persistence File:

If you wanted a persistence install which allows you to save files, settings and installed programs you’ll have to do a little manual work as it currently doesn’t support that option.

Go to http://unetbootin.sourceforge.net/diskimg/ and download one of the files (128mb.zip, 256mb.zip, or 512mb.zip) corresponding to the amount of persistent space you want (make sure the size of the persistent disk image is smaller than the free space you have on your USB drive).

You’ll then need to edit the syslinux.cfg file that was created by UNetbootin in the root of the directory (just open it with a text editor) you should see something similar to the following:

label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash —

So on the line that starts “appen initrd=” you’ll want to add the option of “persistent”, it should then look like the following:

NOTE: WordPress changes my double dash at the end of the last line to a single long dash, this won’t work. It’s easiest just to add the final word before the double dash in the file, do not copy and paste this in to your file. If you do, you will get more errors.

label unetbootindefault
menu label Default
kernel /ubnkern
append initrd=/ubninit file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash persistent —

I added this line to all that used the “file=/cdrom/preseed/ubuntu.seed” option, since that’s the image that’s being opened and it should then change all options on the bootloader that will load the ubuntu install.

Categories
Arch Linux Fedora HowTo Linux Posts Ubuntu

Linux Media Players And Flash Not Stopping The Screensaver

It’s a pretty common problem, one which could be solved by pretty much the following sentence: ‘[Insert Linux Distro], [Insert Media Player] not stopping screen saver when playing videos.’ And, yeah, it’s very annoying. Something that should have been fixed thousands of releases ago, just like most common Linux problems. Luckily though there is a fix, it’s easy and it’s awesome.

Introducing: Caffeine, “An application to temporarily prevent the activation of both the screen saver and the “sleep” powersaving mode.” – https://launchpad.net/caffeine

Essentially what this program does is look for processes running on your machine (you can do this too, just run ‘ps -A’ in a terminal emulator to see a list of everything), so you set process names which the program should look out for, for example ‘vlc’ and when there is a process with this name Caffeine disables the screensaver, when the process stops the screensaver is re-enabled. It even comes with a little tray icon which allows you to manual enable or disable the screensaver/power management with a single click.

Installation (Ubuntu):
sudo add-apt-repository ppa:caffeine-developers/ppa
sudo apt-get update
sudo apt-get install caffeine
Usage:

You’ll be able to see if caffeine is running by the tray icon the first time you use it (this can be disabled in the settings).

Caffeine Running (Screensaver / Power Management Enabled)
Caffeine Running (Right Click Settings)
Caffeine Running (Screensaver / Power Management Disabled)
Adding Processes:

To add a process which will disable the screensaver from being activated, for example VLC so we can watch a movie without constantly having to wiggle the mouse:

First, run VLC (or whatever other media player you wish and just replace VLC for that for the other few steps)

Next, right click on the Caffeine tray icon and select “Preference”.

Click the “Add” button.

List of processes already disabling the screensaver, note Totem is added here.

You should be greeted by a list of the running processes, select the name of the media player (this case, vlc) if it isn’t there check under the “Recent Processes” tab or alternatively just write the command you would use to run this program from the command line.

Adding VLC to processes to disable the screensaver.

Finally click the “Add” button and close the preferences window, that pesky screensaver should no longer be bothering you!

Stopping Flash from enabling the screensaver:

Okay, this is actually really easy, if you’re using Chromium or Google Chrome or Firefox, you’ll just want to add the processes ‘npviewer.bin’ to list, you can use the above instructions to do so.

Categories
Arch Linux Blog Command Line Fedora Linux Posts Ubuntu

Switching Between Two Resolutions in Linux

I have a TV and my monitor connected to my PC by a VGA switch box but what’s annoying is they aren’t the same resolution. This causes problems because I can’t see what I’m doing when I have switched to TV and usually have to leave the setting manager open so that when I change between them I just have to hit return and the resolution changes. That’s great and all but it’s far more effort than I want for something I do fairly often.

My plan was initially to create two xorg.conf files and switch between them using a script, I figured this would be the easiest way even though I haven’t messed around with xorg stuff for a few years ever since things just started working better in Linux. Turns out I couldn’t even find where they keep the xorg.conf file, it sure isn’t in /etc/X11 where it was the last time I looked..

On the search for this file though I came across another useful tool called xrandr, which essentially allows you to change the resolution from the command line.

Xrandr is used to set the size, orientation and/or reflection of the outputs for a
screen. It can also set the screen size.

If invoked without any option, it will dump the state of the outputs, showing the
existing modes for each of them, with a ‘+’ after the preferred mode and a ‘*’
after the current mode.

There are a few global options. Other options modify the last output that is spec‐
ified in earlier parameters in the command line. Multiple outputs may be modified
at the same time by passing multiple –output options followed immediately by
their corresponding modifying options.

For more information on xrandr check out the manual page (or type man xrandr in terminal).

It turns out it’s an extremely easy tool to use, with a command as simple as the following changing the resolution:

xrandr --output VGA1 --mode 1440x900

So the next thing I did was create the following script which allows the resolution to switch between 1440×900 and 1360×768 (my monitor and my TV native resolutions).

#!/bin/bash

TV="1360 x 768"
MONITOR="1440 x 900"

TEST="$(xrandr | grep current | sed -e 's/.*current //;s/, maximum.*//')"

#echo $TEST

if [ "$TEST" == "$MONITOR" ]
        then
                xrandr --output VGA1 --mode 1360x768

elif [ "$TEST" == "$TV" ]
        then
                xrandr --output VGA1 --mode 1440x900

else

        exit

fi

This script simply checks what the current resolution is being used and then toggles between the two set resolutions.

Categories
Fedora Linux Posts Programming

GitHub: Agent admitted failure to sign using the key.

Upon testing my GitHub setup on my home computer I got the following error after inputting this:

ssh git@github.com

Returned:

Agent admitted failure to sign using the key.
Permission denied (publickey).

You’ll need to run:

ssh-add ~/.ssh/id_rsa

Make sure to enter the passphrase for the ssh key you generated.

Categories
Fedora Linux Posts

GNOME 3 – Delete Key Not Deleting/Working in Nautilus

In GNOME 3 it seems that the keyboard shortcut to delete a file in Nautilus is actually Ctrl+Delete, this is fine I guess if it’s trying to stop people accidentally deleting files or something but it’s pretty annoying.

To change the keyboard shortcut from Ctrl+Delete back to the usual Delete do the following:

Open a terminal and type:

dconf-editor

If you don’t have it, install it the usual way.

In the application that just opened, on the sidebar click:

org > gnome > desktop > interface

And check the box entitled: can-change-accels.

Now, leave this window open and open up Nautilus.

Select a file that you want deleting and then click on Edit in the Nautilus menu, hover over the Move To Trash button and here press the button you wish to assign to the action, so for example Delete. You may have to press it twice (the first time it will remove the old key-binding and the second will assign it the new one.)

Go back to dconf-editor and uncheck the can-change-accels option to stop any other keyboard shortcuts being changed and you’re all done!

Categories
Fedora HowTo Posts

Fedora 15 Post Installation Guide

Install RPM Fusion

su -c 'yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm'

http://rpmfusion.org/Configuration

Enable unsupported video and audio codecs

Get enhanced audio and video support in applications that rely on GStreamer:

sudo yum install gstreamer-plugins-ugly gstreamer-plugins-bad gstreamer-ffmpeg

Get enhanced audio and video support in applications that rely on xine backend:

sudo yum install xine-lib-extras-freeworld

http://rpmfusion.org/FAQ

Install Chromium Browser

Make a file called “fedora-chromium-stable.repo” in /etc/yum.repos.d/ and open:

sudo gedit /etc/yum.repos.d/fedora-chromium-stable.repo

Paste in the following, save and exit:

# Place this file in your /etc/yum.repos.d/ directory

[fedora-chromium-stable]
name=Builds of the "stable" tag of the Chromium Web Browser
baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$releasever/$basearch/
enabled=1
skip_if_unavailable=1
gpgcheck=0

[fedora-chromium-stable-source]
name=Builds of the "stable" tag of the Chromium Web Browser - Source
baseurl=http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-$releasever/SRPMS
enabled=0
skip_if_unavailable=1
gpgcheck=0

http://fedoraproject.org/wiki/Chromium

Install Flash

Download the YUM for Linux version from the adobe site – http://get.adobe.com/flashplayer/

Run the following in the folder you downloaded the file to:

su -c 'rpm -ivh adobe-release-i386-1.0-1.noarch.rpm'

Import the GPG key:

su -c 'rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-adobe-linux'

In 32bit run:

su -c 'yum install nspluginwrapper alsa-plugins-pulseaudio flash-plugin'

on 64bit run:

su -c 'yum install nspluginwrapper.{x86_64,i686} alsa-plugins-pulseaudio.i686 --disablerepo=adobe-linux-i386'
su -c 'yum install flash-plugin'

If you’re using Firefox, that should be all done but if you’re using Chromium you’ll need to open Firefox and play a video then close it and run the following:

32bit:

sudo ln -s /usr/lib/mozilla/plugins/libflashplayer.so /usr/lib/chromium-browser/plugins/libflashplayer.so

64bit:

sudo ln -s /usr/lib64/mozilla/plugins-wrapped/nswrapper_32_64.libflashplayer.so /usr/lib64/chromium-browser/plugins/nswrapper_32_64.libflashplayer.so

Close and re-open Chromium and head to YouTube to check that it’s working.

http://fedoraproject.org/wiki/Flash

Install Dropbox

Download and install the correct rpm for 32 or 64 bit from the Dropbox website – http://www.dropbox.com/downloading.

Follow this guide to remove the YUM errors you may encounter once the package is installed – http://alexsleat.co.uk/2011/05/24/how-to-fix-error-cannot-retrieve-repository-metadata-repomd-xml-for-repository-dropbox-please-verify-its-path-and-try-again/ .

Install VLC

sudo yum install vlc
Categories
Fedora HowTo Linux Posts

How To: Disable SELinux in Fedora

WARNING: by continuing following this guide you are putting your machine at risk by disabling the secuity features within SELinux, I strongly advise if you do not know what you are doing, stop and read up on the implications this action will have before continuing. Some information is avaible in the Fedora Wiki here .

Open up this file:

sudo gedit /etc/selinux/config

Change the line that looks like this:

SELINUX=enforcing

To this:

SELINUX=permissive

Save and reboot and it should be working, although again be warned this has disabled the security mechanism on your system. To re-enable this, simply do the same however change from permissive to enforcing and again reboot your machine.