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 time | |
def check_hoge(**args): | |
print "args:", | |
print args | |
return False | |
def wait(function_name, retry=5, interval=1, **args): |
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
--- /etc/yum.repos.d/CentOS-Base.repo.orig | |
+++ /etc/yum.repos.d/CentOS-Base.repo | |
@@ -13,8 +13,9 @@ | |
[base] | |
name=CentOS-$releasever - Base | |
-mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os | |
+#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os | |
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/ | |
+baseurl=http://vault.centos.org/4.9/os/$basearch/ |
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
rm -f /tmp/all_pics.txt /tmp/dup_pics.txt /tmp/cmds.txt | |
find /Volumes/BBFS1/toshi-photo -type f -maxdepth 2 | sed -E "s/(.*)\..*/\1/" | sort | uniq -c | grep -v "^ \+1" | sed "s@.*.*[0-9] /@/@" > /tmp/dup_pics.txt | |
iconv -f utf8 -t utf8-mac /tmp/dup_pics.txt | while read line; do ls $line.* >> /tmp/all_pics.txt ; done | |
grep -iE "\.(pef|arw|cr2)$" /tmp/all_pics.txt | sed -E "s@(.*)/(.*)@mv \1/\2 \1/raw/\2@" > /tmp/cmds.txt | |
iconv -f utf8 -t utf8-mac /tmp/dup_pics.txt | sed -E "s@(.*/).*@\1@" | uniq | while read line; do mkdir ${line}raw ;done | |
bash /tmp/cmds.txt |
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
#cloud-config | |
hostname: myhostname | |
runcmd: | |
- [ echo, 'Setting custom hostname' ] | |
- [ sed, -i, 's/^HOSTNAME=.*/HOSTNAME=myhostname/', /etc/sysconfig/network ] | |
- [ hostname, 'myhostname' ] |
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
MINION_HOME=/home/minion/minion | |
SUPERVISOR_CONFDIR=/etc/supervisor/conf.d | |
MINION_CONFDIR=/etc/minion | |
MINION_FRONTEND_HOST=localhost | |
MYHOSTNAME=$(hostname) | |
# nginx | |
sudo cp ${MINION_HOME:?}/minion-frontend/etc/minion-dev-server.nginx.conf /etc/nginx/conf.d/minion.conf | |
sudo sed -i "s/minion-dev\.mozillalabs\.com/${MINION_FRONTEND_HOST:?}/g" /etc/nginx/conf.d/minion.conf |
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
#!/bin/sh | |
# from http://d.hatena.ne.jp/heavenshell/20121122/1353597292 | |
VENV=$1 | |
echo $VENV | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 |
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
# ls /etc/minion/frontend.json /etc/nginx/conf.d/minion.conf /etc/supervisor/conf.d/minion-*.supervisor.conf | while read f; do echo ---$f ; cat $f ; done | |
---/etc/minion/frontend.json | |
{ | |
"session-secret":"50131647012122764715049", | |
"backend-api":{ | |
"url":"http://127.0.0.1:8383" | |
} | |
} | |
---/etc/nginx/conf.d/minion.conf | |
# This Source Code Form is subject to the terms of the Mozilla Public |
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
sudo rm -f /var/lib/cloud/sem/*{defaults,runcmd,userdata,user-scripts}* /var/lib/cloud/data/cache/obj.pkl |
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
require 'spec_helper' | |
def exist?(filename) | |
File.exist?(filename) | |
end | |
def bigger_than?(filename,size) | |
File.size?(filename) >= size | |
end |
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
#coding: utf-8 | |
import csv | |
import re | |
reader=csv.reader(open('data.csv'),dialect='excel') | |
fixed=[] | |
for row in reader: | |
data={ 'waku':row[3], | |
'title':row[4], | |
'description':row[5], |