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
viz@mba:% ./fastboot flash recovery ~/Downloads/openrecovery-twrp-2.7.0.0-hammerhead.img | |
sending 'recovery' (13306 KB)... | |
OKAY [ 0.620s] | |
writing 'recovery'... | |
OKAY [ 1.045s] | |
finished. total time: 1.665s |
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 ruby | |
require 'optparse' | |
require 'fileutils' | |
class Runner | |
def initialize(argv) | |
@recorded_dir = '/chinachu/recorded' | |
@encoded_dir = ENV['HOME'] + '/encoded' | |
@work_dir = ENV['HOME'] + '/tmp' |
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/bash | |
if [ "x" = "x$1" ]; then | |
echo "usage: `basename $0` [filename]" | |
exit 1; | |
fi | |
(echo -ne "HTTP/1.0 200 OK\r\nContent-Length: $(pandoc -s --toc < $1 | wc -c)\r\n\r\n"; pandoc -s --toc < $1) | nc -l 8888 |
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 | |
while true; do | |
pid=`top -b -d 1 -n 1 | tail -n +8 | head -n 1 | awk '{print $1}'` | |
ps -efly | awk "{ if (\$3 == $pid) { print \$0 } }" | |
done |
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 | |
import sys | |
import random | |
# this function is directly from xend/server/netif.py and is thus | |
# available under the LGPL, | |
# Copyright 2004, 2005 Mike Wray <mike.wray@hp.com> | |
# Copyright 2005 XenSource Ltd | |
def randomMAC(type="xen"): |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! | |
VAGRANTFILE_API_VERSION = "2" | |
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| | |
config.vm.define "precise32" do |precise32| | |
precise32.vm.box = "precise32" | |
precise32.vm.box_url = "http://files.vagrantup.com/precise32.box" |
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
// gcc -Wall -g -O0 -lssl sha1test.c | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <sys/types.h> | |
#include <sys/stat.h> | |
#include <fcntl.h> | |
#include <errno.h> | |
#include <unistd.h> | |
#include <time.h> |
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 | |
PREFIX="/opt/local" | |
DEPEND_PACKAGES="libncurses5-dev libncursesw5-dev" | |
EMACS_TARBALL="emacs-24.3.tar.gz" | |
EMACS_TARBALL_URL="http://ftp.gnu.org/gnu/emacs/emacs-24.3.tar.gz" | |
DDSKK_TARBALL="ddskk-15.1.tar.gz" | |
DDSKK_TARBALL_URL="http://openlab.ring.gr.jp/skk/maintrunk/ddskk-15.1.tar.gz" | |
SKK_JISYO="SKK-JISYO.L.gz" | |
SKK_JISYO_URL="http://openlab.jp/skk/dic/SKK-JISYO.L.gz" |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#define BUF_SIZE (256) | |
int main() | |
{ | |
char buf[BUF_SIZE]; | |
char *value = NULL; |
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
<?php | |
function main($argc, $argv) | |
{ | |
$a = array(); | |
if (($handle = fopen('/dev/urandom', 'rb')) === false) { | |
throw new Exception('/dev/urandom open failed.'); | |
} | |
for ($i = 0; ; $i++) { | |
if (($s = fread($handle, 4)) === false) { |