- Swap Control and Caps Lock in System Preferences -> Keyboard -> Modifier Keys
- Google Chrome http://www.google.com/chrome/
- iTerm2 http://www.iterm2.com/
- Oh my zsh https://github.com/robbyrussell/oh-my-zsh/
- XCode (from the mac app store)
- XCode command line tools (run XCode, go to Preferences -> Downloads -> Command Line Tools)
- Homebrew https://github.com/mxcl/homebrew/wiki/installation
""" | |
A python script to notify on hackernews changes using pySnarl (win32) | |
author: joebo | |
I found myself checking HN throughout the day while working and would | |
spend a few minutes each time skimming to see if there was anything new. | |
This automated the task for me and I thought it might be useful to share. | |
It's meant to be quick and dirty but works. | |
get pysnarl from http://code.google.com/p/pysnarl/ |
<?php | |
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html | |
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
foreach($rows as $row) { | |
echo '<p>'; |
#!/usr/bin/env bash | |
set -e | |
if [ "$1" = "-h" ] || [ "$1" = "--help" ] ; then | |
echo "usage: git sync [remote-name]" | |
echo | |
echo "Sync's the current repository to another remote host, using git," | |
echo "but not using this repository." | |
echo |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
G-WAN is a new free web server. They seem to be very proud of it, or at least just want to make a lot of money. Well anyway, in almost every sentence they write, they claim that they are 20% cooler than anything else. It feels a bit arrogant. I have to admit, I don't know a lot about web servers, so I can't speak to how good they are.
However, then I saw their Captcha example. I also don't know much about machine learning algorithms, OCR, and stuff like that, but I do know how to read pixels. I also know how to compare values with python :P
They say the following about their Captcha:
After installing Arch on my Raspberry Pi, internet worked out of the box: I could plug it into the router, turn it on, ssh in and start downloading things. But the router is in my housemate's bedroom, which isn't ideal. If I want the Pi to be connected to the internet in my room, I need it to be connected to my laptop. (Another option would be a USB wifi dongle, of course.) This is how I did it. Much credit goes to the Ubuntu wiki's Connection sharing page.
I should disclaim that I don't fully understand networking stuff, and some of what I say might be wrong. I also didn't write this as I was going; so while I've consulted my browser and shell histories, it's possible I've forgotten some steps.
My laptop is running Gentoo, and this is where most of the work has to be done. It connects to the internet through wifi, on interface wlan0
. The ethernet port is eth0
, and eth0
is also the name of the ethernet port on the Pi.
Step zero: plug ev
#!/bin/bash | |
# For the times when grep -r just doesn't cut it: Search all files matching a pattern for a particular string | |
# Example command (best when put in a folder that's on your path somewhere): | |
# searchall.bash -f *.php -s 'hoops' | |
# What arguments do we pass? | |
while [ "$1" != "" ]; do | |
case $1 in | |
-f | --file ) shift | |
file=$1 |
def disable_notifications! | |
auth_url = "https://twitter.com/login" | |
notifications_url = "https://twitter.com/settings/notifications" | |
agent = Mechanize.new | |
page = agent.get(auth_url) | |
puts "DISABLING NOTIFICATIONS for #{self.username}" | |
puts "Logging in..." | |
page.forms_with(:action => 'https://twitter.com/sessions') do |forms| |
#!/usr/bin/env python | |
"""Reads json lines from stdin and write csv to stdout. | |
Usage: | |
json2csv.py -f <field>... | |
json2csv.py -h | --help | |
json2csv.py --version | |
Options: | |
-h --help Show this screen. |