GKSU keeps rejecting the password.

If you’re using a Debian based Linux distribution and gksu keeps rejecting your password, try “gksu -S”. If that works, use gconf-editor to make sure “sudo-mode” key under “gksu” is checked.

Advertisements

Fixing a strange Graphics Problem with Ubuntu on a Dell Laptop

I’ll just stick this out here in case it helps somebody who stumbles across it. I have Ubuntu on an aging Dell Inspiron. After a while, my display would start getting crappy. The interlaced lines in desktop icons and website images would fall out of alignment, making the image look smeared horizontally. I would also get a pattern of rectangles on my desktop, each made of black or white horizontal lines, so it looked like a sideways barcode label. After a longer while the system would bog down.

The solution was realizing that I had a Mobile Intel® GM45 Express Chipset. Using Ubuntu’s Unity desktop, you can find your graphics information by clicking the gear in the upper right corner and then “About this Computer”. With that knowledge, I searched Ubuntu Software Center for an appropriate driver. I just had to search “GM45”. From there I downloaded the “VAAPI driver for Intel G45 & HD Graphics family (transitional package)”. And that was it! Everything seems to be fine now.

Update Jan 3rd: The fix isn’t perfect, but my laptop still seems to be working much better. The problem has reappeared but the effect is much smaller and the system hasn’t slowed down. The reappearance has given me an opportunity to post a screenshot, which I didn’t think about taking before downloading the driver.

So not perfect, but still a big improvement.

Update (2013 March 14) Like I said, still not perfect. Others with this problem have found that having a mismatched memory sticks may be causing the problem; that is the GM45 chipset doesn’t work well if the two memory sticks aren’t the same. I have 3Gigs, so the problem may be solved completely if I upgrade to 4 or downgrade to 2. I’m probably not going to bother. More info on that here: and here:

Alternate Run command for Ubuntu 11.10

I have a habit of solving problems that have already been solved better by someone else, and I may be guilty of this here, but I wrote my own command prompt script because I didn’t like the default command prompt in Unity. A more sane way to solve the problem might be to install and setup gnome-shell, as described here, but I still like my script.

The script presents a list box with [type command] as the first choice and your command history as all the other choices, with the most recent on top (your command history is blank the first time).

Dropdown box of historical command list, with first choice [type command'

Using Ubuntu 11.10 with Unity, after creating your script with the listing below, save it in an appropriate location and make it executable.

Then choose system settings > keyboard > shortcuts > custom shortcuts, as detailed here: Click the gear in the upper right corner of your screen and choose System Settings. From there, find the keyboard widget (not the keyboard layout widget), choose the shortcuts tab, and click custom shortcuts.

Click the + sign at the bottom, and add the path name of the script file. Then click on the shortcut field (it probably says “Disabled”) and click again if necessary until it says “New shortcut”. Then press the keystroke that you want to assign. You probably want alt+f2.

Keyboard control panel, the selected item from the left menu is Custom Shortcuts

You may have to disable alt+f2 elsewhere to avoid conflicts, but I didn’t disable it for the Unity plugin in CCSM and I’m not having any problems.

Below is the script.

#!/bin/bash

#Filename: launch (or whatever you want to name it)

#Command Launcher
#Brings up a dialog box from which you can choose a command from your history
#Also has a choice to type in a command

#Works in Ubuntu 11.10 with Unity
#Requires zenity

#Make this file executable.
#You can create a hotkey in the "Command" section in CCSM

#You can directly edit this history file
HISTFILE=~/.launchhistory
TEMPFILE=~/.launchtemp

# Setting the field separator to be newline, to preserve whitespace
OLDIFS=$IFS
IFS=$'\n'

# Populating the list box with commands
# The first command to appear in the least box is [type command], which brings up a text box
echo "[type command]" > $TEMPFILE

# The remaining commands in the list box come from the history file
for hist in `cat $HISTFILE`; do {
echo "$hist" >> $TEMPFILE ;
} ; done

# Setting the field separator back to normal, to run the command properly
IFS=$OLDIFS

#calling the zenity list box to bring up a choice of commmands
runthis=`cat $TEMPFILE | zenity --list --column='choose' `

#If user chose [type command], bringing up the zenity text box
if [ "$runthis" == "[type command]" ]; then {
runthis=`zenity --entry --text="run"`
} fi

#Running the command, and if successful adding the command to the history file
$runthis && {

# Setting the field separator to be newline, to preserve whitespace
OLDIFS=$IFS
IFS=$'\n'

#Putting the new command at the top of the tempfile
echo "$runthis" > $TEMPFILE

#Putting the old commands from the history file into the tempfile
for hist in `cat $HISTFILE`; do {
#But not repeating the newest command
if [ "$runthis" != "$hist" ]; then {
echo "$hist" >> $TEMPFILE;
}
fi
} ; done
#Saving the tempfile as the history file
cat $TEMPFILE > $HISTFILE

#Setting the field separator back to normal before exiting
IFS=$OLDIFS
} ;