June 2010
1 post
6 tags
How to destroy your database in two clicks using...
Open your database in Querious. Then: Click “Users.” Say to yourself, “I wonder what the button with two squares on it does.” Please don’t click the button. Because the instant you do, all of your rights are revoked and there is no way to recover them. I hope you have another admin login. Otherwise you’re screwed. Yes, I did this on an Amazon RDS instance. Thank goodness it was a test...
Jun 4th
1 note
March 2010
1 post
How to build the pscyopg2 Python PostgreSQL...
These instructions may work on earlier versions of OS X, but I’ve only tested on Snow Leopard. A common problem for Python programmers using Mac OS X is how to install psycopg2, the standard Python interface for PostgreSQL. If you Google for the instructions, you’ll get all kinds of advice, most of which involves using MacPorts or installing a complete server installation of PostgreSQL on your...
Mar 29th
1 note
December 2009
1 post
3 tags
Dec 9th
November 2009
1 post
5 tags
How to make an Intel wireless card connect to an...
With some notebooks (including a Lenovo Thinkpad and a recent Gateway model) we’ve had problems getting Wi-Fi connected to our Airport Extreme base station. In the past, we enabled both WPA and WPA2 on our base station and then manually set the laptops to use TKIP (WPA) mode (previous post describing how to do this). This worked until we decided to turn off WPA mode, supporting only WPA2, due to...
Nov 18th
August 2009
2 posts
5 tags
How to use bpython as your Django shell
$ DJANGO_SETTINGS_MODULE=settings bpython
Aug 25th
5 tags
Lenovo Thinkpad with Intel wireless won’t connect...
Update: This method is no longer recommended due to a recently-discovered vulnerability in WPA/TKIP. I found and blogged about a better solution here: How to make an Intel wireless card connect to an Apple Airport base station in WPA2 mode. We had a problem with a Lenovo Thinkpad T500 notebook that has Intel wireless networking built-in. It could not connect to our Airport Extreme wireless...
Aug 3rd
July 2009
1 post
7 tags
PHP sessions timeout too soon, no matter how you...
The scenario You’re running Debian Linux or Ubuntu Linux. You want PHP sessions to last longer than the default 1440 seconds (24 minutes). So you do this: ini_set('session.gc_maxlifetime', 10800); # 3 hours With this setting, sessions should remain active for at least three hours, as long as users don’t close their browser.1 But no matter what you do, sessions keep getting deleted after...
Jul 24th
November 2008
1 post
4 tags
How to get iChat video chat working behind a...
We couldn’t get iChat’s video chat feature to work behind our SonicWALL PRO 3060 firewall. Whenever someone tried to connect, iChat would say it “did not receive a response.” The solution was to enable the SonicWALL’s “consistent NAT” feature. To do this: Log in to the SonicWALL administrative web page. From the menu at the left side of the page, choose VoIP (which stands for...
Nov 4th
September 2008
1 post
4 tags
Microsoft Internet Authentication Service (IAS)...
Problem We use the Microsoft Internet Authentication Service (IAS) to provide RADIUS authentication for our wireless network. From time to time we would notice that IAS had stopped working on one of our servers. In Event Viewer, we would see the following error: “Service Control Manager, Event ID 7023: The Internet Authentication Service terminated with the following error: Only one usage...
Sep 18th
June 2008
2 posts
5 tags
My thoughts on Google App Engine
I recently tried Google App Engine. Pros and cons Pros The canned environment is really nice. It’s great to focus on development instead of setting up infrastructure. Love Python. Like the Django-based templating engine. Bandwidth allocation is reasonable for small- or medium-sized apps. The data store is great! Because it’s non-relational there’s no ORM layer to get in the way. Once...
Jun 24th
How to tell if a Mac OS X application is “Cocoa”...
There are two ways that software developers can create Macintosh applications — known as Carbon and Cocoa. As has been said many times before, it doesn’t really matter to users if an application is Carbon or Cocoa, although developers do tend to prefer one or the other when writing applications. A quick way to identify Carbon and Cocoa applications is to drag them to the bottom of the screen. ...
Jun 2nd
May 2008
2 posts
4 tags
Python PostgreSQL interfaces: pg8000 vs. psycopg2...
I have great hopes for the pg8000 project, which is a PostgreSQL interface written entirely in Python. The current standard in this category is something called psycopg2. It depends on libpq (the official PostgreSQL client library). While it works great, it can be difficult to get it running on some platforms (ahem, OS X), because you need to download all of PostgreSQL to get the client library....
May 21st
6 tags
When downloading an .EXE file in IE, it loses its...
Internet Explorer has odd behavior when downloading certain files. If you have an .exe file, but it’s served by a URL with a query string, IE will lose the file extension. An example might be easier to understand. Let’s say you’re using Amazon S3 to serve your downloads. You’ve got a file, myfile.exe, that your customer wants to download. Using S3 you generate a URL that allows them to...
May 5th
February 2008
2 posts
3 tags
How to get some HP network printers to work with...
Some HP network printers — such as the HP Color LaserJet 3600n and 3600dn — don’t have what Apple calls “modern” printer drivers. As a result, you may not be able to print over the network. This will happen if both of the following things are true: The printer doesn’t have a modern driver. You are not using Bonjour to print; for example, if you are on a different network subnet than the...
Feb 20th
-1 notes
2 tags
Engineers and early adopters vs. the customers
“We thought it was a mistake and made our engineers check the logs again,” said Vic Gundotra, head of Google’s mobile operations. Google receives 50 times as many searches from iPhone users than from any other mobile handset. It’s the very definition of usability: how many people actually use their phones to browse the web. Apparently only iPhone users. Products that are popular with engineers...
Feb 15th
-1 notes
January 2008
1 post
3 tags
Time Machine only runs if your MacBook is plugged...
Time Machine is a great feature of Apple’s computers. It backs up your Mac every hour, as long as you have a backup disk connected to the USB or Firewire port. Because it only needs to back up whatever changed in the last hour, it only takes a few seconds to do. But on my wife’s MacBook it was not doing automatic backups: The “Next Backup” field just contains two dashes. The solution was...
Jan 25th
-1 notes
November 2007
1 post
5 tags
Notes on using Cocoa-Python in Mac OS X Leopard
I’ve been looking at Leopard’s amazing new Cocoa-Python support. It uses PyObjC 2.0 to give Python programmers access to the Cocoa frameworks that Mac OS X is built on. Working from the Apple tutorial, which is based on an older version of PyObjC, I was able to build a working application. But I hit a few roadbumps and those are what I want to document here for other would-be Cocoa-Python...
Nov 7th
October 2007
3 posts
5 tags
How to make readline support work in IPython on...
Many Python programmers use the IPython shell for interactively testing their code. But if you recently upgraded to Mac OS X Leopard then you may have noticed that a key feature — tab-completion — doesn’t work. It doesn’t work because IPython uses the GNU Readline library, and Mac OS X doesn’t include that. Instead, OS X ships with a similar library called Editline. You can make IPython work...
Oct 30th
3 tags
How to fix an SSL certificate error in Exchange...
For the longest time I’ve had this error in Exchange System Manager when managing public folders: This can happen when using Outlook Web Access if your webmail URL doesn’t match the server’s internal name. Exchange System Manager expects your SSL certificate to match the server’s internal name. OWA users — including Windows Mobile devices — expect the certificate to match the server’s public...
Oct 21st
5 tags
How to make Safari work behind a SonicWALL...
Do you have a Mac behind a SonicWALL firewall? Do you find that some URLs (like certain pages at the New York Times) won’t load in Safari, but they work in Firefox? Is the problem worse when you’re behind a secondary router, such as a wireless router? If so, Edward Marczak of Tech Zendo has the solution for you. The basic solution is to access the SonicWALL’s hidden diagnostics page at...
Oct 8th
-1 notes
May 2007
1 post
2 tags
How to add the S&P 500 index to your Dashboard...
The Stocks Dashboard widget that comes with Mac OS X is nice, but it doesn’t display the S&P 500 index by default and there’s no easy way to guess the ticker symbol. To add the S&P 500 index to your Dashboard Stocks widget, use ticker symbol SPX.X. Update: For OS X Leopard, use the symbol ^GSPC. (Found on MacRumors Forums)
May 4th
-1 notes
March 2007
1 post
3 tags
How to configure a SonicWALL so you don't have to...
Here’s a problem I see sometimes: you’ve got a small LAN and a NAT firewall. Let’s say your web server is www.company.com with an IP address of 192.168.0.5. Via NAT it also has an external address of 3.3.2.5. You want the PCs on your LAN to be able to see www.company.com. When they resolve the name using DNS they get the external address 3.3.2.5. Unfortunately your firewall doesn’t let them...
Mar 21st
-1 notes
September 2006
1 post
4 tags
Fixing an Exchange Active Sync problem with the...
I usually don’t “do” Exchange, but a friend of mine found a solution for an odd problem he was having with his Audiovox XV6700 mobile phone. It would sync to the Exchange Server once in the morning, but for the rest of the day it would not sync again. He found this solution and, since we’ll probably need to do it again whenever Exchange is upgraded, I’m documenting it here. The problem was...
Sep 5th
-1 notes
August 2006
5 posts
2 tags
Announcing FourOneOne 1.0
I’ve put together my first Cocoa application. It’s called FourOneOne. Several years ago I found a small application called Code Finder (now discontinued) by Andrew Zamler-Carhart. I used it all the time to look up area codes, zip codes and airport codes. Like Code Finder, FourOneOne provides a quick way to look up area codes, zip codes, country codes and airport codes. It’s totally free....
Aug 30th
3 tags
Basic command-line compilation syntax for...
cc -lobjc -lc -framework Foundation *.m
Aug 29th
-1 notes
4 tags
Xcode won't build a universal binary for old...
If you have an old Xcode project (like one of Apple’s samples) you may want to build it as a universal binary that will run natively on either PowerPC or Intel architectures. To do this, you would double-click on the project name in Xcode, then choose the Build tab, and then highlight Architectures and click Edit. Then choose both i386 and ppc architectures. So far, so good: it looks like you...
Aug 27th
3 tags
How to make a responsive cancel button in an...
I’m new to AppleScript and AppleScript Studio and I wanted to make script that shows a simple dialog with a progress indicator and a cancel button. The script begins a lengthy process that can take 30-60 seconds. If the user clicks the cancel button it should terminate immediately. I found that the cancel button was unresponsive until the end of the script. The solution, weirdly, was to turn...
Aug 26th
-1 notes
5 tags
How to draw a rectangle or oval outline in...
This seems easy, but I always forget how to do it. Let’s say you have a picture and you want to highlight part of it by drawing a rectangle around one section. Like this: Here’s how to do it with Photoshop Elements: Choose the rectangular marquee tool (you can also use the elliptical marquee tool). Draw a rectangle around the area you want to highlight. From the Edit menu, choose...
Aug 15th
-1 notes
December 2005
1 post
3 tags
How to speed up ProFTPD logins
ProFTPD is installed on one of the servers that I use. When logging in I would notice a 10 second delay before it would connect. This can be fixed by adding the following lines to the /etc/proftpd.conf file: UseReverseDNS off IdentLookups off
Dec 31st
-1 notes