Monday 15 February 2010

Load nvida-settings Configuration upon Login


Lets say you've tweaked your nvidia-settings configuration slightly to make things look better, possibly changed the contrast and saturation values in order to get more even looking colours and better definition. Maybe you've also noticed that these settings are not persistent between each boot, and require you to load nvidia-settings in order for them to have effect. This is quite irritating. A solution, however, is at hand.

It turns out that this is deliberate behavior on the part of the nvidia-settings program. In an instance where a computer has multiple users, you may want to have different configurations for each person. This is where your .nvidia-settings-rc comes in handy.

So open nvidia-settings and set it up the way you want it, once you've done that you want to navigate down to nvidia-settings configuration and click "save current configuration". This will then prompt you to save to your home folder, which is exactly what you want to do.

Nvidia settings can then be made to load the configuration upon login by adding

nvida-settings -l
to Startup Applications under System > Preferences.

If this doesn't work, try running that command in a terminal. When I did this I was given output along the lines of the following:

ERROR: Unable to assign attribute RedContrast specified on line 40 of configuration file
'/home/sam/.nvidia-settings-rc' (no Display connection). 


Luckily the solution is also fairly simple. You need to go back into nvidia-settings and untick "Include X Display Names in the Config File" on the nvidia-settings configuration tab, then resave the settings to your .nvidia-settings-rc.

Let me know if you have any issues!

Saturday 13 February 2010

Increase Compiz Performance with Nvidia Cards


A nice quick note here.

Always remember to add "--loose-binding" to Compiz-Fusion launch options when running a computer containing an Nvidia card. The performance boost is more than a little tangible.

For those of you who have Compiz constantly running, it is possible to enable this through Compiz Icon (Found in synaptic) under the options menu visible when right clicking on the taskbar icon.

Monday 8 February 2010

Why Clonezilla is amazing, and how Linux rocks


Recently a laptop running Ubuntu 9.10 broke down, with the screen and a few other components utterly refusing to work, it was still usable with an external screen and so some measure of recovery was possible. Now this laptop is used for work and had important documents along with specifically configured programs on it, making it a pain to set up a spare laptop with not just a backup of the documents, but also all the running programs on the computer.

Enter Clonezilla.

Clonezilla is a fantastic tool for creating images of hard-drives, partitions and backing them up for future restorations. It only copies used blocks on the drive, meaning that the image itself is never bigger than it needs to be.

So roughly 4 hours later, and a 220 gig image of the entire laptop was cloned to an external drive, ready to be moved into the spare laptop.

This is the bit where using Linux comes in handy. Once the image was restored on the spare laptop, the system booted perfectly on the new computer, and everything instantly worked exactly as before. This is the beauty of using a system that detects and loads drivers every single time it boots, keeping the information for these drivers entirely within its kernel. It didn't matter that completely different hardware was present, the install didn't complain once and it couldn't have been easier.

Saturday 6 February 2010

Gnome system monitor memory column dissapeared


Recently upon loading the system monitor in Ubuntu the memory column has been conspicuously absent. Some research revealed this to be a fairly old bug with the program that thankfully has a nice and simple fix.

This launchpad bug report deals with the issue, and it's the reply by Doc along with those that follow that reveal a solution, as well as suggestions upon how to deal with the various ways the problem manifests itself.

First load Gnome configuration editor:

gconf-editor 
Then navigate using the following steps as detailed by Doc:

apps -> procman -> proctree -> columns_order --> Add n.15 if missing, and if present, reset its position to follow the numerical order properly.

apps -> procman -> proctree -> col_15_visible --> Set to true

Hopefully that has fixed the issue!

Thursday 4 February 2010

Using a Hauppauge Wintv Nova HD S2 DVBS card with Mythbuntu 9.10


Unfortunately the 2.6.31 kernel that shipped with Ubuntu 9.10 has corrupted firmware for this card, and this will unfortunately result in you banging your head repeatedly against whatever hard surface is handy in an attempt to get it working. Thankfully, a solution is at hand.

As detailed by Douglas Mackay in this first reply here, a quick firmware download and install will solve the issue nicely, and result in you being able to utilise your card properly!

My Conky scripts, and how to run multiple instances thereof


As promised in an earlier post here are the scripts I use for conky, and a quick guide for running multiple conkys.

Initially you want to set up a script to run all instances of conky at once, so that they do not need to be initialised separately.

So, to create the script:

gedit multiple_conky.sh
Copy paste in the following code block:

#!/bin/bash

sleep 6 &&
conky -d -c /home/sam/.conkyrc &
sleep 6 &&
conky -d -c /home/sam/Scripts/conky_sys &
sleep 6 &&
conky -d -c /home/sam/Scripts/conky_sys2 &
exit 


Replace "user" with your username, then save and exit.

Make the file executable:
chmod 700 multiple_conky.sh
More after the jump.

Tuesday 2 February 2010

A handy delay script for startup applications


Typically applications that have been told to start on login by the user such as Firestarter or Conky may need to be delayed slightly in order to ensure they load properly, and without interference from other processes. A simple script comes to the rescue.

Howto after the jump:

Monday 1 February 2010

Force Nvidia Powermizer to stay at highest performance setting


If you're running drivers above version 185, then this guide is likely obsolete, as Powermizer has had a preferences option in nvidia-settings since then.

This is a nice quick one. To force Powermizer to stay at the default (and highest) clock of your graphics card always upon boot:

sudo gedit /etc/modprobe.d/options
Add the following line to the file:

options nvidia NVreg_RegistryDwords="PerfLevelSrc=0x2222"

Save and exit, then reboot.

Other performance levels may be specified, replace 0x2222 with 0x2233 for adaptive clocking.

UPDATE: This method does not appear to work for me in the latest versions of Ubuntu, please try the method in this post.

A cronjob script to e-mail you upon external IP address change


A while ago I was researching the implementation of a cronjob to e-mail me upon external ip change of a media server running MythTv in the house so as to be able to access MythWeb externally without issue. In any case, a solution presented itself in the form of a useful little bash script put together with the help of various sources (Which I can no longer for the life of me find) and a command line e-mail program called Mutt.

The implementation of this requires the creation of a small script, the installation and configuration of Mutt, and a Gmail account for sending the actual e-mail (though a native e-mail server, or anything handling imap will also do).

Howto after the break.

Nvidia driver installation gives dpkg divert errors when attempting to upgrade


While attempting to upgrade to 195 from 190.22 from the nvidia repositories I was cut short during installation by dpkg-divert errors. Much hair ripping and table bashing ensued during my vain attempts to find a solution, the answer however did eventually surface here.

Essentially older drivers had pointed some packages to different ones as part of its installation routine, installing newer packages with different diverts did not also upgrade where these packages pointed. Running the following commands in the terminal fixed this:

sudo dpkg-divert --remove --rename --package nvidia-glx-185 --divert /usr/lib/nvidia/libGL.so.1.xlibmesa /usr/lib/libGL.so.1
sudo dpkg-divert --remove --rename --package nvidia-glx-185 --divert /usr/lib/nvidia/libGL.so.1.2.xlibmesa /usr/lib/libGL.so.1.2
sudo dpkg-divert --remove --rename --package nvidia-glx-185 --divert /usr/lib/nvidia/libglx.so.xserver-xorg-core /usr/lib/xorg/modules/extensions/libglx.so
sudo dpkg-divert --remove --rename --package nvidia-glx-185 --divert /usr/lib/nvidia/libGLcore.so.xlibmesa /usr/lib/xorg/modules/extensions/libGLcore.so
A guide to actually adding the Nvidia repo and installing these drivers can be found at Ubuntu Geek.

There appears to have been some confusion between – and - as symbols used in the code block here, if one doesn't work, please attempt to replace all instances of one with the other, and try again.

Ensure sound is routed through the Pulseaudio server with padsp


Padsp is a Pulseaudio OSS sound wrapper that can be used in front of a command in the terminal to ensure that OSS output is routed through the Pulse Audio sound server. A typical use would be to make sure that wine outputs through Pulse, which it is not able to do by default.

I happened upon the use of padsp while attempting to research a fix for Wine games, which would play sound if no other program was outputting at the same time, and simply not work if there were. The issue was that Karmic is heavily reliant upon the Pulseaudio server, and Wine was attempting to output straight through Alsa, bypassing the server. This would work as long as nothing else was playing, however if there was, Pulse would take precedent and sound output from Wine would cease.

The solution? Simply add padsp in front of a start command, and tell wine to output as OSS in itss configuration menu.

For example:


The start command for World of Warcraft in Wine is:

wine "/home/sam/.wine/dosdevices/c:/Program Files/World Of Warcraft/Wow.exe" -opengl

Changing this to:

padsp wine "/home/sam/.wine/dosdevices/c:/Program Files/World Of Warcraft/Wow.exe" -opengl

Routes the OSS audio output through the appropriate sound server, and ensures smooth sound playback while listening to music at the same time.

This will work with any application capable of outputting sound via oss that is not already detected by Pulse. I have found this command necessary to use for Emesene also.

My Desktop


May as well have an instance of it up here, It'll be interesting to update this occasionally and see how it changes over time.

I'll publish the conky scripts used in the image at some point, if only to have an online backup!

Virtualbox module needs recompiling after every reboot


Karmic would give me the message:

Kernel driver not installed (rc=-1908 )

The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Re-setup the kernel module by executing

'/etc/init.d/vboxdrv setup'
Every time a virtualbox was initialised after rebooting. This would require the command given to be run with sudo privileges every single time, a lengthy and irritating wait.

This can be simply solved by adding the line "vboxdrv" to /etc/modules

So, in the terminal:

sudo gedit /etc/modules

Copy paste "vboxdrv" (without quotes) onto a line at the bottom of the file
Save and exit

Voila, hopefully problem solved!