This file contains hidden or 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 | |
""" | |
A pure python ping implementation using raw socket. | |
Note that ICMP messages can only be sent from processes running as root. | |
Derived from ping.c distributed in Linux's netkit. That code is |
This file contains hidden or 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
/* | |
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
# Version 2, December 2004 | |
# | |
# Copyright (C) 2013 Yoshihiro TSUBOI <ytsuboi-at-gmail.com> | |
# | |
# Everyone is permitted to copy and distribute verbatim or modified | |
# copies of this license document, and changing it is allowed as long | |
# as the name is changed. | |
# |
This file contains hidden or 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 <stdarg.h> | |
/* returns the length printf would print. */ | |
int | |
printflen(const char* format, ...) { | |
va_list ap; | |
char buf[1]; | |
int len; |
This file contains hidden or 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 math | |
def fft(data): | |
n = len(data) | |
assert 2 ** int(math.log(n, 2)) == n, "Number of samples should be 2^n." | |
theta = math.pi * 2 / n | |
def scramble(k, i): | |
while True: |
This file contains hidden or 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
int i = 0; | |
void setup() { | |
pinMode(13, OUTPUT); | |
Serial.begin(9600); | |
while(!Serial) { | |
} | |
} | |
void loop() { |
This file contains hidden or 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 bash | |
SOURCE=git-1.8.1.4.tar.gz | |
SOURCEDIR=git-1.8.1.4 | |
BASH=/usr/bin/bash | |
MAKE=/usr/local/bin/make | |
PERL=/usr/local/bin/perl | |
PYTHON=/usr/local/bin/python | |
LIBDIR=/usr/local/lib |
This file contains hidden or 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
ipythonで、^Dで確認なしで終了できるようにする。 | |
% ipython profile create | |
% vi $HOME/.ipython/profile_default/ipython_config.py | |
以下の設定を行う。 | |
c.TerminalInteractiveShell.confirm_exit = False |
This file contains hidden or 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/python | |
import boto | |
import boto.route53.record | |
access_key = 'XXXXXXXXXXXXXXXXXXXX' | |
secret_access_key = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' | |
zone_id = 'XXXXXXXXXXXXXX' | |
domain = 'example.com.' # last '.' required. |
This file contains hidden or 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/python | |
### BEGIN INIT INFO | |
# Provides: update53 | |
# Required-Start: $network $local_fs | |
# Required-Stop: | |
# Should-Start: | |
# Should-Stop: | |
# X-Start-Before: couchbase-server | |
# X-Stop-After: couchbase-server |
This file contains hidden or 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
#vim:set fileencoding=utf-8 | |
import time | |
# Cache with Expire | |
class Cache: | |
def __init__(self, timeout): | |
# Actual expire is more than timeout and less than timeout*3. | |
self.timeout_ = timeout | |
self.clear() |