Sharing my solution to a serialization problem here. I needed to give myself the option of dumping to json or pickling my response. Since I want this option available on pretty much any webservice endpoint, I decided a decorator was the way to go.
The two cleanest ways to request the serialization format would be to use query parameters or set the Accept header on my request. Obviously, setting the Accept header is the way to go, as it will work on POSTs as well as GETs.
Alright, lets jump to the code. I'll be using bottle, pickle, and json for this example. Python decorators are simple... Well, once you've written a few. Luckily I've found several chances to use them at work, so I only had to glance at one of my old ones to get it right.
A certain geek *coughColecough* picked up an Ergodox some months back. After an initial period of smiling at his purchase while enjoying my work supplied ergonomic keyboard, I decided to take him up on his offer to type on it.
I can only say that in order to understand the draw of mechanical keyboards, you need to use one for an hour. They're pretty freaking cool. Sadly, the Ergodox is a bit out of my price range at the moment - saving up for a roadie while training for a triathalon next year. I also borrowed a Code keyboard using Cherry MX Clears, but decided I liked the ergonomics of the Dox.
Here's where the Atreus comes in. It's a 40% keyboard, so only has 42 keys instead of the 87/104 "normal" keyboards have. All the extra (punctuation, numeric, function) keys are accessed by switching "layers" - essentially shift on steroids. Jump in after the break!
I'm going to build on FuelCell250's previous post regarding SSH tunneling. Most of the time you'll want to tunnel all of your traffic through your home SSH server, but there are instances where that's not the most suitable option.
For instance, working the late shift in IT, I'll sometimes run into periods of downtime. Obviously I am careful about my browsing on a work PC. I'm not convinced, however, that anyone else should see me logging into my online banking; or that my chat sessions should be visible to anyone but myself; or those randomly blacklisted sites that are perfectly SFW.
My solution is fairly simple, and easy to setup. Check it out after the break!
One of my favorite things about OS X is the built-in screenshot feature. At any time, you can press a key combo, and grab a screenshot, which will simply appear as a file on the desktop. An insanely great feature... until it quits working.
One day, I went to take screenshot and heard the familiar shutter sound, but no file appeared on my desktop. Where are my screenshots going in OS X? Days later, I tried again, and it worked. On another day, I could no longer find my screenshots. I searched high and low on the internet. I found others having the exact same problem, but no fix was to be found. Finally, I asked on Twitter. One of my Wi-Fi engineer friends replied, "Are you using the key combo that copies it to your clipboard?" D'oh! I'd been holding it wrong the whole time! Solution after the break.
With the release of OS X 10.9 Mavericks, Apple no longer supports backing up to a hard drive connected to an AirPort Extreme with Time Machine. This was a huge disappointment for me, as I had just purchased an 802.11n AirPort Extreme and portable hard drive for my backups when Mavericks was released, only to discover that Apple now requires a Time Capsule only to perform backups. Luckily, there is an easy workaround that will allow you back up to a portable hard drive that is connected your AirPort Extreme with Time Machine. Check out the instructions after the break!
I was recently given a 3-battery (second-generation) Apple Wireless keyboard, model A1255. I run Ubuntu 12.04 as my primary OS on my laptop, so I didn't anticipate any compatibility issues. It didn't take me long to run into trouble. During the pairing process, Ubuntu gives a random PIN that must be typed into the keyboard, but it consistently rejected the number. The solution? Hold down the "command" button while typing the PIN number, release the command button, and then press enter. As a side note, put the keyboard in discoverable mode by powering it off, and then holding the power button until the light blinks steadily. I hope that saves someone some grief!
There's nothing quite like being 500 miles from home and having the ability to control your home computer with your cell phone. In the past, I have used PocketCloud in conjunction with the built in RDP server to access my Windows 7 computer. It was pretty handy for managing my media library from work or my laptop.
I ran into a problem, though, once I completely moved my home computers to Linux: the best RDP server solution for Linux (xRDP) just didn't cut it. It was nowhere near as seamless as the built in utilities for Windows, and I don't like fiddling past initial setup.
I decided my Raspberry Pi would make a great remote access point. No sensitive information, very low power draw for 24/7 uptime, and I can tuck it in next to my router so I never have to see it.
Join me after the break for a quick and easy tutorial for enabling remote access to your own Linux machine! We'll be using TightVNC Server for Linux, a Raspberry Pi running Raspbian, and your choice of a VNC client.
Ok, its more of a bypass then a hack, but still fun. While waiting for takeoff I was thumbing through the add-filled magazine in the seat pocket in front of me, when lo and behold I see a full page add for Blackberry 10's new Z10 phone, with the caption "free gogo internet for blackberry users this month". Well, as any self-respecting hacker would, I decided that free wifi was mine. Assuming they were using user-agent string to filter out Blackberry vs non-blackberry clients, I decided to do some experimenting and found that:
Mozilla/5.0 (BB10; Z10) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.3 Mobile Safari/531.21.10
worked! I basically modified the safari user-agent string with the BB10; Z10 addition, and there was free internets to be had.
Nuts and bolts:
thankfully I already had my user-agent switching extension loaded in chrome, so I simply opened it up and duplicated the safari user-agent string then refreshed the page and the gogo portal asked me if I'd like free wifi. Thanks, gogo!
The HTC Nexus One is likely the most iconic Android device to date. None of the other Android devices I've used have ever quite felt as good in the hand or looked as good.So it's a shame the onboard ROM is too small to support anything above Gingerbread (2.3). Or, is it? Officially, the system partition is too small, the GPU isn't up to the task of pushing Jelly Bean, etc. But the Nexus S pushes it just fine, and it's essentially the same hardware (granted, a few changes, but the same processing power).
As luck would have it, the awesome devs over at XDA developers have worked out a way to repartition the onboard ROM to allow Android 4.0 and above to be installed.
Join me after the jump for a walkthrough of the installation!
I know that I'm straying into Lifehacker territory here, but this is a tip I couldn't help but share. I've always wanted to create customer launchers for the Unity dock, and I've finally found how. I'm going to apply this to Minecraft, but you can use to create an icon for just about any program or command that you might need to run in Ubuntu. Read on for instructions...