Skip to content

Instantly share code, notes, and snippets.

# spinner characters
# http://stackoverflow.com/questions/2685435/cooler-ascii-spinners
# spinner code
# https://github.com/IntellexApps/blcheck.git
# Define spinner
#SPINNER="-\|/"
#SPINNER=".oO@*"
#SPINNER="▉▊▋▌▍▎▏▎▍▌▋▊▉"
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;
#-*- 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)
THREADS=300
ULIMITS=4096
DOMAIN=your.domain
function dig(){
for i in $(seq $THREADS); do
dig @localhost $DOMAIN &
done
wait
$ 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.
#!/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:
- 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
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()
#!/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)
#!/bin/sh
# pipeで受け取った標準入力をfluent-catで送り出す
tag=$1
if [ $# -ne 1 ]; then
echo "$0: specify tag name"
exit 0
fi
if [ -p /dev/stdin ]; then