CARVIEW |
Archive: hacks
February 28, 2009
jsSO: Flash shared objects in Javascript

Without polling the server, an expensive operation, there isn't a simple way send a Javascript client frequently updated server data. This is a problem if you want to make a multiuser game or chat application in Javascript. A post on ajaxian proposes a solution: Daniel Prieler's jsSO library, which proxies real time communication between Javascript clients through Flash and an RTMP server:
The data-transfer and the connection to the server are maintained by a simple embedded Flashmovie in your page. The communication with other clients runs through the local Flashmovie and the Red5-Server.
The data-flow between two clients looks like this:Javascript/jsSO <-> Flashmovie <-> Red5-Server <-> Flashmovie <-> Javascript/jsSO
Red5, by the way, is an open source implementation of Adobe's Flash Server. It can be used to stream or record video, or provide low latency, event-based communication via remote shared objects.
Fast multiplayer Javascript games, here we come.
jsSO - Flash Shared Objects in Javascript [via ajaxian]
Red5
Posted by Jason Striegel |
Feb 28, 2009 03:00 AM
hacks |
Permalink
| Comments (1)
| Email Entry
February 27, 2009
Convert a 300 watt torchiere lamp to a 20-40 watt CFL

The torchiere lamp does a really nice job of lighting a room, but with a blazing hot 300 watt halogen bulb they've also had a nasty track record for igniting rooms. Ten years ago, these were a required addition to any dorm room or apartment that lacked overhead lighting--the bright upward facing light bounces off the upper walls and ceiling to create a soft blanket of light from above. With their massive energy use and dangerous reputation, however, the torchiere is no longer a very popular lighting option.
Instructables user bben46 took to solving this problem, creating a cool-running, energy efficient, compact fluorescent version of the torchiere:
I converted my 300 Watt lamp to an energy efficient and cool 20 Watt CFL type bulb for less than $10 in parts.This modification results in a savings of 280 Watts. With the addition of the second 20 watt CFL, the savings comes down to only 260 Watts.
Keep in mind that the color spectrum of the CFL is pretty different from the halogen bulbs, but the conversion is a simple wiring job and the result is a safe and cheap way to light a room from above.
Show of hands. How many of you have one of these stored away in the basement just waiting for a CFL conversion?
Convert a 300 Watt Torchiere Lamp into a Dual 20 Watt CFL
Posted by Jason Striegel |
Feb 27, 2009 03:00 AM
hacks |
Permalink
| Comments (5)
| Email Entry
February 26, 2009
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
Posted by Jason Striegel |
Feb 26, 2009 03:00 AM
hacks |
Permalink
| Comments (1)
| Email Entry
February 25, 2009
Safari 4 beta and Safari 3 on the same machine

The Safari 4 beta looks pretty slick, but what do you do if you aren't quite ready to give up your trusted browsing companion? Neil Lee has the solution for running both Safari 3 and the new version 4 beta on the same Mac:
Apple dropped the first public beta release of Safari 4 today, and installing it overwrites the old version of Safari as well as the system Webkit frameworks. This means it's not possible to run the current Safari 3 release and the beta on the same system. That is, not possible without some fiddling.
Here's a quick how-to get both Safari 3 and 4 beta running on the same system. You will need to use the terminal for part of this, and we will download an older copy of Webkit, which is Apple's development builds of Safari.
This is a pretty big deal for me, since I'll need to start testing sites I develop in both versions of Safari. I already need to run a few virtual machines to test applications under different versions of IE and Flash, so it's sort of a relief that the Safari versions will work out side-by-side on the same box.
How to run Safari 4 beta and Safari 3 on the same mac
Posted by Jason Striegel |
Feb 25, 2009 03:00 AM
hacks |
Permalink
| Comments (0)
| Email Entry
February 24, 2009
The ol' Blue Boxing. Good times, good times.

For many of us first-gen hacker types (yes, I'm that old. Shut up.), blue boxing was our introduction to hardware hacking. It was never the illegal, rip-off aspects for me, it was proving that you could build something that exploited a vulnerability in a system; to trick it to do something it wasn't intended to do (the very definition of hacking). In fact, I owe much of my career in tech journalism to phone phreaking. It was a phreak box project in a zine in the mid-90s that inspired me to create my site Street Tech, to cover the burgeoning hardware hacking/DIY electronics scene.
So, I got a huge kick out of seeing this Project MF Blue Box project. It's a site with instructions for creating a classic Blue Box. What good does such an analog phone hacking technology do you in the digital age? Not much (except the box tones are fun to record, store, and play back), unless you call the Project MF server, where they've set up a working simulation of the analog SF/MF signaling used in the public switched telephone networks before the early '90s. Tres retro!
I'm tempted to build this awesome box. It's based on the infamous Blue Box depicted in in 1971 Esquire article on phreaking. This modern version is built around the PIC 12F683 MCU. The folks from Project MF Blue Box gave out free PCBs for this project at Last HOPE, so you may already have the board. They're also selling boards and pre-programmed chips. See the site for details.
Posted by Gareth Branwyn |
Feb 24, 2009 02:00 PM
hacks, Retro, Telecommunications |
Permalink
| Comments (7)
| Email Entry
Projective transformation and perspective in Javascript

Javascript only supports affine transformations in the Canvas element. In plain English, this means you have control over simple transformations like rotation, scale, and skew. Rendering something with perspective, however, involves a projective transformation and there are no 3D transformation operations within the official Canvas spec to support this sort of thing.
Steven Wittens hacked some code to bypass this limitation and approximate projection transformations. It works by chopping up the source image into several pieces and applying affine transformations to each of the pieces to approximate their projected size and position. If the slices are small enough, it's barely noticeable.
Perspective views are described by so-called projective transforms, which Canvas2D does not support. However, it does support arbitrary clipping masks as well as affine transforms of both entire and partial images. These can be used to do a fake projective transform: you cut up your textured surface into a bunch of smaller patches (which are almost-affine) and render each with a normal affine transform. Of course you need to place the patches just right, so as to cover any possible gaps. As long as the divisions are small enough, this looks convincingly 3D.
This technique is used in everything from Flash 3D engines to texturing in some PC and console games, but I'm impressed to see it functioning so well in Javascript.
Projective Texturing with Canvas
Posted by Jason Striegel |
Feb 24, 2009 03:00 AM
hacks |
Permalink
| Comments (1)
| Email Entry
February 23, 2009
How To - backup Flickr photos with FlickrEdit

A reader named Bruce sent in a request for a tool that will allow you to automatically download all of your Flickr photos for backup or export purposes. A quick search landed me on FlickrEdit, a Java desktop application that uses the Flickr API to manage and export your Flickr content.
FlickrEdit will launch from a URL, after which you'll have to agree to a security dialog and you'll have the option of adding a shortcut to the app on your Desktop. After the application starts, you can associate it with your Flickr account and allow FlickrEdit to access your photos.
Your photo sets will be listed in the FlickrEdit interface. Simply select the ones you want to back up, hit the backup button in the lower right, and select a folder. FlickrEdit will download all of the full-res versions of your photos, broken out into subdirectories for each set.
I imagine this could be useful for folks that upload to Flickr from many different sources. You could pull everything down to your main desktop machine to consolidate your entire image archive. The whole process is pretty straightforward and it's a quick way to collect all of your Flickr content onto your desktop--way easier than clicking through all the "original size" links and manually downloading.
Posted by Jason Striegel |
Feb 23, 2009 03:00 AM
hacks, Photography |
Permalink
| Comments (0)
| Email Entry
February 22, 2009
Put Hulu back in Boxee

Fans of the Boxee media player were bummed last week to hear that Hulu support would be removed. From the Boxee blog:
two weeks ago Hulu called and told us their content partners were asking them to remove Hulu from boxee. we tried (many times) to plead the case for keeping Hulu on boxee, but on Friday of this week, in good faith, we will be removing it.
Thankfully, an XMBC media player hacker put together a workaround, and Kevin at Lifehacker did a nice job of documenting the steps needed to get everything working again under Boxee. There have been reports that a few videos don't play correctly, but on the whole it's working for people most of the time. Hopefully it will function as a standby until Hulu's content providers come to their senses.
How to Reinstall a Working Hulu in Boxee
Posted by Jason Striegel |
Feb 22, 2009 03:00 AM
Computers, hacks |
Permalink
| Comments (1)
| Email Entry
February 21, 2009
Wikislate - technical translations using Wikipedia

Ben sent us a nifty translation tool that uses Wikipedia's alternate language links as its result set.
The "Hack" is essentially using Wikipedia's inter-wiki links (the ones on the bottom of the navigation bar) for translation of nouns.
I used to do it manually all the time for mathematical terms. Say for example, that I'd like to know the German word for the math term "Convergence", I go to https://en.wikipedia.org/wiki/Convergence and then click on the Deutsch link to get the German version of that page - KonvergenzMy tool is doing just that in code, easing the process.
It seems to work especially well for technical terms that are normally difficult to translate correctly. Where a typical automated translator might return the literal translation of a word, the Wikipedia community aims to link together pages about the same subject, which, in theory, should make Wikislate produce better results.
Posted by Jason Striegel |
Feb 21, 2009 03:00 AM
Computers, hacks |
Permalink
| Comments (3)
| Email Entry
February 20, 2009
Lag switch - how some gamers cheat
I'll preface this post by saying I'm definitely not an advocate for using this hack, but if you find yourself getting knocked off by an invisible opponent, at least you'll know what might be going on.
A lag switch is a device that causes a network disruption during online gameplay to the benefit of one of the players. As the video above shows, it can be made with a dollar's worth of parts and very little technical proficiency. From the Wikipedia entry on online game cheating:
By attaching a physical device (called a lag switch) to a standard Ethernet cable, a player is able to disrupt updates/communication from the server with the intent of tricking the game server into continuing to accept client-side updates (which remain unimpeded). Since the client game-player is impeding the reception of information download, on the client game-player's side the opponents will slow down or stop moving, allowing the client game-player to more easily shoot them, block them, out-race them, etc. From the other players' perspectives, the person using the lag switch may appear to be teleporting, invincible, having delayed animations or fast-forwarded game play, or the player may simply find themselves losing to an invisible opponent.
Though I'm not a gamer, I found this cheat to be particularly interesting since it abuses the very mechanism that's supposed to make gameplay fair and smooth for players with differing connection speeds. The hack essentially interrupts the Rx pair of the ethernet connection, while allowing the Tx pair to continue transmitting. The game is designed so that in a normal lagging network scenario you can shoot at other players in the location where your game client perceives them to be. Otherwise, you'd have to be predicting the future, aiming at where the other player will be seconds from now when their network packets finally arrive. Shut off only the Rx pair, and your game client can only interpolate the location of the other players; they effectively stop. With the Tx pair still active, your client is still able to send collision events to the server, making your opponent dead (and you a cheater).
I don't think this is a new hack by any means, so chances are there are games that are affected, and many more that aren't. Any regular gamers out there want to chime in on what games are most affected by this? Is the practice common? It seems like this would just about completely spoil an otherwise fun experience.
How to Make a Lag Switch
Wikipedia: Online Game Cheating
Posted by Jason Striegel |
Feb 20, 2009 03:00 AM
Gaming, hacks |
Permalink
| Comments (13)
| Email Entry
February 19, 2009
Bi-Cycle

The Bi-Cycle is a unique two headed tandem bicycle concepted by industrial designer Elad Barouch. Both riders pedal. Both riders steer. It's like a mix of exercise and couples' counseling that allows two cooperating individuals to look sweet upon the seat.
I wasn't really joking about the couples' counseling part. In a Bike Hacks interview last December, Elad described his inspiration for the bike:
So the idea for final shape of the Bi-Cycle really came since it was the ultimate way to explain my observation about the way to resolve disputes which is in short, at first we need to establish trust and learn to communicate, then we can start moving forward, once we are moving we can master our communication skills and than that is left is pure fun. This is the reason why when riding the Bi-Cycle, both riders have complete control on the steering and the pedaling, making their influence on the riding the same thus creating the need to communicate.
Bi-Cycle
Bike Hacks' Interview With Elad Barouch
Posted by Jason Striegel |
Feb 19, 2009 03:00 AM
Bicycles, hacks |
Permalink
| Comments (0)
| Email Entry
February 18, 2009
Command-line Fu: post and vote on command-line snippets
Here's a great resource for command-line geeks; you can browse and vote on snippets that people have posted and upload your own:
Command-Line-Fu is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on and discussed - digg-esque voting is also encouraged so the best float to the top.
Command-line Fu [via Free Like GNU]
Posted by Brian Jepson |
Feb 18, 2009 04:30 AM
Computers, hacks |
Permalink
| Comments (0)
| Email Entry
Box2D JS - Javascript 2D physics library

Chances are, you've played a Flash game or two that makes use of a 2D Newtonian physics engine. If you're a Javascript coder, though, there's no reason why you should feel left out of the fun.
Box2D JS is a Javascript port of the popular Box2DFlashAS3 library. This is cool for a couple of reasons. First, it brings a simple 2D physics API to Javascript. Almost as important, it's the exact same API that Flash developers have been using, so there's an existing set of documentation and a lot of sample code can be easily ported.
Posted by Jason Striegel |
Feb 18, 2009 03:00 AM
hacks |
Permalink
| Comments (1)
| Email Entry
February 17, 2009
Invisible watermark

Watermarking images can sometimes be a decent way to allow posted content to make the rounds online, while ensuring that the source of the content is correctly attributed. One thing that's always bugged me about watermarking, however, is that the original source site becomes all peppered with ratty attributions or logos that detract from the quality of the posted image. In this scenario, the watermarked image makes the content owner's site look shoddy, and this is a bad thing.
AJ sent in this nifty idea for making invisible watermarked images, where the watermark only appears when the image is downloaded or copied:
With about 10 lines of HTML and CSS, you can have an image on your site, watermark free. Then, when it's pulled off, a watermark suddenly appears like magic! A precisely positioned DIV with an image background that cancels out just the watermark is placed over the watermarked image, and when they overlap, you (mostly) see the un-watermarked original image. Tada! It's not cross-browser tested, so stay aware.
I tested this with a slightly easier alternative. Just cut out a whole rectangle of the source image where the watermark will go, then place a relatively positioned div with that background over the watermarked output. It's completely imperceptible until the image is copied.
Try dragging the image above to your desktop and you'll see what I mean.
The only downside is that it's a bit tedious, but there's no reason this feature couldn't be automated in the image upload facilities of most blogging software. Also, this isn't going to keep someone from screen-grabbing the whole thing, or carefully reassembling the two images manually. It does, however, make it easy for honest people to easily attribute the source, all while improving the look of the creator's site. Anyone going to the trouble of subverting this would probably be cropping off your watermarks anyway.
Posted by Jason Striegel |
Feb 17, 2009 03:00 AM
hacks, Photography |
Permalink
| Comments (11)
| Email Entry
February 16, 2009
Street With A View - Google Maps art hack

Sampsonia Way is a 9 block, one way alleyway in Pittsburgh, PA. It also happens to be the most exciting street in the world when viewed through Google Street View, thanks to the efforts of a neighborhood, two artists, and a conspiring Street View team.
On May 3rd 2008, artists Robin Hewlett and Ben Kinsley invited the Google Inc. Street View team and residents of Pittsburgh's Northside to collaborate on a series of tableaux along Sampsonia Way. Neighbors, and other participants from around the city, staged scenes ranging from a parade and a marathon, to a garage band practice, a seventeenth century sword fight, a heroic rescue and much more...
If you knew when the Street View car was coming through your neighborhood, what would you do to welcome it?
Street With A View
Sampsonia Way In Street View
Posted by Jason Striegel |
Feb 16, 2009 03:00 AM
Arts, Culture jamming, hacks |
Permalink
| Comments (6)
| Email Entry
February 15, 2009
Get Smart shoe phone
Of all Maxwell Smart's ridiculous gadgets, the shoe phone has always been my favorite. Paul Gardner-Stephen decided to make this fantastic piece of spy tech a reality, with an Instructable that shows you how to make your own with a pair of wooden-heeled shoes, a Bluetooth headset, and a Motorolla V620.
This shoe phone works by having a bluetooth headset in one shoe, and a mobile phone in the other. The reason for this is that when you see a mobile phone in the shoe when opened, it kind of ruins the magic of it being a shoe phone, rather than just a piece of consumer electronics wedged into a shoe.
Posted by Jason Striegel |
Feb 15, 2009 08:00 PM
Cellphones, Culture jamming, hacks |
Permalink
| Comments (0)
| Email Entry
February 14, 2009
Nabaztag rabbit and Pandorabots AI mashup

Johnny Baillargeaux sent in a fun mashup that allows the Nabaztag programmable wireless rabbit to communicate with a Pandorabots AI bot service. With his software, you can write an AI script using AIML, publish it on Pandorabots, and then the output of the bot will be sent through the rabbit. Neat stuff.
Nabaztag/Ubiquity/Pandorabots integration
Pandorabots
Nabaztag wifi rabbit
Posted by Jason Striegel |
Feb 14, 2009 09:00 PM
Gadgets, hacks |
Permalink
| Comments (0)
| Email Entry
February 13, 2009
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.
Posted by Jason Striegel |
Feb 13, 2009 03:00 AM
hacks |
Permalink
| Comments (4)
| Email Entry
February 12, 2009
iPhoneDisk - your iPhone is a mobile drive

Sometimes you need a handy mobile storage device to move files around between locations. You could use a flash drive or an external disk, but why not make use of that 16GB phone that you carry with you all the time?
iPhoneDisk is a MacFUSE based filesystem for the iPhone. Simply install MacFUSE, then install iPhoneDisk, and your iPhone will be usable as a general storage device. When you connect it via USB, it will show up on your desktop just like a USB drive would. You'll always have a convenient external disk on hand, and it's one less thing you need to carry around with you.
Posted by Jason Striegel |
Feb 12, 2009 03:00 AM
hacks, iPhone |
Permalink
| Comments (7)
| Email Entry
February 11, 2009
Wacom pen(dulum) art



This clever fellow suspended his Wacom pen above his Wacom tablet and made a cool drawing pendulum with it.
Posted by Gareth Branwyn |
Feb 11, 2009 12:00 PM
Arts, hacks |
Permalink
| Comments (0)
| Email Entry

Make: television is here! Visit makezine.tv or iTunes to see all the episodes.
Connect with MAKE
MAKE's RSS feed is here.Add MAKE to iGoogle - GoogleGoogle.
How to add MAKE to your RSS reader - Real simple.
Add MAKE on Twitter.
MAKE's fan page on Facebook.
Add MAKE on FriendFeed

Why advertise on MAKE?
Read what folks are saying about us!
Click here to advertise on MAKE!

Makezine authors!
Gareth Branwyn, Chris Connors (guest author), Collin Cunningham, Marc de Vinck, Peter Horvath(intern), Kip Kay, John Park, Becky Stern, Jason Striegel, Phillip Torrone
Current Podcast

Get the Make blog sent via email
Help | Write for MAKE | Contact Us | Subscribe | Advertise with Us | Privacy Policy| About MAKE | FAQ
© 2009 O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on makezine.com are the property of their respective owners.