Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Low Tech Hacks Snowblower oil change with no mess

Posted by Admin • Sunday, March 21. 2010 • Category: Low Tech Hacks
Like most dutiful snowblower owners I change the oil in the spring. The manual says to change it every 25 hours - I don't put that many hours on the engine in a year but the oil probably shouldn't be kept in there that long.

The first year I did the oil change I wound up with a 4 foot oil puddle on my garage floor. Like most small snowblowers, mine has an extension oil drain pipe with a cap. You're supposed to unscrew the cap and drain the oil into something. Well, mine unscrewed at the base - the whole pipe came out, pouring oil down the machine's body and causing me to bring shovelfuls of sand in to clean up the mess. But, there is a better way. (And this is my notepad for next year)

Continue reading "Snowblower oil change with no mess"

Linux Postfix satelite mail configuration with special needs

Posted by Admin • Monday, February 15. 2010 • Category: Linux
OK so I have special needs. (Either that or I am just oblivious to a working example of this).

My needs are:
  1. Do not receive inbound mail
  2. Do not deliver mail locally at all
  3. Send all outbound mail through an upstream relay (ISP's smtp)
  4. Qualify local addresses with a valid domain name (ISP's smtp will reject invalid domains)
  5. Map some local addresses to convenient aliases (distribution lists in the real mail system - google apps in this case)


Doesn't seem so hard, right? So I started with the postfix "Satelite System" option in ubuntu installer, and then...

Continue reading "Postfix satelite mail configuration with special needs"

Linux Software RAID in Ubuntu Karmic 9.10

Posted by Admin • Monday, February 15. 2010 • Category: Linux
I am writing this down because it was somewhat hard to figure out how much of the HOWTO's out there are out of date. This is not particularly difficult, but it's my first RAID setup and this blog is my notepad. I am setting up a RAID1 on a Dell Precision 490 with two brand new 500GB SATA drives.

First I tried using BIOS RAID. My system doesn't have a true RAID controller card and after some trial,error and googling I decided to forget it and go with an industrty standard (MD) Linux software RAID. I reset my drives to non-raid in the BIOS, popped in Ubuntu server x64 CD and went on ahead.

Continue reading "Software RAID in Ubuntu Karmic 9.10 "

Linux MySQL replication dies with ERROR 1201 (HY000): Could not initialize master info structure

Posted by Admin • Friday, February 12. 2010 • Category: Linux
On a fine happy morning I am greeted with an alert that slave is not running. Running start slave yields this:
ERROR 1201 (HY000): Could not initialize master info structure; more error messages can be found in the MySQL error log
Enabling the log yielded nothing. Googling yielded This Page that helped me a lot, but I didn't have to do quite as much work all over again. Here is what I did.

Continue reading "MySQL replication dies with ERROR 1201 (HY000): Could not initialize master info structure"

Code and Hacks Splitting a large image to print on multiple sheets

Posted by Admin • Wednesday, December 23. 2009 • Category: Code and Hacks
This really seems like such a simple task, doesn't it? All I wanted was to print a large (48 megapixel) raytraced image I generated onto several pages, and then tape them together to make a poster.

In my efforts to find a convenient tool to do this, I've attempted the following:
  • Kinko's: (or any neighborhood print shop). I am listing this option because it eliminates the need to do this altogether - they can print an image on a huge poster all at once. This 'should' work, and is probably the best but most expensive option. In my experience, Kinko (Fedex) simply could not receive the image, perhaps they can't handle large uploads.
  • Online Printers: You are probably seeing some options in the google ads on this page already. Of course, I wanted it right now, so that was not an option
  • Rasterbator: A great tool, but not what I need. It creates nice looking multi-page PDF's from low-res images by using the old school newspaper graphic dot approach.
  • Adobe Illustrator (CS3): It seems to have a "print on multiple pages" option in the print dialog, but I've tried every single setting, and it always loses about a 1/4" off the sides, making them un-stitchable. Maybe I'm just Adobe-dumb. Illustrator also insisted that I trust it to manage the print colors rather than trust my printer (a solid-ink Phaser), and the printouts came out practically all brown until I told it to trust the printer. It easily wasted $30 of solid ink before I gave up on Illustrator
  • Photoshop: It can be done. Easiest way is to add guides (view menu) using percentages (eg 50%, 25%, as needed), then select the area between guides (snaps to guides), and copy into new images. This is labor intensive, but if you're careful with mouse movement you should get the right pieces. If you're printing on a small quantity of sheets, this is the best option probably. You can also paste each copied sliver into the same second image - you will then retain any options you've set for that document (such as layout, color quality, etc). Maybe there is a plugin for photoshop that does this automatically?
  • Gimp: Apparently there is a poster plugin of some sort, but in my haste to get this out the door I didn't have the time to understand how to install/compile/use Gimp plugins
  • ImageMagick: This is what I ultimately used. Being a command-line tool it doesn't have a nice visual "layout and split" interface. But what it does have to offer is reliable operation, unix style - one thing, done right. Read more for details on how, below.
  • PDF: What I have not tried is to use the ImageMagick approach above, then auto-convert each image into a PDF and stitch them into one document so they can be printed all at once. I'm not sure if this can be done (easily). If I have to do this again, I'll look into this. (Update: This is no longer necessary, see Geeqie note below)

Continue reading "Splitting a large image to print on multiple sheets"

Hardware Hacks D945GCLF fan issues and alternatives

Posted by Admin • Saturday, December 12. 2009 • Category: Hardware Hacks
I've had my D945GCLF (the Intel Atom 230 board) up for 440 days. That's an impressive uptime until you realize that it's a Gentoo box running asterisk, mpd, and not much else. As anyone familiar with D945GCLF or D945GCLF2 knows, the northbridge has an aluminum heatsink with a 40mm fan. Most people have had theirs fail right away, but I was lucky enough to have mine last over a year before starting to vibrate and slow down. Once I started getting Nagios alerts about high temps, it was time to do something.

I never liked the idea of small fans. A 40mm sleeve bearing wonder is certainly no exception. When it comes to cooling, I always look for big and slow - and that in my book means 120mm running at 7V speeds. I looked for a replacement fanless heatsink but couldn't find one that was reported to fit. Here is what I did:

Continue reading "D945GCLF fan issues and alternatives"

Code and Hacks Upgrading Belkin F5D7231-4 v2000 router to dd-wrt firmware

Posted by Admin • Monday, November 23. 2009 • Category: Code and Hacks
As the dd-wrt hardware database claims that this router is supported, I was happy to attempt this installation. Only the micro edition will fit on its tiny 2MB of flash. The dd-wrt page suggests that only tftp flash procedure will work, and so I grabbed their tftp.exe - to no avail. This router seems to have a lot of upgrading threads dedicated to it, but most of the How-To's I was able to find did not work for me. Some said that in order to get the firmware to load on this device you need to catch the perfect second during its reset cycle where the ping TTL's (you have to ping it) are 100, and launch the tftp upload at that exact time. I was never able to achieve any part of this.

Fortunately after nearly giving up I found this thread which offers alternate (windows only) utility called "Sercomm" to load an alternate (I'm honestly not sure where it came from) .bin image onto the router - I can only assume that it's the dd-wrt image converted to sercomm format. The image you get from dd-wrt will not work with this loader. I loaded this yesterday (2009/11/22) and got the latest (dd-wrt v24 SP2) on my router, and it even works great (so far).

That said, there is one caveat to the instructions provided in the Readme.txt file: I first loaded the dd-wrt image (two are provided: dd-wrt and original Belkin), and the router failed to reboot or respond. I then loaded the Belkin image, it worked correctly as per instructions. Then I was able to load the dd-wrt image successfully. Naturally the IP address changed to 192.168.1.1 instead of 192.168.2.1

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:


  • 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

    • 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.

Code and Hacks Locked myself out of pfSense

Posted by Admin • Saturday, September 26. 2009 • Category: Code and Hacks
I was experimenting a bit with pfSense 1.2.3rc1 as a replacement for a WRT54G router today.
So I set did the following, among many things:
  1. Switched web configurator to SSL (443)
  2. Turned on reflection (applies NAT port forwarding rules to local LAN)
  3. Set up NAT port forwarding, which includes port 443 to one of my servers (which isn't up at the moment)


Guess what? Can't access webconfigurator.... an hour of being very confused later... I get it. All my SSL requests for webconfigurator are now being sent to the nonexistent internal NAT-ed server! I can't get back in, and reboots don't help!

Fixing this is not too hard. Log in (SSH or console) and edit /conf/config.xml
<webgui>
    <protocol>https</protocol>

Now just change to http. (If you're not running off hard drive, you may need to save directly to your floppy.) Obviously changing this will prevent you from using reflection from a NAT-ed server on port 80 now :-)

NOTE: you may need to "rm /tmp/config.cache" to clear out config cache, and restart web configurator from the menu.

Reviews The Valor ITS-301D DVD/CD/MP3/MP4/etc car head unit

Posted by Admin • Tuesday, September 8. 2009 • Category: Reviews
I recently bought a truck to replace the conversion van as a tow vehicle, and decided not to move the Innovatek head unit from the van to save myself some hassle. This gave me an opportunity to try out a new device as I was somewhat frustrated with the Innovatek (see review). I was looking for basically the same exact thing, but one that worked, well, better. Oh and of course having a TV tuner is no longer of any value.

I can spoil the suspense by saying that the Valor ITS-301D proved to be an improvement and I have only positive things to say about it. Some details:

Continue reading "The Valor ITS-301D DVD/CD/MP3/MP4/etc car head unit"

RV Getting RV Solar and Shore power to coexist nicely

Posted by Admin • Tuesday, August 4. 2009 • Category: RV
I have an RV (20' Sunline T1950 travel trailer) Yay! Like most, it came with a tiny battery (23Ah @2.5hour rate??) and a Power Converter (Centurion 3000) which doubles as a battery charger, but it's hardly a good one - it's not even a 1-stage (that would be just bulk charge) - instead it is a float-only 13.1V power supply. Charging a sizeable battery using a float charger would take a very, very long time (and is hardly good for the battery). According to documentation it's supposed to output 13.4V but I guess it's +/- 0.5V :-)

My primary interest is in boondocking (dry camping) so for me battery performance is of utmost importance. This means good battery utilization, and good battery charging when charging can occur. Stock, the RV does neither.

First thing I managed to do was to secure a small solar system including a Solar Charge Controller (got an awesome deal on Craigslist). It's 100 watts and the CC is a 2 stage (absorption and pulse-float), 15 Amp unit (Mark PV 15). My first question was of course... how do I hook it up to the existing electrical system without causing problems?

Continue reading "Getting RV Solar and Shore power to coexist nicely"