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 python | |
# -*- coding: utf-8 -*- | |
import json | |
import httplib2 | |
# Chaoyang district, Beijing, CN | |
chaoyang = 101010300 |
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 | |
DB1BUGS="mysql xxx" | |
DB1HW="mysql xxx" | |
LiveBUGS="mysql xxx" | |
LiveHW="mysql xxx" | |
LocalBUGS="mysql xxx" | |
LocalHW="mysql xxx" | |
CMD="gnome-terminal --maximize" |
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 | |
# put this in /etc/ppp/ppp0 | |
# mac user only | |
gw=`netstat -nr|grep UGScI|awk '{print $2}'` | |
# replace 192.168 with your local network | |
/sbin/route add -net 192.168 -gateway $gw |
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 | |
vmlist=$(virsh list | awk 'NR>2 {print $2}') | |
for vm in $vmlist | |
do | |
#echo "$vm" | |
virsh vcpuinfo $vm | grep 'CPU A' | awk '{print $3}' | |
done |
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
set ruler | |
set showcmd | |
set tabstop=4 | |
set expandtab | |
set softtabstop=4 | |
set shiftwidth=4 | |
set nu | |
set hlsearch | |
set incsearch | |
set foldmethod=marker |
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 | |
ARVDATE=`date +%Y%m%d%H%M` | |
PID=/usr/local/nginx/nginx.pid | |
cd /usr/local/nginx/logs | |
for log in sdf.access.log error.log | |
do | |
file=lastweek/arv$log$ARVDATE.log |
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
/* Exercise: Loops and Functions #43 */ | |
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
func Sqrt(x float64) float64 { | |
z := float64(2.) |
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
package main | |
import ( | |
"fmt" | |
"time" | |
"net/http" | |
"encoding/json" | |
"io/ioutil" | |
) |
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 | |
USAGE='Usage: ./create_kvm.sh kvm_name lvm hd1' | |
# kvm_name is the virtual machine's name | |
# lvm is the virtual machine's image disk path | |
# hd1 is the addtional disk we want to attach to this kvm | |
if [ "$1" = "help" ] | |
then | |
echo $USAGE |
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/perl | |
use NetAddr::IP; | |
unless (@ARGV) { | |
print "usage: $0 file1 file2 file3\n"; | |
exit; | |
} |
OlderNewer