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
# spinner characters | |
# http://stackoverflow.com/questions/2685435/cooler-ascii-spinners | |
# spinner code | |
# https://github.com/IntellexApps/blcheck.git | |
# Define spinner | |
#SPINNER="-\|/" | |
#SPINNER=".oO@*" | |
#SPINNER="▉▊▋▌▍▎▏▎▍▌▋▊▉" |
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
diff --git a/modules/geobackend/geobackend.cc b/modules/geobackend/geobackend.cc | |
index 287db2f..9f9ef35 100644 | |
--- a/modules/geobackend/geobackend.cc | |
+++ b/modules/geobackend/geobackend.cc | |
@@ -25,20 +25,13 @@ using boost::trim_right; | |
// Static members | |
-IPPrefTree * GeoBackend::ipt; | |
-vector<string> GeoBackend::nsRecords; |
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 | |
def main(): | |
a=[102, 3, 15, 1, 11, 5, -1, 4, 5] | |
print "start %s" % (a) | |
b = bubble_sort(a) | |
q = quick_sort(a) | |
print "bubble %s" % (b) | |
print "quick %s" % (q) |
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
THREADS=300 | |
ULIMITS=4096 | |
DOMAIN=your.domain | |
function dig(){ | |
for i in $(seq $THREADS); do | |
dig @localhost $DOMAIN & | |
done | |
wait |
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
$ easy_install sftpserver | |
# create ssh_key | |
$ ssh-keygen | |
Generating public/private rsa key pair. | |
Enter file in which to save the key (/home/sci01436/.ssh/id_rsa): ./test_rsa.key | |
Enter passphrase (empty for no passphrase): | |
Enter same passphrase again: | |
Your identification has been saved in ./test_rsa.key. | |
Your public key has been saved in ./test_rsa.key.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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# this ansible module can maintain niftycloud loadbalancer | |
# see https://github.com/yudai09/niftycloud/tree/master/niftycloud/computing/loadbalancer | |
import json | |
try: | |
import niftycloud.computing.loadbalancer | |
HAS_NIFTYCLOUD_MODULE = True | |
except ImportError: |
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
- hosts: all | |
sudo: yes | |
tasks: | |
- name: deregister smtp server from loadbalancer | |
local_action: loadbalancer name=lbsmtp instance=smtp001 load_balancer_port=465 instance_port=10025 state=absent region=jp-east-1 aws_secret_access_key=xxxxxx aws_access_key_id=xxxxxx | |
register: result | |
- debug: var=result | |
- name: register smtp server to loadbalancer |
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 smtpd import SMTPServer | |
import asyncore | |
class RejectSMTPServer(SMTPServer): | |
def process_message(self, peer, mailfrom, rcpttos, data): | |
return '500 Error' | |
def start_smtpd(): | |
server = RejectSMTPServer(('127.0.0.1', 1025), None) | |
asyncore.loop() |
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 | |
# TODO: error handling | |
if [ ${EUID:-${UID}} != 0 ]; then | |
echo 'root can exec this script.' | |
exit 1 | |
fi | |
bk_suffix=.bk$(date +%Y%m%d%H%M) |
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 | |
# pipeで受け取った標準入力をfluent-catで送り出す | |
tag=$1 | |
if [ $# -ne 1 ]; then | |
echo "$0: specify tag name" | |
exit 0 | |
fi | |
if [ -p /dev/stdin ]; then |