404 - Page Not Found

The page that you are looking for could not be found. I recently switched to a new content management platform so some of the old links no longer work. Below are the search results based on the link that you clicked on.

Asterisk on Ubuntu

Asterisk

I have recently had to setup an Asterisk server. I decided to use Ubuntu because I wanted to utilize the server for a few other low priority things. As I was setting up the server I noticed that it complained about not finding a custom sound that I had recorded.

[Oct 27 00:22:05] WARNING[4136]: file.c:653 ast_openstream_full: File custom/TestWelcome does not exist in any format
[Oct 27 00:22:05] WARNING[4136]: file.c:959 ast_streamfile: Unable to open custom/TestWelcome (format 0x4 (ulaw)): No such file or directory
[Oct 27 00:22:05] WARNING[4136]: pbx.c:9579 pbx_builtin_background: ast_streamfile failed on SIP/xxxxxxxxxxxx for custom/TestWelcome

After some troubleshooting I found out that the Ubuntu packages configured Asterisk to look in /usr/share/asterisk/sounds/ instead of /var/lib/asterisk/sounds/ where the custom sound was being saved to. A quick fix for this is to create a sym link.

ln -s /var/lib/asterisk/sounds/custom /usr/share/asterisk/sounds/custom

I think the correct way might be to edit astdatadir in /etc/asterisk/asterisk.conf, but that’s something that I still need to research.

Error installing “Windows 7 service pack 1”, code 80200053

Microsoft recently released the Service Pack 1 for Windows 7. When installing this through Windows Update it would keep failing and give me “code 80200053.” After looking around for a bit I found a solution that fixed this.

  1. Go to the Start menu and type “services.msc” and press enter.
  2. Find “Windows Update” service, right click on it and click “Restart.”
  3. Go to the Start menu and type “Windows Update” and try installing the service pack.

Low level hotkeys in MediaMonkey

MediaMonkey Logo

MediaMonkey (MM) is my music player of choice on Windows. I have a few global hotkeys setup (for instance WIN+ALT+B for next track), but after an upgrade a few months ago (probably starting with 3.0) I noticed that my shortcuts started sending the shortcut keys to the active applications. So, for instance, while in Outlook if I press WIN+ALT+B, MM will go to the next track, but in addition Outlook will switch views because ALT+B is a shortcut in Outlook.

After a quick post online I found the solution that I was looking for. Basically, I had to edit the MediaMonkey.ini and add “PreferLLKeysHook=1” to the “[options]” section. MediaMonkey.ini will be located in different places based on the operating system, you can find the details in this knowledge base article. Add “PreferLLKeysHook=1” to the “[options]” section in there and restart MM. From there on the shortcut keys will only be interpreted by MM and will not be forwarded to the active application.

Craigslist spam

A friend was recently looking for a used iPhone so we decided to browse the local craigslist. After some searching we saw an amazingly good deal (first red flag? :)) that included both an iPhone and iPod Touch from what seemed like a good seller. We decided to follow-up, but it wasn’t until 1am that we sent the contact email. Next day we got the following reply back…

sorry I sold them.. but I ordered them from suppliers I found from WEBSITE_REMOVED .. they have much cheaper prices than amazon.com

sorry again I hope I could have been of some help

kind regards,
steve

Sent from my iPhone.

I have removed the website URL (WEBSITE_REMOVED) because I don’t want to promote it any further 🙂 I was amused by this reply because it was sent around 3am (two hours after our inquiry) and it sounded a bit too much like an advertisement. Also, I get many emails from friends that have iPhones (some of whom have decided to keep that signature!) and that last line didn’t look right. So, I decided to look further into it. The obvious things to check were the email headers to see if they had any signs of an iPhone. Before I looked at the headers for the reply I checked out the headers from a genuine reply. The most obvious sign was the X-Mailer header.

X-Mailer: iPhone Mail (7A400)

Then I looked at this header in the reply from “steve,” and guess what I found.

X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)

A quick look at that site and I found out that Chilkat Software makes .NET libraries. Well, that, along with the bogus “Sent from my iPhone.” proves that this is definitely a scam. Another evidence is the peculiar timing of the reply (within 2 hours, at 3 in the morning!), but that can’t be used to prove 🙂 Also, it was the period at the end that isn’t part of the stock “Sent from my XYZ Device” message, subtle but noticeable.

So, stay away from “steve” and the site that “steve” is promoting because that is a scam. A quick search on google also reveals more bad experiences with that site.

Palm Pre after one month (review)

Last month after posting my thoughts about choosing my next smartphone I ended up switching to Sprint and went with the Palm Pre. It has been almost a month since then and now is a good time to put up a quick summary of my experience.

Windows cannot verify the digital signature for the drivers required…

I recently upgraded my main Windows Vista desktop to Windows 7 RTM. I chose to upgrade instead of doing a clean install because I had a lot of programs installed that I did not want to reinstall (too time consuming). The whole upgrade process wasn’t too bad, I had to uninstall a few programs and reinstall them after the upgrade. In addition to the uninstall/install, I encountered a few odd problems after the upgrade.

One of these problems was that my DVD drive disappeared. It wasn’t just the DVD drive, Daemon Tools’ virtual drive also wasn’t showing up. Looking at the devices in device manager I saw the following error.

Windows cannot verify the digital signature for the drivers required for this device. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source. (Code 52)

After searching online I found out that this had to do with some drivers that iTunes, Zune (!) and a few other programs had installed. Most of these programs are compatible with Windows 7, but the upgrade process didn’t deal with this case very well.

Anyways, if you search online you will find several solutions that require you to play around with the registry or have you install some random driver. Some even suggest disabling driver signing check. I didn’t prefer doing any of these.

After a little more search I ended up on this Microsoft Help and Support article. It described the exact problem that I was having and it had an automated fix. When I downloaded and ran the fix, it complained that it doesn’t work with my version of Windows. Knowing that the fix was compatible with Windows Vista, the workaround was simple:

  1. Right click on the MSI that you downloaded.
  2. Go to the Compatibility tab.
  3. Check “Run this program in compatibility mode for:”
  4. Verify that the drop down says “Previous version of Windows”
  5. Click OK to complete.

Now you should be able run the fix. Restart after the fix has installed and your drives should be back. Have fun!

gawk script for updating your models.py

Last evening I updated my django source to the latest SVN and found a surprise. The latest set of backwards incompatible changes were affecting my project. Specifically the new ModelAdmin moves were making things hard for me. Given that I have a few applications in django, I decided to write a script that would help speed up the process. What I ended up with was a simple gawk script that processes the models.py file and outputs the code for new ModelAdmin classes. I still have to manually remove the original admin classes because I didn’t want this to mess up things, but not having to look through the models and copy-pasting should save you some time.

For instance, if your models.py has three models-Tag, TaggedItem and NodeGroup-with Admin classes defined then this script will print out…

$ awk -f admin_model.awk models.py
class NodeGroupAdmin(admin.ModelAdmin):
                date_hierarchy = 'created_on'
                list_per_page = 25
                search_fields = ('title', )
                list_display_links = ('title',)
                list_display = ('id', 'title', 'created_on', 'updated_on', 'published', 'group_type',)
                list_filter = ('published','group_type',)
class TaggedItemAdmin(admin.ModelAdmin):
                pass
class TagAdmin(admin.ModelAdmin):
                pass
admin.site.register(Tag, TagAdmin)
admin.site.register(TaggedItem, TaggedItemAdmin)
admin.site.register(NodeGroup, NodeGroupAdmin)
$

I have added the usage instructions at the top of the script, and here is the script.

Getting psycopg2 to work in cygwin

A few months ago I tried to setup django with Postgresql in Windows through cygwin. Part of this setup included installing the pyscopg2 module for python. Interestingly everything would compile and install OK, but when it came time to import the module, python would complain that it couldn’t find a file, specifically _psycopg.

>>> import psycopg2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/site-packages/psycopg2/__init__.py", line 60, in <module>
    from _psycopg import BINARY, NUMBER, STRING, DATETIME, ROWID
ImportError: No such file or directory

At first I decided to let it slide and do away with cygwin and go the Windows python route for the normal development, and using my “500MHz overclocked to 555MHz linux machine” to do advanced stuff. Lately this solution has been painful because of the background jobs has a significant difference in processing time; by significant I mean 22 minutes vs 5 minutes! So, over the past few days I decided that I was going to find out the solution to this. I started my investigation the normal way, doing some research on my own, checking in the IRC channels for python, asking on the psycopg mailing list, but no luck!

Have you lost email on gmail?

2012-12-10, fa: If you experience any lost email, first make sure to go through this troubleshooting guide

Recently I have been thinking about consolidating all my email accounts into a single one because I would like to be able to check all my emails from any computer, and check it quickly. The obvious choice was gmail, but there was an interesting incident that happened about two weeks ago which has made me a little skeptical about gmail as a possible choice. I was sharing a desktop session with a friend who heavily uses the whole gmail suite (calendar, gmail, etc.) and interestingly majority of his email suddenly disappeared! One second the email was there, and the next second it was gone. He looked around in the trash, the spam folder, and every other corner where it could have gone, but it was nowhere to be found. This was all happening in front of me… We searched on google groups for gmail and found numerous threads about lost email.

Thinking about it, I am wondering how many folks had this issue, but decided not to post on google groups (time is important). Have you had this issue? I am aware of a similar incident that was brought up about a year ago, and I am wondering if this is another wave, and in the end, whether gmail is reliable. Are you aware of any better alternatives? (Ideally free)

As with anything important, I am also researching my options of backing up my gmail account.

Ordering Django querysets by custom SQL based columns

As I was working on my website in Django I had a need for ordering a model based queryset on a custom SQL. Searching around the net I found this entry in the Django user group, but according that entry I have to create a suclass of the queryset and then a manager, in addition to other things. I didn’t like that solution so I continued looking around and finally came up with one that I think is cool and accomplishes the goal. Basically, we have to use the extra() method to create a new column based on custom SQL and then use that in the order by clause.

1
2
comments = Comment.objects.filter(node__id=node.id).extra(
  select={'thread_order': "SUBSTR(thread, 1, LENGTH(thread)-1)"}).order_by('thread_order')

In this case I needed to exclude the last character of the ‘thread’ column, and that’s what the SUBSTR does. So, there you have it, a quick way to order model querysets by custom SQL.