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
[baba@bbair2012 ~]$ mkvirtualenv --python=python2.6 --no-site-packages sandbox2.6 | |
Running virtualenv with interpreter /usr/local/bin/python2.6 | |
New python executable in sandbox2.6/bin/python2.6 | |
Also creating executable in sandbox2.6/bin/python | |
Installing setuptools............................done. | |
Installing pip...............done. | |
(sandbox2.6)[baba@bbair2012 ~]$ /usr/bin/python -V | |
Python 2.7.2 | |
(sandbox2.6)[baba@bbair2012 ~]$ python -V | |
Python 2.6.8 |
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' | |
describe 'Linux kernel parameters' do | |
context 'fs.file-max' do | |
its(:value) { should >= 2097152 } | |
end | |
context 'kernel.core_uses_pid' do | |
its(:value) { should eq 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
#!/bin/bash | |
MYHOSTNAME=$(uname -n) | |
if [ "${MYDOMAIN}x" == "x" ];then | |
echo 'MUST DO: export MYDOMAIN="example.com"' | |
exit 1 | |
fi | |
if [ `grep -c -w "${MYHOSTNAME:?}" /etc/hosts` -eq 0 ];then | |
echo "127.0.0.1 ${MYHOSTNAME:?} ${MYHOSTNAME:?}.${MYDOMAIN:?}" >> /etc/hosts | |
fi |
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
bindkey ^w^j eval 'focus down' | |
bindkey ^w^k eval 'focus up' | |
bindkey ^w^h eval 'focus left' | |
bindkey ^w^l eval 'focus right' | |
bindkey ^w^c eval 'screen' | |
bindkey ^w^x eval 'remove' | |
bindkey ^w^o eval 'only' |
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
"""neobundle | |
" install | |
" install -d ~/.vim/bundle | |
" git clone git://github.com/Shougo/neobundle.vim ~/.vim/bundle/neobundle.vim | |
" | |
" when add new NeoBundle, exec | |
" vim -c 'NeoBundleInstall' | |
" | |
" to update plugins | |
" vim -c 'NeoBundleInstall!' |
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
# pip install redis | |
import redis | |
QUEUE="scale:sclgrp:up" | |
LOCK_KEY="scale:sclgrp:lock" | |
INCRD_KEY="scale:sclgrp:incrd" | |
def scaleout(): | |
r = redis.StrictRedis() | |
queue_count=r.llen(QUEUE) | |
locked=r.get(LOCK_KEY) | |
print locked |
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
from fabric.api import * | |
from fabric.contrib.files import * | |
import json | |
import os,sys,time | |
def list_vm(displayname="scale"): | |
resp=local("idcf-compute-api listVirtualMachines",capture=True) | |
retval = json.loads(resp, 'UTF-8') | |
for vm in retval['listvirtualmachinesresponse']['virtualmachine']: | |
print vm['displayname'], |
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 | |
#usage: python qmail_log_parser.py maillog | grep "_too_many_hops" | sed 's/.*@//' | sort | uniq -c | |
import sys | |
MAILLOG=sys.argv[1] | |
FULL_LINES='' | |
FAILED=[] | |
FAILED_TMP={} |
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
# Database Name: wp_db | |
# Database User: wp_user | |
# Database Pass: wp_pass | |
sudo yum -y install mysql mysql-server | |
sudo chkconfig mysqld on | |
sudo service mysqld start | |
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
package controllers; | |
import java.util.Date; | |
import org.codehaus.jackson.node.ObjectNode; | |
import play.libs.F.Promise; | |
import play.libs.Json; | |
import play.libs.WS; | |
import play.mvc.Controller; |