Our Craft

Making it better

Posts Tagged ‘Linux’

Remote X11

Posted by danielmeyer on July 8, 2009

I have a main Linux box running Mandriva 2009.1, and I wanted to set up Linux on a second computer in such a way that I could be sitting at the second computer running programs off of the main computer — kind of like remote desktop, only this would be program by program instead of the whole desktop.

I had seen that magic work before (you just ssh to the other computer and run the command, and it shows up in your local display — I think there’s some kind of forwarding going on); but this time I wanted to add a second kind of magic: I wanted the secure shell session to happen without having to drop to a shell and type a password interactively.

I had seen both kinds of magic working before, just not simultaneously.

Magic A

The magic of running a ssh session without having to interactively type a password is explained on the ssh man page.  It involves the following steps:

  1. On the second computer, I ran ssh-keygen (with no master password, for now anyway).  This created (among other things) a ~/.ssh/id_rsa.pub file
  2. I copied the contents of the id_rsa.pub file to my home folder on the main computer in a new file called ~/.ssh/authorized_keys .
  3. I set the file permissions on the authorized_keys file so that only my user had any permissions (otherwise ssh ignored the file and prompted interactively for a password anyway!)

Now I could ssh from the second computer to the main computer without typing a password.  The stage was set for Magic B:

Magic B

Now on the second computer I made shortcuts for Firefox and Thunderbird on the main computer.  The commands in the shortcuts were:

ssh -f maincomputer mozilla-firefox

ssh -f maincomputer mozilla-thunderbird

Now when I click on those shortcuts, the programs run on the main computer but are displayed on the second computer, only slightly slower than on the main computer (maybe I’ll upgrade to a Gigabit internal network sometime).  Nice!

Posted in Technical Stuff | Tagged: | Leave a Comment »

Linux window-specific behavior

Posted by danielmeyer on June 30, 2009

When launching an rdesktop session from my Linux box, I wanted it launch fullscreen.  I’ll tell how I did it at first and then give a simpler solution.  [Note: I wrote most of this in April and May when I was running Mandriva 2009.0, but I didn't write down exactly how I'd gotten to things, and now that I'm running 2009.1 the path to get to things is slightly different.  I've updated the post to speak in terms of the 2009.1/KDE 4.2 ways of getting to these settings.]

How I Did It At First: No Border

Whenever I ran rdesktop I would then need to go to the window’s system menu to some Advanced submenu and choose the No Border setting.

An Improvement: Saving Window-Specific Settings

At some point I finally got tired of doing this every time I ran rdesktop and wished for a way to make my change stick so I didn’t have to do it every time.  Well, in KDE (I’m not sure about other window managers) there are “Window-specific settings” you can save.  So again on the window’s system menu, I chose Configure Window Behavior -> Window Specific and clicked Modify.  That took me to this configuration dialog:

preferences-no-border

I set No Border to Remember.  Now when I launched rdesktop I could go to the system menu and choose Advanced -> No Border and the next time it remembered this setting and automatically launched borderless.  Nice!

Except… sometimes I wished to de-borderlessify the window, and I couldn’t figure out how (though I did find I could hold down Alt and use the mouse to drag the borderless rdesktop session to a corner of the screen!).  It seems that borders are sometimes difficult to re-erect once you’ve taken them down…

A Simpler Solution: Toggle Fullscreen Mode

There may be some hotkey that lets me get the system menu back after choosing No Border*, but I found a solution that fits my needs better: simply toggling rdesktop fullscreen mode using Ctrl+Alt+Enter.  That way I can usually run in fullscreen mode but quickly have a normal window again when needed.

*(Actually, Alt+F3 normally brings up the system menu even if you have No Border, but rdesktop is different because it intercepts such key sequences.  That’s why I had to go the circuitous route.)

Clearing window-specific behavior

Great, but by now I had set No Border on the rdesktop window as a permanent setting.  I needed to figure out how to clear that setting.  It turns out that the place was:

Configure Your Desktop -> Window Behavior -> Window-Specific -> Modify -> Preferences and deleting the item “Window settings for rdesktop”.

Then I could run rdesktop like normal and simply press Ctrl+Alt+Enter to toggle fullscreen mode.

Posted in Technical Stuff | Tagged: , | Leave a Comment »

Scanner install bomb

Posted by danielmeyer on June 30, 2009

I intended to call this post Installing a scanner on Linux, but I hit a dead end.  The details of my attempt are first, followed by some ponderings.  I wrote the bulk of this article back in February of this year.


I just purchased a used HP scanjet 2400 color scanner and brought it home to hook it up to my Mandriva 2009.0 Linux box.

The Installation Attempt

Let’s see how it goes (I have the driver CD from HP, but I’m going to just hack around first and see if that’s quicker):

  1. I went to “Configure your Computer” and on the Scanners page it said to configure scanners the SANE (drivers?) needed to be installed.  I consented, and a quick 1.5MB download ensued.
  2. I ran XSane in case no setup was needed, but got this message: xsane-no-devices-available-message
  3. I tried again (just in case), but got the same message. :)
  4. I also notice that the scanner does not show up in the “Devices recently plugged in” window in the corner of my screen…
  5. I pressed Help on the XSane No Devices Available message box, and got this message: xsane-reasons-no-device
  6. Back at the Mandriva Configure Your Computer -> Scanners area, I decided to try Add a scanner manually… but the HP 2400c was marked UNSUPPORTED (and said so when I selected it and tried to go on).
  7. A web search turned up a post on the Ubuntu forums pointing to a driver and instructions at elcot.in.
  8. But, hmm, that download says there’s HP software in it, and I’m not sure if it would be legal.  (Can elcot.in transfer their license to unlimited numbers of others?)

Bigger Questions

I think next time I’d check the SANE project list of supported scanners before I purchased a scanner.

But……this experience has me asking questions.  In some senses, running Linux is about supporting the ability to have choices.  But then in other ways, running Linux limits my choices.   What does it mean?  Hmm.

Posted in Technical Stuff | Tagged: | Leave a Comment »

Invisible tooltips

Posted by danielmeyer on June 25, 2009

I recently installed Linux (Mandriva 2009.1) on a new PC and moved our home directories over to it so we’d keep our settings, email, etc.  When I did this, everything mainly worked fine, except that the tooltips (if that’s what they’re called) when I hover over an item on the task bar showed up with black text on black background, something like this (simulated ’cause I didn’t take a screenshot at the time):

invisible-tooltips

My wife’s desktop looked fine, so I figured it was some setting of mine rather than a bug in Mandriva or KDE 4.

It turned out all I needed to do was right-click the desktop and pick Appearance Settings:

desktop-context-menu

and then choose Aya (or Oxygen):

select-desktop-theme

Now the tooltip text is visible:

visible-tooltips

Rabbit trails (for those interested in how the solution was found)

I had fiddled with Configure Your Desktop -> Colors, but nothing seemed to have an effect on the taskbar’s colors.  I had recently read about something called “plasma” in KDE 4, which the taskbar is maybe part of.  I thought maybe the plasma stuff has its own color scheme, separate from generic tooltips.  Browsing through the search results from googling mandriva plasma colour settings, I found this article, which took me to a settings area I’d never been to before: Configure Your Desktop -> Advanced -> Desktop Theme Details.  I couldn’t at first figure out what to do in here, but when I changed a setting and clicked Apply, I got this dialog:

desktop-theme-details-clue

“Open the desktop Appearance Settings”… hmm… that got me exploring around (I went first to Configure Your Desktop but couldn’t find the setting, so I right-clicked on an empty area of the desktop and got the context menu, chose Appearance Settings, and picked a theme (the theme was blank when I first went there).  Fixed!

Posted in Technical Stuff | Tagged: , , , , | Leave a Comment »

Upgrade bomb

Posted by danielmeyer on May 19, 2009

I shoulda hadda backup.

The weekend before last I attempted an online upgrade from Mandriva 2009.0 to 2009.1.  The upgrade from 2008.I-forget-what to 2009.0 had gone with barely a hiccup, though I had performed it without backing up my data first.  This time I wanted to be less cavalier, so I backed up the /home partition beforehand.  I still didn’t back up the programs though.

The upgrade takes many hours even if nothing goes wrong (it’s pulling over a gigabyte, I think).  Things seemed to be going along fine for several hours, until the progress bar was over half, when I got a scary looking error:

upgrade-nvidia-pkg-missing

I chose to continue, but eventually the install gave up.  I restarted it, but after getting the above error again, I started seeing packages downloading that I thought I had seen before, and began to fear that the install was going in circles. I ended up stopping the upgrade.

The next time I rebooted, when I logged in I got an error about kdeinit4 in an odd little unmovable white dialog in the upper left corner of the screen:

Could not start kdeinit4.  Check your installation.

When I pressed the “okay” button,  I got logged back out.  Yipes!  My wife uses this computer too.  Down system!

I wished I had backed up the programs too.

I don’t know how to get back to Mandriva 2009.0.

A Workaround

I did find that I can log in using KDE 3.5, which is still installed.  The desktop is plain looking, but we can do our work until I figure out how to either upgrade or downgrade.

Reason for the Upgrade Issue

Why is there an unsatisfied dependency?  It looks like the Nvidia 71xx proprietary driver has not been upgraded for the version of X that ships with 2009.1.

Hmm.  I wish that I could have known that there was a stopper problem before I got halfway upgraded.

I wonder what I should do now?

Posted in Technical Stuff | Tagged: | Leave a Comment »

Where custom keyboard shortcuts went in KDE4

Posted by danielmeyer on April 27, 2009

When I went to Mandriva 2009.0, I also upgraded to KDE 4.  There was only one feature I missed from KDE 3: how you could assign keyboard shortcuts to run arbitrary commands.  I liked that and had my email, browser, and terminal set to easy shortcuts.

I hadn’t been able to find this functionality in KDE 4, even with doing a bit of searching around on the web.  But it’s there!

It’s There!

Here’s how to get to it:

If you’re using the new-style Application Launcher that lets you search, press the “K” launcher button and type khotkeys into the search box.  A program called Input Actions appears (I can’t seem to find it in the menus — I’m not sure how the search finds it).  This is what I think used to be called KHotKeys in KDE 3, and it’s the same good ol’ quirky interface that lets you hook up key combinations to actions.  (The “Windows” key can form part of the key combination, which I find convenient.)

Other Places to Configure Shortcuts

There are two other areas that look similar but didn’t seem to be what I wanted: Configure Your Desktop -> Keyboard and Mouse -> Keyboard Shortcuts allows configuration if the item already appears in the list;  and if you go to the Application Launcher and search for shortcut, there is a Keyboard Shortcuts item that appears that has some system-level shortcuts you can set (good information to know), but it wasn’t what I was looking for either because it didn’t seem to have my programs in the list or have a way to add them.  (Actually I think I could add them into the Keyboard Shortcuts one by first adding them to the menu system using the KDE Menu Editor…but I was used to doing it the old way.  Guess I’ll learn the new way if I eventually need to.)

Update: Boy, do I feel dumb.  I didn’t even try out the shortcuts to make sure they were operational before making this post, and they don’t seem to be operational for me.  I can set up a shortcut either the Input Actions way or through Configure Your Desktop -> Keyboard and Mouse -> Keyboard Shortcuts, but the shortcuts don’t seem to work, even after rebooting.  I don’t know how to do it. : (

Posted in Technical Stuff | Tagged: , | 3 Comments »

Enabling monitor power save mode on Mandriva 2009.0

Posted by danielmeyer on March 25, 2009

I couldn’t find how to enable monitor power save mode in Mandriva 2009.0 KDE — the screen saver just kept going and going without ever turning the monitor off.

It’s really quite easy — it’s just that the setting has moved from screensaver options to monitor options:

Just go to “Configure Your Desktop” -> Display -> Power Control

(Thanks to a forum post on 0×61.com for leading me toward the right idea!)

Posted in Technical Stuff | Tagged: , , | Leave a Comment »

K3B: Restorin’ them data files

Posted by danielmeyer on March 12, 2009

I had burned a backup of all our word processor files onto a CD-R, and armed with how to get the CD drive to show up in the Windows 95 virtualbox I popped that backup CD in to restore the data files onto the virtual hard disk.

I could pull up a directory listing for the backup CD, but only the first (oldest) backup folder appeared.  Oops, maybe Windows 95 didn’t support multisession CDs out of the box?  Mandriva can see the word processor data file backup directory on the CD, but Windows 95 can’t.

I had the idea, what if I could “burn” just the data files I wanted to their own .iso image file and then mount that in virtualbox to present to Windows 95 as the CD-ROM to copy from?

In the Mandriva application launcher menu search box I typed burn and found a program called k3b.  Here’s how I used the options to get the result I was looking for:

  1. I copied the files to the hard drive (in retrospect I don’t think this was necessary)
  2. I dragged the folder of backup data onto the what-to-burn area on k3b’s main window.
  3. I clicked the Burn button.
  4. On the Writing tab, I chose Only create image:
    k3b-writing-mode-image-file-only
  5. On the Image tab I chose where the .iso image file should be created (or rather, took note of the default):
    k3b-image-filename
  6. After clicking Start and creating the .iso image, I was able to set that up as a CD-ROM image in virtualbox, mount that image, and copy the files into my virtual Windows 95 box.  Woohoo!

Posted in Technical Stuff | Tagged: , , , | Leave a Comment »

.bash_history to the rescue

Posted by danielmeyer on February 10, 2009

My unadvised uninstall of the hsfmodem kernel modules on my Linux system seems to have been the cause of my Audacity playback suddenly not working any more.  In this post, I show how I used the .bash_history file to reconstruct what I had done so I could take compensating actions to reinstall what I had uninstalled.


After working fine for weeks, Audacity audio playback on my Linux system suddenly stopped working for me.  Other programs still played sound fine (system notifications; One Must Fall:2097 on dosbox…)

“But I didn’t change anything!” I mentally protested.

I found a post on the Linux-noob forum, someone saying that for them it was a kernel driver update issue.

Kernel…kernel…

I remembered that I had uninstalled a kernel driver a few days before. (When Mandriva Update suggests updates, I make a practice of going through the list and uninstalling components I don’t need first rather than continue with the security exposure of having them installed.)

Normally they’re just apps, but I did remember uninstalling a kernel module or two that other day.  What was it I had uninstalled? The name hsfmodem came to mind…

I looked for urpme logs in /var/log/ but didn’t immediately find something logging “packages uninstalled” (though, hey, it looks like /var/log/rpmpkgs might be the currently installed packages and /var/log/rpmpkgs.1.gz is maybe the installed package list from before the most recent change…)

Then I thought of .bash_history.  Doesn’t that have all the shell commands I’ve issued, going pretty far back?

It does!  I pulled up root’s .bash_history file and found the urpme commands I had run, or tried to run:

urpme hsfmodem-kernel
man urpmq
man urpmf
urpme hsfmodem-kernel-2.6.27
for f in hsfmodem-kernel-2.6.24.4-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586;hsfmodem-kernel-2.6.24.4-desktop586-3mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.5-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.5-desktop586-2mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.7-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.7-desktop586-2mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.27-desktop586-0.rc8.2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.4-desktop586-2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.5-desktop586-2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.7-desktop586-1mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-desktop586-latest-7.68.00.13-1.20081219.1mdv2009.0.i586
cat > hsfmodem.txt
for f in `cat hsfmodem.txt`; do echo $f; done

Ah yes, I had tried to remove all packages whose name contained the  string hsfmodem.  Did I still have hsfmodem.txt?

Yes, here’s what it contained:

hsfmodem-kernel-2.6.24.4-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.4-desktop586-3mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.5-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.5-desktop586-2mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.7-desktop586-1mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.24.7-desktop586-2mnb-7.68.00.07-1mdv2008.1.i586
hsfmodem-kernel-2.6.27-desktop586-0.rc8.2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.4-desktop586-2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.5-desktop586-2mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-2.6.27.7-desktop586-1mnb-7.68.00.13-1mdv2009.0.i586
hsfmodem-kernel-desktop586-latest-7.68.00.13-1.20081219.1mdv2009.0.i586

I tried passing these directly to urpmi, but it didn’t recognize these names… I think what eventually worked was issuing cat hsf-truncated.lst | xargs urpmi
based on this hsf-truncated.txt:

hsfmodem-kernel-2.6.24.4-desktop586
hsfmodem-kernel-2.6.24.4-desktop586
hsfmodem-kernel-2.6.24.5-desktop586
hsfmodem-kernel-2.6.24.5-desktop586
hsfmodem-kernel-2.6.24.7-desktop586
hsfmodem-kernel-2.6.24.7-desktop586
hsfmodem-kernel-2.6.27-desktop586
hsfmodem-kernel-2.6.27.4-desktop586
hsfmodem-kernel-2.6.27.5-desktop586
hsfmodem-kernel-2.6.27.7-desktop586
hsfmodem-kernel-desktop586-latest

I know there are some duplicate package names in there… but this was close enough to get hsfmodem reinstalled.  Then Audacity playback worked again.

I guess hsfmodem has to do with audio output as well as classic modemy stuff!

Posted in Technical Stuff | Tagged: | Leave a Comment »

smbget

Posted by danielmeyer on December 22, 2008

My wife and I each have our computer, plus there’s the old one in the basement that I use for recording projects (no kitchen computer, though!)

The one computer runs a modern flavor of Linux; the one in the basement runs an older flavor of Linux and I’ve cannibalized the CD-ROM out of it so I currently can’t install new programs from its installation CDs; and the other one runs Windows 95.

Sometimes it’s a challenge getting these computers to all be on speaking terms with each other!

The other night, I recorded a tape of my wife’s late grandmother reading James Whitcomb Riley, and rather than copy it up to the Windows 95 machine to burn a CD, I wanted to put it on the newer Linux box first, since I have a newer version of the Audacity sound editor there that has a noise eliminator filter I wanted to try out.

The basement computer makes available an SMB share that I usually access from Windows 95.  I thought there should be some command-line smb* command that would get me the recording file off the other computer’s share point.

There is: it’s smbget, and here’s how I used it:

smbget smb://host/sharename/path/to/file.ext

Then it prompted me for username and password (and maybe workgroup?  Though it defaulted to the right one).

Nice!

Posted in Technical Stuff | Tagged: , | 2 Comments »