Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Low Tech Hacks Installing two cameras in one vehicle (rear view) with one display

Posted by Admin • Monday, July 27. 2009 • Category: Low Tech Hacks

Now that I acquired a travel trailer, it was a matter of utmost importance to install a rear view camera on it to ease the process of backing it up. I already have a rear view camera on my van, hooked up to my head unit which happens to have a rear camera input. So the next question is - how do I hook up two camera?



I don't want to give up the one I use all the time in favor of the occasionally used trailer cam. What am I to do? So I had to figure it out.

Continue reading "Installing two cameras in one vehicle (rear view) with one display"

Low Tech Hacks Changing Manual Transmission Fluid in a Scion tC

Posted by Admin • Saturday, April 11. 2009 • Category: Low Tech Hacks

The goal is to replace the stock (assumed: mineral oil) transmission fluid with Amsoil synthetic. Amsoil is my personal preference, while synthetic is my maintenance goal. I set out to do this as our vehicle was approaching 60K miles... OK so I meant to do this about 60K miles ago, but better late than never. The car is now 3 years old (exactly).



There isn't anything too difficult about this job, but when I got under the car I discovered a filler bolt labelled "Consult Owners Manual Before Refilling"... now I've done a fair share of work, but this looked suspicious. So I set out to investigate.

Continue reading "Changing Manual Transmission Fluid in a Scion tC"

Code and Hacks Creating A Basic Date Dimension Table in MySQL

Posted by Admin • Monday, March 23. 2009 • Category: Code and Hacks
After some searching I determined that nobody wants to share ...

So I had to sort it out myself - the result is a pretty basic stored procedure you can call whenever you like.

Continue reading "Creating A Basic Date Dimension Table in MySQL"

Code and Hacks Turning the Iphone 3G into an almost useful always-on IM device

Posted by Admin • Saturday, March 14. 2009 • Category: Code and Hacks

I've had a Blackberry for quite some time now, and came to take for granted the basic ability to be always available via Google Talk, Latitude, email, etc - not to mention have fine-grained control of when I get notified about each one. Running multiple apps (gtalk, maps, ssh, browsers, etc) - was never a problem, and there is even an Alt-Tab equivalent for toggling between running apps. Blackberry even has an integrated push-IM system for Blackberry to Blackberry communication.



All that changed with the IPhone (if it was not paid for, I would never have gotten one, but now I'm trying to make the most of it while saving the money I used to spend on the Blackberry). The IPhone (3G, 2.2.1) proved to be unable to do any of the above well. No mail alerting rules, no running multiple applications !!?? Basically this is an always-on device that cannot provide most always-on services. So this is my quest to make the device useful.



Yes naturally I realize that there are downsides to both devices, and I gladly give credit to the IPhone UI, but personally I'd rather deal with a command-line UI if I had to choose between functionality and having a fancy but incapable toy.

Continue reading "Turning the Iphone 3G into an almost useful always-on IM device"

Asterisk My Not So Great Experience with Grandstream HT-502 ATA

Posted by Admin • Friday, March 13. 2009 • Category: Asterisk

I got 3 of these Grandstream HT-502's for a client's Asterisk setup, and I picked Grandstream basically because they were cheap (client on a budget) and I found no bad reviews. They were ordered February 2009.



First impressions: They are tiny, like two EZ-Passes stacked on top of each other. They are cute, and have all the features you'd expect or even desire in such a device: Dual WAN (routed or bridged, with port forwarding), two FXS ports, some status LEDs, remote configuration and pull provisioning, syslog support, etc.



Well that was the good news...

Continue reading "My Not So Great Experience with Grandstream HT-502 ATA"

Code and Hacks MySQL Master-Master Replication over a Secure Stunnel Connection (SSL)

Posted by Admin • Saturday, February 7. 2009 • Category: Code and Hacks
I threw this together because I had to figure it out myself. I found info on how to setup master-master, and I found info on how to set up MySQL replication over stunnel. But master-master over stunnel turned out to be a little different. Not much, but here it is.

First of all - I won't go into the steps for setting up Master-Master itself - that's very well documented. Let's assume that you can convince one of your mysql's to slave off the other, and vice versa. (I used this page as a guide).

With that accomplished, let's assume that the boxes are not sitting next to each other but are in separate colo's or offices, and have some insecure internet to go between them (or maybe you don't even trust the local LAN). Yes, MySQL does have built-in SSL stuff, but so far the consensus is that it's rather difficult to work with. Moreover, I am more willing to trust stunnel (just my feeling on it).

Why not use ssh? Using something like ssh -n with a for loop that restarts it just doesn't sound enterprise-grade. I want something that actively reconnects when needed, based on active usage, and is actually intended for this. I still use SSH for port tunnelling all the time, but those are short-lived tunnels for my own personal use or debugging.

So our goals are: Secure transport and identity validation. Here we go.

Continue reading "MySQL Master-Master Replication over a Secure Stunnel Connection (SSL)"

Asterisk Data Warehousing and Metrics with Asterisk PBX

Posted by Admin • Sunday, February 1. 2009 • Category: Asterisk

An Asterisk installation I am doing for a client has the promise of two interesting developments in the near future:



  1. Writing a CDR/Voicemail status-tracking application that makes sure that all client voicemails are handled within one hour and keeps track of what was done
  2. A future custom metrics/data warehouse implementation that will use both the CDR and VoiceMail data


With that in mind (and the fact that I'm using Mysql master-master replication across offices) I looked into storing the voicemails in the database as well. This is fairly well-documented. I had this up and running in no time, and now for each voicemail I have a neat row in my MySQL table.



The problem is - how do I connect the row in CDR table to the matching voicemail row? There are no columns that have data to allow you to do match one to the other. Even timestamps, if you were so desperate, are not exactly the same! So this is how I did it.

Continue reading "Data Warehousing and Metrics with Asterisk PBX"

Low Tech Hacks Getting your refrigerator to run without a start relay while you wait for the part

Posted by Admin • Monday, January 19. 2009 • Category: Low Tech Hacks

It took me 24 hours to notice that my Maytag top-freezer refrigerator (PTB2454GR) stopped cooling. (OK the puddle on the floor helped me notice). When it started (Saturday morning, I think), there was a click, 10 seconds of buzzing, then silence. This would repeat every 2-3 minutes. I didn't think much of it, thinking it's the ice maker acting weird. What I should have noticed was the complete absence of compressor noise - just the fan. Actually, there wasn't even that noise - it was silent.

I eventually figured out that the start relay (if you can even call it that) needs replacement, but that was not the initial problem - the problem, as it turned out, was one packing peanut. Yeah, one peanut - it got stuck in the Condenser Fan, literally preventing it from running. This in turn probably caused ice buildup, or in some other way increased the compressor load, which in turn finished off the start relay. Frankly, I'm not sure how long the peanut was in there - may have been months, or maybe just a day.

So if you're seeing similar behaviour (see first paragraph), these are the steps to troubleshoot and temporarily remedy the situation (Disclaimer: there is a very good chance of electrocuting yourself in the process, as with any high voltage appliance). I have a little wiring diagram that explains what and why in here as well.

Continue reading "Getting your refrigerator to run without a start relay while you wait for the part"

Asterisk Teaching your Asterisk phone system to control your music

Posted by Admin • Saturday, January 17. 2009 • Category: Asterisk

Ever since I built my Asterisk-based VOIP phone system I've been finding more and more interesting ways to put it to work. I mean, it's a business phone server, but it's got plenty of resources as it sits around waiting for a phone call. So I figured... why not be able to pick up the nearest phone, dial an extension, and be able to stop/start/skip my whole-house music? How about doing this from anywhere? OK this may seem odd to you, but you'd be surprised how often it saves you from having to get up and go find the remote or having to wake up a computer :-). OK you're not convinced that this is very useful. How about pausing music for a phone call? Automatically?



For those who don't know, Asterisk is a open source (and free) software PBX system. You know, the thing that IP phones connect to (you know, that little box you got from Vonage - it connects to something - well in my house, it connects to my server). It provides call routing and management, voicemail, IVR (menus), etc. In short, it's awesome. I mean, yeah, it's a little unintuitive at first, but it's not that complicated once you loosen up your old fixed programmatic thinking a little :-)



So, here is the setup.

Continue reading "Teaching your Asterisk phone system to control your music"

Reviews Aliph Jawbone 2 overheats and nearly burns fingers, melts internally

Posted by Admin • Wednesday, January 14. 2009 • Category: Reviews

Got a shiny new Jawbone 2 from Buy.com the other day, and this is my experience with it over 2 weeks, ending in its eventual return. This also details my experience with Aliph Customer Service.



Initial pairing: I missed the "I am in pairing mode the first time I'm turned on" window, apparently - and getting it to go into pairing mode by holding the two buttons down took at least 20 tries. (seriously) In retrospect, I'm glad that it isn't so easy to put into pairing mode - I might do that inadvertently... But it worked, and boy did it work well. We tested it with a Shark cordless vacuum in hand, and the other person could only vaguely tell that there may be something making noise in the background. With NoiseAssasin disabled, you could hear the vacuum cleaner clearly instead of the person.



All was well, until...

Continue reading "Aliph Jawbone 2 overheats and nearly burns fingers, melts internally"

Low Tech Hacks Making a Folding Meditation Kneeling Bench

Posted by Admin • Tuesday, January 13. 2009 • Category: Low Tech Hacks
The bench

OK so this is pretty low-tech, but hey - why not? Kneeling benches are really unbeatable for meditation and prayer, but they are also great to just sit on - not only does it keep your back straight and prevents slouching, but it also places your feet right under you, so your weight distribution is optimal (and you don't fall). Sure, sitting like that can be tough at first, but it comes with practice. Plus, if you're intent on deep meditation, it is definitely worth getting used to.



I've made a non-folding bench before, and figured I'd try to make a portable one this time. I took what I learned from the last one and made some adjustments - I decided on a 10° angle this time. I also wanted it to fold and I didn't want the feet to protrude when folded. Here are the details.

Continue reading "Making a Folding Meditation Kneeling Bench"

Code and Hacks Nagios check_ntp quits working in 2009 with Offset unknown

Posted by Admin • Friday, January 2. 2009 • Category: Code and Hacks

I've been happily using nagios to monitor all my servers for quite some time, yet two days ago, suddenly, I started getting "Offset unknown" from my check_ntp check. Same from check_ntp_time. Then it was intermittent, service was flapping (going in and out of Unknown state). I messed around with ntp.conf and changed servers, restarted ntpd and then it stopped working across the board...



asterisk asterisk # /usr/nagios/libexec/check_ntp_time -H srv
NTP CRITICAL: Offset unknown|



The problem?

Apparently a leap year second is inserted periodically, and that's what was done on Dec 31 2008! Just one second, but enough to expose a bug in nagios-plugins-1.4.11

Continue reading "Nagios check_ntp quits working in 2009 with Offset unknown"

Hardware Hacks Replacing NiCd power tool batteries with RC LIPO's

Posted by Admin • Wednesday, December 31. 2008 • Category: Hardware Hacks
I have a Dewalt 18V cordless drill, which was very expensive ($200 back in 2001), came with two batteries (heavy, NiCd packs), and I've used it extensively for just about everything when we bought our house. Now both packs are dead. I do maintain them well, as nearly 7 years is much longer than their expected useful life. So I checked out the prices - and the packs are over $80 each! ... Seems a bit expensive for a bunch of NiCd's in a nice (tough, indestructible, convenient) plastic package. I looked at NiMh cells... but then using the original charger becomes questionable (probably cannot), plus the cost of 12 cells is almost $80 in itself - not to mention soldering 12 cells together, myself??? I don't think so....

Then I thought about LIPO cells... Let's see - 18V, that'd be a 5 cell (18.5V)... Well, for a test, I figured I'd try what I have around, and what I have around are 3 cell packs.

Continue reading "Replacing NiCd power tool batteries with RC LIPO's"

Reviews Vimeo vs Youtube for flight video

Posted by Admin • Wednesday, December 10. 2008 • Category: Reviews

A few months ago I posted my successful flight video recorded with on-board camcorder on my RC plane. I posted in youtube, because, well, that's what everyone does.


The video was an 160MB two-pass Xvid AVI, and once it made it through the youtube hamster wheels, it didn't look so good, especially while flying high over the tree-tops - they all meshed together into a mess of pixels. I complained, but resigned to my low-quality destiny.

Some time passed and it occurred to me to look into Vimeo.

Here are the results

Continue reading "Vimeo vs Youtube for flight video"