omreport -?
用途:列出帮助
omreport storage controller
用途:查Raid controller model, cache memory size等
| ps auwx | grep -E '\[.*\]' | grep -v grep | awk '{print $NF}' | awk -F/ '{print $1}' | sed 's/\[//g' | sed s'/\]//g' | sort | uniq | sort |
| #!/bin/bash | |
| lookup_single_ip() { | |
| local ip=$1; shift | |
| # 从bgp.he.net获取AS信息. e.g., <td>CHINANET Shanghai province network</td> | |
| local data=$(curl -L http://bgp.he.net/ip/$ip 2>/dev/null | grep -A 30 'Announced By' | egrep '^\s*<td>.*</td>\s*$' | egrep -v 'AS[0-9]*</a>' | uniq) | |
| # 从<td>标签中取值. e.g., CHINANET Shanghai province network | |
| Lookup_single_ip=$(echo $data | awk -F '<' '{print $2}' | awk -F '>' '{print $2}') | |
| } |
| #!/bin/bash | |
| tarball=$1 | |
| output_img=$2 | |
| size=$3 | |
| check_tarball() { | |
| if [[ ! -s $tarball ]]; then | |
| echo "tarball: $tarball not found" >&2 | |
| fi |
| #!/bin/bash | |
| # All these steps look excessive but address | |
| # network instability issues created by not doing them | |
| gwdev=`netstat -nr | grep default | awk '{ print $6 }' | head -1` | |
| if [ -z "$gwdev" ]; then | |
| gwdev=en1 | |
| fi |
| #!/bin/bash | |
| # Get the interface name for the gateway | |
| gwdev=`netstat -nr | grep default | awk '{ print $6 }' | head -1` | |
| # If none are found, set the gateway to en1 (generally Wifi on OS X) | |
| if [ -z "$gwdev" ]; then | |
| gwdev=en1 | |
| fi |
| file = ARGV[0] | |
| File.readlines(file).each do |line| | |
| if /^#(\d+)/.match(line) | |
| ts = Regexp.last_match(1) | |
| print Time.at(ts.to_i).to_s + " " | |
| else | |
| puts line | |
| end | |
| end |
omreport -?
用途:列出帮助
omreport storage controller
用途:查Raid controller model, cache memory size等
| #!/bin/bash | |
| if [ $# -lt 2 ]; then | |
| echo "usage:$0 dev output_dir" | |
| exit 1 | |
| fi | |
| DEV="$1" | |
| OUTDIR="$2" | |
| DATASIZE="500" # in MB |
| #!/bin/bash | |
| [[ $# -lt 2 ]] && exit 1 | |
| DEV="$1" | |
| OUTDIR="$2" | |
| [[ -d $OUTDIR ]] || mkdir -p $OUTDIR | |
| BLOCK_SIZES="512 4K 8K 256K" |
| syntax on | |
| set tag=~/tags | |
| autocmd! BufNewFile,BufReadPre,FileReadPre *.rb set nu et ts=2 sw=2 | |
| autocmd! BufNewFile,BufReadPre,FileReadPre *.coffee so ~/.vim/ftplugin/coffee.vim |