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 | |
set -e | |
function usage(){ | |
echo "Usage: `basename $0` [domain]" | |
echo " -m memory as Mb" | |
echo " -s disk as Gb" | |
echo " -n comma separated network" | |
echo " -f first delete image file" | |
echo |
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 | |
# submodule commit/push | |
set -e | |
submodules=`git submodule status | awk '{print $2}'` | |
command="$1" | |
shift | |
args="$@" |
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 | |
PURGE='apt-get -y --auto-remove purge' | |
$PURGE python-keystoneclient | |
$PURGE nova-common | |
$PURGE quantum-common | |
$PURGE openstack-dashboard apache2 | |
$PURGE cinder-common | |
$PURGE glance-common | |
$PURGE openvswitch-common |
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/local/bin/bash | |
patterns+='?action=newaccount ' | |
access_file='/usr/local/www/wiki/.htaccess' | |
ips_tmp=`mktemp` | |
trap 'on_exit; exit' SIGINT SIGQUIT EXIT | |
function on_exit(){ | |
rm -f $ips_tmp |
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 | |
# os-router-move.sh <router-name> <host-name> | |
set -e | |
target_router=$1 | |
target_node=$2 | |
function usage(){ | |
echo "Usage: `basename $0` ROUTER-NAME TARGET-NETWORK-NODE" | |
} |
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
def aes_encrypt(data, key): | |
"""MySQL aes_encrypt compatible encrypt function""" | |
import mcrypt | |
import binascii | |
m = mcrypt.MCRYPT('rijndael-128', 'ecb') | |
m.init(key) | |
# MySQL은 여기다 padding을 붙여서 진행하니까... |
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
static public function aes_encrypt($data, $key){ | |
$expected_length = 16 * (floor(strlen($data) / 16) +1); | |
$padding_length = $expected_length - strlen($data); | |
$data = $data . str_repeat(chr($padding_length), $padding_length); | |
$enc = mcrypt_encrypt(MCRYPT_RIJNDAEL_128, $key, $data, MCRYPT_MODE_ECB); | |
return strtoupper(bin2hex($enc)); | |
} | |
static public function aes_decrypt($data, $key){ | |
// bin2hex의 역 함수가 php는 없어서 새로 만듦 |
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
define :generate_ssh_keys, :user_account => nil do | |
username = params[:user_account] | |
raise ":user_account should be provided." if username.nil? | |
Chef::Log.debug("generate ssh skys for #{username}.") | |
execute "generate ssh skys for #{username}." do | |
user username | |
creates "/home/#{username}/.ssh/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
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<" | |
defscrollback 1000 |
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/env bash | |
wiki_dir=/usr/local/www/wiki | |
cd $wiki_dir | |
# clear pages | |
rm -rf trash | |
mkdir trash | |
moin --config-dir=$wiki_dir --wiki-url=http://wiki.woosum.net maint cleanpage | bash |
OlderNewer