Saturday, September 6, 2008

Ubuntu: Synaptic not in menu and cannot start/run from command line

My otherwise blissful installation and use of Ubuntu on an aging 2.4ghz athlon was rudely interrupted today when I could not find Synaptic package manager in my menus, and when, when I tried to run it from the command line, I was informed that there was a su problem and I should contact my administrator. Oy. I am the administrator...

Turns out that the problem was that I somehow removed myself from the admin group, therefore, I lost privileges to do sudo type things (such as fixing the fact that I lost sudo priviliges).

To correct this, I had to reboot and go to the recovery console and choose the root shell option. From there, I used the following command to restore the admin group to my user account.

# usermod --group admin rcs

I then rebooted and everything was good again. So Ubuntu is back in my good graces.

Wednesday, September 3, 2008

Dual-head kubuntu alt-tab only shows windows on the active screen

I've been plagued by this problem since I installed and configured my Kubuntu 7.04 and I just happened upon the solution by entering the just-right search terms. When I alt-tab to find a window, the list of windows are only the windows on the active screen. Meaning that I get a different list when my mouse pointer is in the left screen and the right screen. I'm used to just seeing all the windows across screens regardless of which screen my mouse pointer is in.

Solution found on ubuntuforums.org (http://ubuntuforums.org/archive/index.php/t-284693.html)

Run: "kcmshell kwinfocus", in the resulting dialog, check "Separate Screen Focus". Save changes and press alt-tab. You should see all windows.

Thursday, August 28, 2008

Jump-starting a car using jumper cables

Yesterday, I absent-mindedly left my headlights on when I returned to work from lunch and when I went to leave for a doctor appointment at 4:15, the battery was completely dead. A friend and I tried to pop-start it, but had no luck. Then someone who works in the building came over to give a jump start.

After playing with the jumper cables for a little while, we got it started. Which led me to look into the correct way to connect the cables, which is:

Dead battery: jumper cable to positive terminal
Live battery: jumper cable to positive terminal
Live battery: jumper cable to neutral terminal
Dead battery: jumper cable to some ground on or near the engine (shiny metal)

They also recommended shutting off the engine of the car giving the jump-start to protect the alternator.

So there you go. And here you go: http://www.carbuyingtips.com/jumpstart.htm

Wednesday, July 30, 2008

Date tricks in Firebird

Stolen from: http://www.firebirdsql.org/rlsnotesh/rlsnotes210.html

Tricks for Firebird dates.


A Useful Trick with Date Literals
H. Borrie

In days gone by, before the advent of context variables like CURRENT_DATE, CURRENT_TIMESTAMP, et al., we had predefined date literals, such as 'NOW', 'TODAY', 'YESTERDAY' and so on. These predefined date literals survive in Firebird's SQL language set and are still useful.

In InterBase 5.x and lower, the following statement was “legal” and returned a DATE value ( remembering that the DATE type then was what is now TIMESTAMP):

select 'NOW' from rdb$database /* returns system date and time */


In a database of ODS 10 or higher, that statement returns the string 'NOW'. We have had to learn to cast the date literal to get the result we want:

select cast('NOW' as TIMESTAMP) from rdb$database


For a long time—probably since IB 6— there has been an undocumented “short expression syntax” for casting not just the predefined date/time literals but any date literals. Actually, it is defined in the standard. Most of us were just not aware that it was available. It takes the form . Taking the CAST example above, the short syntax would be as follows:

select TIMESTAMP 'NOW'


This short syntax can participate in other expressions. The following example illustrates a date/time arithmetic operation on a predefined literal:

update mytable
set OVERDUE = 'T'
where DATE 'YESTERDAY' - DATE_DUE > 10

Tuesday, July 15, 2008

Firefox 3 and Java 6 (Java 1.6) on Kubuntu 7.04

Was having trouble getting a certain applet to run in Firefox 3 so I started digging into the problem. Through a little Firefox configuration and installation/configuration of the latest Java from Sun, it's all working now. Here are the steps I used.

If all goes for you as it did for me, you can now go to this URL to verify that Java is working: http://www.cyberdyne-systems.co.uk/bz/bzsplash.html

Friday, July 11, 2008

More on remote desktop using x11vnc

On January 8, 2008, I posted about remote desktop. I've since found two nice features of x11vnc that I wanted to share.

The first is scaling. My work desktop is 1680x1024 and 1600x1280. My home desktop is 1280x1024 and 1280x1024 (both lcd native resolutions). I wanted my entire work desktop to fit on my home desktop. The solution was using scaling.

x11vnc -scale 5/8

This scales the desktop by the named fraction. The fraction can be less than one (reduction) or greater than one (zoom). It does seem to slow down the display.

Another nice feature is sharing a single window rather than the entire desktop. My naming a window id to share, x11vnc will only share that window, not the entire desktop. To get the window ID, connect to the remote Linux host and run

xwininfo -display [display] -name [name]

Where [display] is the display on which the window is being shown on. I use localhost:0 as my display, which maps to my left monitor at work.

And where [name] is a substring of the window title. I use 'Eclipse'. This will return a hex window id (and other information). Note this id.

Now, run x11vnc with the -id parameter:

x11vnc -id 0x12345678

Then on your local host, run your vnc viewer.

Monday, June 16, 2008

Configuring dual monitor setup in Ubuntu

So my friend was in dual monitor hell after a new installation of Kununtu (8.04). It would only do clone mode (where both monitors have the same output) or not start at all. We did some research into the xrandr . While in clone mode, we gave the command:

xrandr --output VGA-0 --right-of DVI-0

This complained about the screen not being big enough. A little more research said to edit the xorg.conf and change the Screen block to look like this:


Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
SubSection "Display"
Virtual 3200 1200
EndSubSection
EndSection


The key part is the "Virtual" line. It says that the "virtual" screen is 3200 pixels wide by 1200 pixels high. She is running a DVI and CRT monitor side-by-side, each running 1600x1200.

Restarting the X-server (ctrl-alt-backspace), then startx from the command line resulted in clone mode again. From here, we issued the command

xrandr --output VGA-0 --right-of DVI-0

again, and behold, functional multi-display.

Of course, this means that she has to issue that command every time she logs in.

Additionally, since dual monitor support is such a complex issue, your mileage may vary. I followed the following steps to find my solution.

1. Does the initial configuration after install meet your needs? No
2. From System Settings->Monitor & Display, can you get it to work? No
3. Examine the /etc/X11/xorg.conf file. Can it be tweaked to make it work? No
4. Install the drivers from your video card manufacturer. Does this work? No
5. Mess with xrandr until it works.