So you know how people say “Don’t try this at home?” Yeah. Don’t. HOWEVER: It’s pretty cool. Ariel Schlesinger replaced the compressed air canister of a hand-held air horn with a butane canister. [via Hack a Day]
Blog Archives
Kill Frozen Windows Apps Easily [Windows Tip]
If you've used Windows for any amount of time, you've already had to deal with the dreaded (Not Responding) frozen application—so instead of using task manager, why not create a shortcut to auto-kill them?
The HaxAttack weblog writes up a great tip to create a batch file that automatically kills any applications with a status of Not Responding, but you can actually just create a shortcut directly, omitting the batch file altogether.
To create your own quick-killing mechanism, just create a new shortcut anywhere, using this as the location:
taskkill.exe /f /fi “status eq not responding”
Once you are done, you can change the icon, or even assign a shortcut key in the properties dialog—just make sure the shortcut is on your desktop or in the start menu if you want the hotkey to work, since Windows hotkeys don't work in the Quick Launch. Thanks, Cyrus!
For more, check out how to kill runaway processes with Task Killer, previously mentioned ClickGone, or simply use the very powerful Process Explorer.
Browse The Best of Instructables for Free [DIY]
Instructables, the DIY project site you’ll often find linked here, is publishing The Best of Instructables Volume 1, highlighting some of its neatest projects. In true open-case form, they’ve linked every project in the book.
Spanning the distance from making a butter pen to building your own mini soldering kit in an Altoids tin, the compendium serves as a nice guide for anyone new to the site, or those who’ve felt overwhelmed browsing through the many enthusiastic, if sometimes similar, project guides on the jam-packed site. Buying a copy of the book wouldn’t hurt anybody, of course, but it’s pretty great that Make and its publishing partners are letting everyone see what’s between the covers from one page. Share your favorite Instructable in the comments.
Email Yourself Reminders From Launchy [Ubergeek]
Reader Ryan writes in with his ubergeeky method for sending emails to himself directly from Launchy—a very useful trick to quickly send yourself reminders.
To accomplish this hack, Ryan assembled a visual basic script (VBS) file that sends the email using Gmail's SMTP server—the email addresses are hard-coded but the subject line can be entered directly in Launchy.
If you want to use this trick for yourself, there's just a few steps to follow along—first, create a new *.vbs file and paste in the following contents, modifying the bold text with your own values.
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
schema = "http://schemas.microsoft.com/cdo/configuration/"
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "smtp.gmail.com"
Flds.Item(schema & "smtpserverport") = 465
Flds.Item(schema & "smtpauthenticate") = 1
Flds.Item(schema & "sendusername") = "MYACCOUNT"
Flds.Item(schema & "sendpassword") = "PASSWORD"
Flds.Item(schema & "smtpusessl") = 1
Flds.Update
With iMsg
.To = "EMAILADDRESS"
.From = "NAME <EMAIL>"
.Subject = wscript.arguments.item(0)
.HTMLBody = message
.Sender = " "
.Organization = " "
.ReplyTo = " "
Set .Configuration = iConf
SendEmailGmail = .Send
End With
set iMsg = nothing
set iConf = nothing
set Flds = nothing
Now that you have your script created and ready to go, open up Launchy’s Plugins tab in the options panel, and create a new Runner command pointing to the script. The key step here is to use "$$" in the arguments field—the quotes are important!

Since the example uses “tome” as the command, you can just type “tome” into Launchy, hit the tab key, and then type the subject of the email message. If all goes well, you should see a new email in your Gmail account with the same subject line.

This tip can be used for much more than just sending yourself emails, however—you can make a copy of the script and adjust the To field to quickly send emails to Remember the Milk or any number of other services that accept new items via email. You could even modify the script further to pass in further parameters to your RTM tasks if you really wanted to get geeky with it.Thanks, Ryan!
If you’d rather use your web browser, you can open a new Gmail compose window directly from Launchy. For more on Launchy power tips, read our feature on taking Launchy beyond application launching.
|
|
Free, unlimited IP address geolocation with MySQL
There are a lot of services and datasets that provide IP address geolocation, allowing you to detect a web user’s city of origin based on their incoming IP. Unfortunately, most of these services cost quite a bit of money, impose limits on how many lookups you can do over a period of time, or aren’t kept up to date with accurate information.
I came across a great resource today, put together by Marc-Andre Caron. He’s done all the necessary legwork to solve this problem, putting together a free, monthly-updated MySQL dataset that will allow you to derive country, region, city, zip, latitude, and longitude from an IP address.
The IP addresses are listed in table ip_group_city. The data is not in the 1.1.1.1 format since it would need to be stored as text and we dont want that for obvious reasons.
Let say for ip A.B.C.D, the formula is
ip = (A*256+B)*256+C
(I assume A.B.C.0 is at the same location than A.B.C.255)For example, if you have an ip of 74.125.45.100 (google.com)
The formula would give a result of :
ip = (74*256+125)*256+45 = 4881709You would search for the IP address using MySQL by doing :
SELECT * FROM `ip_group_city` where `ip_start` <= 4881709 order by ip_start desc limit 1;
Keep in mind that the accuracy of the data is usually down to the location of a user’s ISP. Don’t expect this to get you down to a street address, but if you want to display relevant content at a city, state, or country level, this will do the trick the vast majority of the time.
IP address geolocation SQL database
pngquant and pngnq – alpha PNG-8 images from the command-line

For a long time, I’ve been using Fireworks for the sole task of creating 8-bit PNG images that will display alpha transparency correctly in all modern browsers, while degrading gracefully to a GIF-like binary transparency on older browsers. The process works well, but it’s sort of crazy to keep a second image editing application around just to save one specific image format.
Thankfully, there’s a command line tool called pngquant that will convert any PNG-24 image into an alpha PNG-8. Web designer Ethan Gardner put together a decent howto that demonstrates how to use it along with Photoshop. You should be able to do the same with GIMP or your image editor of choice. Just save the original as a 24-bit PNG, then run pngquant 256 [filename.png] from the command line.
There’s a similar program called pngnq which uses a different technique for quantizing images (taking a 24-bit image and reducing it to 256 colors). I started using this a little while ago and I’ve been pretty happy with the quality of the images produced. Similar to pngquant, just type pngnq -n 256 [filename.png] at the command line to produce an 8-bit alpha PNG from the 24-bit version. I’d recommend installing both–just pick the one that produces the better output for a given image.
Alpha Transparency in PNG-8 Images Without Using Fireworks
pngquant
pngnq
HDFS and FUSE – a mountable distributed file system
The Hadoop Distributed File System (HDFS) is an open source, distributed file system that’s designed to run on commodity hardware and provide a fault tolerant data store optimized capable of storing extremely large files across many machines. It’s similar in architecture to the Google File System, except that it’s something you can install and play with yourself.
Most people who are using HDFS are using it as a storage system for extremely customized distributed application development and the HDFS data is accessed programatically via a Java API or through a few rudimentary shell commands. But what if you just want to use it as a general purpose file system that will automatically replicate many terabytes of data across a number of spare boxes hanging around the office? That’s where FUSE comes in.
These projects (enumerated below) allow HDFS to be mounted (on most flavors of Unix) as a standard file system using the mount command. Once mounted, the user can operate on an instance of hdfs using standard Unix utilities such as ‘ls’, ‘cd’, ‘cp’, ‘mkdir’, ‘find’, ‘grep’, or use standard Posix libraries like open, write, read, close from C, C++, Python, Ruby, Perl, Java, bash, etc.
There are currently a few HDFS FUSE projects, some of which seem to be more maintained than others. One, called fuse-j-hdfs, is written with the FUSE for Java library and seems to be the most active project. Outside of FUSE, there’s also a Webdav wrapper for HDFS that should provide mountable access from Windows clients.
Are there any HDFS gurus in the room who’d care to chime in with their own experiences with any of these tools?
Mountable HDFS Overview and Instructions
Hadoop Distributed File System
Run Silverlight Plug-In on Google Chrome [Google Chrome]
For those Google Chrome users who need access to one or two Silverlight sites, a Microsoft developer offers a file-tweaking work-around to get access to certain sites.
The Chrome/Silverlight hack requires grabbing a few .js files normally intended for Silverlight developers and tweaking them to have Silverlight sites accept and provide content to Chrome. By downloading the .js files and modifying them a bit, you should be able to access, as the developer rates it, “most” Silverlight apps, but your mileage will certainly vary.
Gain admin rights in OS X Leopard
It’s happened to me more than once that I’ve needed to configure something on a managed Mac laptop at work for which I have no admin access. Normally you can just track down your network administrator, but if it’s after hours or you are traveling, there’s another option: escalate your own account privileges by adding yourself to the admin group.
To add yourself to the admin group, you’ll need to reboot into single user mode and run a couple commands. Here’s how:
First, boot the machine and hold down Command-S until it boots into single user mode. Then, mount the hard disk in read-write mode (and check it for errors) with the following two commands:
/sbin/fsck -fy
/sbin/mount -uw /
We’ll be using the dscl command to add your username to the admin group, but first you need to start directory services or it will return an error:
launchctl load /System/Library/LaunchDaemons/com.apple.DirectoryServices.plist
To list the users in the admin group, use the following dscl command:
dscl . read groups/admin users
You won’t see your username, of course, because you aren’t an admin. To add yourself, run the following:
dscl . append groups/admin users yourusername
You can double check that your username is in the list now, then type reboot to restart the machine. When you log in, you’ll see that you’re now in the admin group, with permission to install apps or change any system settings.
