Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Linux Disabling X server autostart (gdm) on Ubuntu Karmic (9.10)

Posted by Admin • Monday, November 16. 2009 • Category: Linux

There are many reasons one may wish to do this - running their desktop installation as a sever (temporarily perhaps), solving some video issues... or just doing it to get that facet of control back. I, for instance, prefer to run X with "startx" when I'm ready to do so. I do not enjoy a black screen when the latest intel video driver doesn't work - I'd rather Ctrl-Alt-Backspace and fix it.



Anyway, so Karmic (and apparently certain installs before Karmic, as well) uses an init system called "Upstart". If you've tried messing with update-rc and noticed that disabling /etc/init.d/gdm doesn't work, this is why. Oh sure, you can run /etc/init.d/gdm stop, but it's only temporary, assuming that works for you at all - for me it does not - my console does not recover and I get a black screen.



To get it to stop permanently the proper way is apparently to work with upstart. You'll notice some definitions in /etc/init (no, not /etc/init.d). These work somewhat like the Gentoo init.d scripts - you can define dependencies, events, phases, etc. So looking at /etc/init/gdm.conf I see:

Continue reading "Disabling X server autostart (gdm) on Ubuntu Karmic (9.10)"

Linux Upgrading to Ubuntu 9.10 Karmic Koala breaks X (xorg) on intel driver on 945G chipset

Posted by Admin • Monday, November 2. 2009 • Category: Linux

After upgrading my IBM desktop with "82945G/GZ Integrated Graphics Controller" X stopped working entirely, regardless of any changes to xorg.conf. Running startx manually revealed an error like this:



(EE) Failed to load module "i810" (module does not exist, 0)
(EE) open /dev/fb0: No such file or directory
(EE) intel(0): [drm] Failed to open DRM device for : No such file or directory
(EE) intel(0): Failed to become DRM master.



Took me a little while to figure out how to get me my machine back:

Continue reading "Upgrading to Ubuntu 9.10 Karmic Koala breaks X (xorg) on intel driver on 945G chipset"

Linux Backing Up Google Docs automatically from Linux

Posted by Admin • Monday, October 26. 2009 • Category: Linux

I'm not quite sure why a working example of doing this is so hard to find!

As far as I can tell, at the time of this writing there are two choices of ready-made (and free) apps that do this: GDocBackup and php-google-backup, a tiny php script (on google code) that uses Zend libraries. The former is a windows binary and is said to run in Mono. The latter is a php script which currently partially works (can't handle spreadsheets or PDF's). Not wanting to run Mono (an emulator - I might as well write this in Java), and not satisfied with only backing up .doc's and presentations... I hacked up my own.

Here is how I did it

Continue reading "Backing Up Google Docs automatically from Linux"

Linux Getting Pidgin to sign off when you lock your screen

Posted by Admin • Wednesday, October 14. 2009 • Category: Linux
I am signed in to google talk from many places - blackberry, laptops, desktops, etc - and every once in a while, IM's don't go to the right one. Since I lock my workstation at the office whenever I get up, I figured it'd be nice to have Pidgin log off at the same time.

I am not sure how you would do this in Windows, but in Linux (Ubuntu in my case), I did it like this:

Changed my screen lock hotkey (Ctrl-Alt-l for me) to run the following:
xlock -startCmd "purple-remote setstatus?status=offline" -endCmd "purple-remote setstatus?status=available"
That's it. If you want specific screensaver modes you can stick them in them too:
xlock -mode blank -startCmd "purple-remote setstatus?status=offline" -endCmd "purple-remote setstatus?status=available"

Update: July 2012


Ubuntu has a broken version of xlock (1:5.31-1) which gets the BadMatch (invalid parameter attributes) error. I switched to using slock from "suckless-tools" package, like so:
bash -c "purple-remote setstatus?status=offline ; slock ; purple-remote setstatus?status=available"

Interestingly, after running slock, xlock works too.. it's actually related to dpms: If you run xset +dpms, xlock will work (once).
You can adjust the xlock version for this bug as follows:
xlock -mode blank -startCmd "xset +dpms ; purple-remote setstatus?status=offline" -endCmd "purple-remote setstatus?status=available"


PS: Doing this in openbox:


<keybind key="C-A-l">
        <action name="Execute">
                <startupnotify><enabled>true</enabled><name>Run</name></startupnotify>
                <command>xlock -startCmd "purple-remote setstatus?status=offline" -endCmd "purple-remote setstatus?status=available"</command>
        </action>
</keybind>
 

Linux Fixing freezing and no sound youtube and flash on ubuntu

Posted by Admin • Monday, September 28. 2009 • Category: Linux

Problem:


I've had this issue for many months but obviously I don't use flash enough to really figure it out. The first few youtube videos would play, but with no sound. If you seek back and forth, or play sound from another player (eg audacious), you may get skipping sound for a little while. Eventually the whole player stops advancing, though you can still seek.

Solution:


<

ul>

  • You may have installed a dozen version of flash by now. As long as they are all ubuntu packages, you can leave them all installed (or you can remove them all)
  • Install the official release from adobe: Adobe Flash, current version is 10. Pick .deb format for the download.
  • Now run sudo update-alternatives --all
    ... This will ask you for all alternatives there are for your system, but among them there will be 5-10 flash-related questions for each browser (including text browsers, apparently). Pick the newly installed adobe-flashplugin like so:

      There are 2 alternatives which provide `mozilla-flashplugin'.
    
      Selection    Alternative
    -----------------------------------------------
    *+        1    /usr/lib/flashplugin-installer/libflashplayer.so
              2    /usr/lib/adobe-flashplugin/libflashplayer.so
    Press enter to keep the default[*], or type selection number: 2
    

  • Bounce Firefox and you should be all set
  • <

    ul>


    Software Mixing

    Once I got this fixed up, I now had reliable flash playback with one little problem... There was still no sound half the time - if another audio application grabbed my sound card before firefox (eg rhythmbox). Took me a while to figure out what to search for (usually the biggest issue, right?). Apparently the issue is twofold:

    1. My onboard sound card either doesn't do hardware mixing, or the drivers don't support that
    2. Alsa should have figured that out, and turned on Software Mixing, but for some reason it doesn't do that in Ubuntu

    Once I understood this, I used This page to help me out. Grabbed their ~/.asoundrc, restarted all the audio apps, and all seem to be sharing the sound card peacefully now.