This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from StringIO import StringIO | |
from lxml import etree | |
import time | |
XML_BEGIN = """ | |
<!DOCTYPE NETSCAPE-Bookmark-file-1> | |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> | |
<!-- This is an automatically generated file. | |
It will be read and overwritten. | |
Do Not Edit! --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from lxml import etree | |
from StringIO import StringIO | |
import time | |
import os | |
import urllib | |
PINBOARD_USER = "username" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'URI' | |
require 'cgi' | |
require 'net/ssh/gateway' | |
require "mysql" | |
require 'active_record' | |
def connect_to(database, connection_opts) | |
args = {:adapter=>"mysql", :database=>database}.merge(connection_opts) | |
ActiveRecord::Base.establish_connection(args) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ruby -e 'puts ARGF.read().split("\n").join(" ")' $@ | |
# or use see instead | |
# sed -e :a -e '/$/N; s/\n/ /; ta' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
sudo dtrace -n 'syscall::open*:entry { printf("%s %s",execname,copyinstr(arg0)); }' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
networksetup -setdnsservers Wi-Fi Empty # 8.8.8.8 | |
sudo killall -9 mDNSResponder |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
hadoop fs -du $1 | awk '{print $1/1000.0/1000.0/1000.0, $2, $3}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:%5B%5D.forEach.call(document.querySelectorAll('embed,video'),function(e)%7Be.setAttribute('x-webkit-airplay','allow');e.setAttribute('airplay','allow')%7D); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:window.location.href=window.location.href.match(/google/)?'http://www.baidu.com/s?ie=utf-8&wd='+window.location.href.split('&q=')[1].split('&')[0]:'http://www.google.com/search?ie=UTF-8&q='+window.location.href.split('&wd=')[1].split('&')[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
SRC_PATH=$0 | |
DST_PATH=$1 | |
for d in `ls $SRC_PATH`; do | |
echo "copying $SRC_PATH/$d -> $DST_PATH/$d" | |
rsync -aplx --link-dest=$SRC_PATH/$d $SRC_PATH/$d $DST_PATH/$d | |
echo "removing $SRC_PATH/$d" | |
rm -rf $SRC_PATH/$d | |
done |
OlderNewer