Akom's Tech Ruminations

Various tech outbursts - code and solutions to practical problems

Linux Autodesk Maya 2012 in Virtualbox

Posted by Admin • Wednesday, February 22. 2012 • Category: Linux
Maya does not appear to have a Linux version, so where I have a single machine, I want to run it in VirtualBox - in either Windows XP or Windows 7. I've successfully installed it in both, 32 and 64 bit, and it installs and starts up just fine. The fun comes later. There are two serious problems:
  1. Alt+Mouse doesn't work. Well, this has to do with my window manager more than anything - Alt+Mouse is usually used in Linux. I'm not willing to change that - but fortunately, Alt-Shift+Mouse does something fairly similar in Maya
  2. 3D repainting is completely messed up. In fact, there are two things that don't work immediately - selection on the 3d pane (pointer appears to be below the screen) and the Spacebar popup menu (also below the screen). Fortunately, this can be fixed with a bit of sacrifice: turn off 3d (I turned off 3d and 2d) acceleration in Virtualbox settings.

  3. And it works! (not horribly slow either)

Linux Using dual widescreen monitors on old hardware with Ubuntu

Posted by Admin • Tuesday, February 21. 2012 • Category: Linux
My primary development machine is probably 10 years old - it's a Thinkpad T42 in a docking station (Dock II). This is fine - it's fast enough for most purposes, it runs dual monitors, and it uses very little power so I can leave it on at all times.

Not so fine once I got a 24" monitor to go with the standard 20".

First, the DVI hardware in the docking station can't handle high resolutions - it worked fine at 1280x1024, but not so great at 1920x1080. That's OK, I can drive the widescreen with VGA, I can't tell the difference. But now everything on the screen repaints very, very slowly - I mean really slowly - 1/2 a frame per second. This is bad. OK so the video chip in the laptop wasn't intended to drive a combined 3200 x 1080 resolution - but what can I do about it?

Continue reading "Using dual widescreen monitors on old hardware with Ubuntu"

Hardware Hacks Upgrading Dell laptop memory and the blinking CAPS LOCK led

Posted by Admin • Wednesday, January 18. 2012 • Category: Hardware Hacks
Apparently if you have the power-on self-tests set to "Minimal" or "Fast" or anything besides the "Let's check everything for 5 minutes every time the machine boots", you'll have a brick with a blinking CAPS lock instead of a laptop once you upgrade memory.

The only way I found to fix this (other than clearing the BIOS) was to put the old memory back in, go into BIOS, and enable thorough self-test. With that on, the laptop notices the memory size change and does not freak out - merely tells you about it. Once you're done you can disable the self-tests.

(I experienced this on a Dell Precision M4400, but googling seems to indicate that this affects the Inspiron and Latitude lines as well, probably others).

Asterisk Getting Meetme to work in Asterisk 1.6 on Ubuntu Lucid

Posted by Admin • Tuesday, November 15. 2011 • Category: Asterisk
I'm assuming that you are attempting to use the Meetme() application and getting an error like this:
WARNING[10695]: app_meetme.c:1097 build_conf: Unable to open pseudo device
It's rather simple:
$ apt-get install dahdi dahdi-dkms dahdi-linux  #I think dahdi may be enough
$ echo dahdi_dummy >> /etc/modules
$ modprobe dadhi_dummy
$ ls -l /dev/dahdi/pseudo
crw-rw---- 1 root dialout 196, 255 2011-11-15 11:26 /dev/dahdi/pseudo
$ id asterisk
(Should include 'dialout' group)

Yay! Apparently in Asterisk 1.6 the timing source for the Meetme application is no longer ztdummy (fortunately I was unable to use m-a to compile zaptel) but rather relies on DAHDI, not only for timing but for conference mixing - see http://www.russellbryant.net/blog/2008/06/16/asterisk-16-now-with-a-new-timing-api/

Asterisk CDR records 's' for DST when Dialing from Macros

Posted by Admin • Friday, July 22. 2011
At some point in the Asterisk 1.6 evolution the CDR records stopped being useful in my setup for outgoing calls - instead of a nice number (eg 18005551212) in the dst field of the record, I now have an s. I log my CDR to MySQL and I do use a macro (with AEL) to dialout. My macro is even called dialout.

According to this bug, this is a known issue and no immediate fix is expected. Not wanting to rewrite the CDR UI to use yet another column, I figured that I can fix this with a MySQL trigger, so here is one possible workaround.

Continue reading "Asterisk CDR records 's' for DST when Dialing from Macros"

Linux Figuring out the card number of a cheap SAA7130 capture card

Posted by Admin • Sunday, June 19. 2011 • Category: Linux
So you bought yourself a cheap Philips SAA7130 (or SAA713X or SAA7134) capture card to record motion, you plugged it in and you are getting a black or grey screen. Looking in dmesg you see the famous saa7134[0]: Huh, no eeprom present (err=-5)? And
saa7134: Congratulations! Your TV card vendor saved a few saa7134: cents for a eeprom, thus your pci board has no saa7134: subsystem ID and I can't identify it automatically saa7134: I feel better now. Ok, here are the good news: saa7134: You can use the card= insmod option to specify saa7134: which board do you have. The list:
What do you do? How do you try 175 card numbers and figure out which one works? Write a script!

Continue reading "Figuring out the card number of a cheap SAA7130 capture card"

Code and Hacks Migrating one Gmail account to another

Posted by Admin • Friday, May 13. 2011 • Category: Code and Hacks
I have a setup where a Google Apps Premier account is used for the active employees, but when they quit I want to archive all their mail but free up a paid user account for the next employee. We archive mail in a different domain, also on google apps - a standard edition, free. For a while now I've gone through a variety of ways of copying the mailboxes from one place to the other, and each approach was either partial, unreliable, or too time-consuming.

So I think I've finally settled on a viable approach that is neither.

Continue reading "Migrating one Gmail account to another"

Hardware Hacks Setting the date/time on the Mini Keychain Spy Camcorder

Posted by Admin • Monday, April 25. 2011 • Category: Hardware Hacks
Keychain Camcorder
The instructions that come with this little gadget are priceless in their verbatim Chinese glory, but are not helpful in their vague "Leave the details as an exercise for the reader" approach.

Here are the exact detailed steps to actually set the clock

Continue reading "Setting the date/time on the Mini Keychain Spy Camcorder"

Linux Backing up cPanel without hitting logout

Posted by Admin • Thursday, April 21. 2011 • Category: Linux
cPanel based hosting presents some challenges for automatic backups - there isn't an automatic way of creating local backups or any standard way of triggering their creation remotely. Numerous scripts exist yet none were quite the solution I was looking for - I am primarily interested in the databases and mail forwarders, though files wouldn't hurt either. Moreover - you can do this in a single line!

My Goal therefore is: Create and retrieve backups nightly. I don't want cPanel to push files to my off-site box, I'd rather initiate everything remotely and not have to open up access to some other system. cPanel does permit one to do this using a browser, hence it can be scripted. Really, scripting isn't even necessary - wget is all that is required! That said, I had a very hard time convincing wget not to visit the logout link on each page - once you log out, you're not getting anywhere anymore. So here is how I did it.

Continue reading "Backing up cPanel without hitting logout"

Linux MySQL replication dies with fatal error 1236: Client requested master to start replication from impossible position

Posted by Admin • Friday, February 4. 2011 • Category: Linux
This time, my master-master setup stopped replicating with no explanation at all - running START SLAVE yielded no warnings or errors. Inspecting the log yielded the aforementioned error (on Ubuntu, mysql logs to /var/log/syslog by default):
[ERROR] Error reading packet from server: Client requested master to start replication from impossible position ( server_errno=1236) [ERROR] Got fatal error 1236: 'Client requested master to start replication from impossible position' from master when reading data from binary log [4654]: 110204 10:09:20 [Note] Slave I/O thread exiting, read up to log 'mysqld-bin.000742', position 4274

So at first I thought this was a weird bug or a stunnel issue, but looking at 'mysqld-bin.000742' on the master it turns out that it's only 3980 bytes - position 4274 is indeed impossible. But how did it get this way?

Continue reading "MySQL replication dies with fatal error 1236: Client requested master to start replication from impossible position"

Code and Hacks The Eclipse, PDT and Smarty dance

Posted by Admin • Monday, January 24. 2011 • Category: Code and Hacks
Eclipse is a great developer tool, and I use mine for Java, PHP, and C++. It actually does all of the above really well, but when it comes to Smarty template Syntax Highlighting, it's a tale of much suffering. I honestly am not even asking for any Smarty auto-completion - just pretty colors that tell me when I'm fat-fingering the syntax.

Fortunately there is a solution that appears to work, and here is the currently valid step-by-step

Continue reading "The Eclipse, PDT and Smarty dance"

Linux Simple flat file site search in PHP/Smarty

Posted by Admin • Wednesday, January 19. 2011 • Category: Linux
Sometimes using a real search implementation (Lucene, Sphinx) is just too much. The particular site I was working on is something like 30 pages, it's maintained as flat files (Smarty templates, but it's basically HTML on disk), and it really, really should not require megabytes of code and cron jobs to be able to search it!

That said, this is a simple search solution - it makes a lot of assumptions:

Continue reading "Simple flat file site search in PHP/Smarty"

Linux Predictable ALSA numbering of USB sound cards

Posted by Admin • Wednesday, January 12. 2011 • Category: Linux
I have 3 rather cute Monoprice usb sound cards for use by mmpd (client I wrote for multiple mpd instances). The great thing about them is that for $9 you can just keep adding zones to your music systems. The bad news is, UDEV will reorder sound cards on boot as it pleases.

Zones changing would be survivable in itself (reboots are rare), but I also have a webcam and an onboard sound card that I don't use - so sometimes the numbers I've configured mpd to use aren't even valid sound cards! On to the continuing search for a working solution

Continue reading "Predictable ALSA numbering of USB sound cards"

Linux Fixing digitemp with LinkUSB on kernels after 2.6.32-24

Posted by Admin • Tuesday, January 11. 2011 • Category: Linux
As many people have discovered, kernels after 2.6.32-24 changed the USB-RS232 serial driver to not set hardware flow control (RTS/DTS) flags. No doubt there was a good reason. Unfortunately, digitemp and owfs don't enable it either, also probably for a good reason - at least when applied to older devices. What this means is that now when you try to use a LinkUSB (and probably other DS9097U type hardware behind USB to Serial converters), digitemp and owfs no longer work.

Let's apply a time-tested hackish approach.

Continue reading "Fixing digitemp with LinkUSB on kernels after 2.6.32-24"

Linux How to take down your pfSense firewall with one checkbox

Posted by Admin • Saturday, January 1. 2011 • Category: Linux
Simple: create a Traffic Shaper queue but forget to choose a queue parent.

Your firewall will not pass any packets across, and you'll have no idea what hit you.