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
wget --recursive --no-parent --domains hoge.com --convert-links --page-requisites www.hoge.com/path/to/dir |
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
# using libfaac on Mac OS X 10.6.8 | |
# -vn : not copying video | |
# -acodec : specify codec used in flv file | |
# -ac : channels. 1 is for mono, 2 is for stereo | |
# -ab : specify bitrate for output file (note that rate is not kbps but bps) | |
# -ar : sampling frequency (Hz) | |
# -threads: number of threads for encoding | |
# "-strict experimental" is necessary to use libfaac | |
ffmpeg -y -i xxxxxxxxxxx.flv -vn -acodec aac -ac 2 -ab 128000 -ar 44100 -threads 4 -strict experimental xxxxx.m4a |
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 | |
source ~/.virtualenvs/sphinx/bin/activate | |
cd ~/docs/ | |
make html |
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
% ./configure --prefix=/opt/erlang/R15B01 \ | |
> --disable-hipe \ | |
> --disable-native-libs \ | |
> --enable-smp-support \ | |
> --enable-threads \ | |
> --enable-kernel-poll \ | |
> --enable-darwin-64bit \ | |
> --without-javac |
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
# convert PuTTY's public ssh key file into OpenSSH public key | |
ssh-keygen -i -f id_rsa_putty.pub > id_rsa.pub |
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
find . -iname '*.txt' | xargs python -c 'import sys; print sys.argv[1:]' | |
find . -iname '*.txt' | python -c 'import sys; print [f.strip() for f in sys.stdin]' |
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 | |
IFS=" | |
" | |
cd "${1}" | |
echo "source dir: "${PWD} | |
echo "target dir: "${2} | |
for input in `find . -name "*.aiff" -type f` |
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
# -*- coding: utf-8 -*- | |
""" | |
This scripts reqire a third party module 'requests'. | |
You can get it from PyPI, i.e. you can install it using | |
easy_install or pip. | |
http://docs.python-requests.org/en/v0.10.4/ | |
Original source code is written by shin1ogawa, which is in Java. |
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
import zmq | |
import sys | |
context = zmq.Context() | |
subscriber = context.socket(zmq.SUB) | |
subscriber.connect("tcp://localhost:5556") | |
# receive only message with zipcode being 10001 | |
zipfilter = sys.argv if len(sys.argv) > 1 else "10001 " | |
subscriber.setsockopt(zmq.SUBSCRIBE, zipfilter) |
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
import zmq | |
import sys | |
import time | |
cxt = zmq.Context() | |
receiver = cxt.socket(zmq.PULL) | |
receiver.connect("tcp://127.0.0.1:5555") | |
sum = 0 | |
while True: |