私人定制
.bashrc文件
# .bashrc # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions alias rm=trash trash() { mv $@ ~/backup/ } clean() { /bin/rm $@ }
.bash_profile文件
# .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup programs export PATH=$PATH:$HOME/bin export CVSROOT=:pserver:zhe.jiang@192.168.2.94:/cvs/src export PROJECT_HOME=/home/jiangzhe/cdn export GREP_OPTIONS='--color=auto' export LANG=en_YS #export LANG=zh_CN.utf-8 # Berkeley DB export LD_LIBRARY_PATH=/home/jiangzhe/bran/BerkeleyDB.4.6/lib/
.vimrc文件
set nu set noerrorbells set novisualbell syntax on set cindent set tabstop=4 set softtabstop=4 set shiftwidth=4 set noerrorbells set hlsearch set tags=tags;/ "nnoremap <silent> <F8> :TlistToggle<CR> set nocompatible set laststatus=2 set statusline=%F%m%r%h%w\ [FORMAT=%{&ff}]\ [TYPE=%Y]\ [POS=%l,%v][%p%%]\ %{strftime(\"%d/%m/%y\ -\ %H:%M\")} " set showmatch set completeopt=preview,menu autocmd BufNewFile *.cpp,*.[ch],*.sh,*.java exec ":call SetTitle()" func SetTitle() if &filetype == 'sh' call setline(1,"\################################################") call append(line("."), "\# Copyright (c) 2013, ShangHai Onewave Inc.") call append(line(".")+1, "\#") call append(line(".")+2, "\# Script Name: ".expand("%")) call append(line(".")+3, "\#") call append(line(".")+4, "\# Description:") call append(line(".")+5, "\#") call append(line(".")+6, "\# Created: ".strftime("%c")) call append(line(".")+7, "\# Author: written by CDN group.") call append(line(".")+8, "\#") call append(line(".")+9, "\################################################") call append(line(".")+10, "\#! /bin/sh -") else call setline(1, "///////////////////////////////////////////////////////////") call append(line("."), "// Copyright (c) 2013, ShangHai Onewave Inc.") call append(line(".")+1, "//") call append(line(".")+2, "// FileName: ".expand("%")) call append(line(".")+3, "//") call append(line(".")+4, "// Description:") call append(line(".")+5, "//") call append(line(".")+6, "// Created: ".strftime("%c")) call append(line(".")+7, "// Revision: Revision: 1.0") call append(line(".")+8, "// Compiler: g++") call append(line(".")+9, "//") call append(line(".")+10, "///////////////////////////////////////////////////////////") call append(line(".")+11, "") endif if &filetype == 'cpp' "call append(line(".")+12, "#include<iostream>") "call append(line(".")+13, "using namespace std;") "call append(line(".")+14, "") endif if &filetype == 'c' "call append(line(".")+12, "#include<stdio.h>") "call append(line(".")+13, "") endif autocmd BufNewFile * normal G endfunc
.gitconfig文件
[user] name = zhe.jiang email = zhe.jiang@sihuatech.com [color] ui = true [core] editor = vim [alias] co = checkout ci = commit st = status br = branch -v rt = reset --hard unstage = reset HEAD^ uncommit = reset --soft HEAD^ l = log --pretty=oneline --abbrev-commit --graph --decorate amend = commit --amend who = shortlog -n -s --no-merges g = grep -n --color -E cp = cherry-pick -x nb = checkout -b #'git add -u' handles deleted files, but not new files #'git add .' handles any current and new files, but not deleted #'git addall' noe handles all changes addall = !sh -c 'git add . && git add -u' #Handy shortcuts for rebasing rc = rebase --continue rs = rebase --skip ra = rebase --abort
.gitignore文件
*.o *.a *.so *.swp
bin目录下脚本,依据size查找所有满足条件的文件
#!/bin/sh - # #find . -type f -size +100M -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nrk 2,2 # SIZE=$1 find . -type f -size +${SIZE}M -exec ls -lh {} \; 2> /dev/null | awk '{ print $NF ": " $5 }' | sort -nrk 2,2
bin目录下脚本,查看物理、逻辑cpu核数
#!/bin/sh - # Print cpu number info echo "Logic CPU number:" cat /proc/cpuinfo | grep "processor" | wc -l echo "Physical CPU number:" cat /proc/cpuinfo | grep "physical id" | sort | uniq | wc -l
bin目录下脚本,用以删除CDN进程
################################################ # Copyright (c) 2013, ShangHai Onewave Inc. # # Script Name: kill.sh # # Description: # # Created: Fri Sep 6 15:03:28 2013 # Author: written by CDN group. # ################################################ #! /bin/sh - # kill -9 `ps -ef |grep "owgrm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owgcm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owgsd" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owlrm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owlcm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owlsd" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owcrm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "owccm" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "ag" |awk '{print $2}' ` 2>/dev/null kill -9 `ps -ef |grep "keeper" |awk '{print $2}' ` 2>/dev/null