Skip to content

Instantly share code, notes, and snippets.

@liwenxiang
liwenxiang / svn.sh
Created October 23, 2014 03:06
svn 操作
用branch 覆盖trunk
svn merge --ignore-ancestry trunk_url branch_url
@liwenxiang
liwenxiang / 年月日时分秒格式
Created October 12, 2014 09:14
年月日时分秒格式
%Y-%m-%d %H-%M-%S
@liwenxiang
liwenxiang / run.sh
Created October 9, 2014 05:38
shell 并发运行
#!/bin/bash
#author : peterguo@tencent.com
#date : 2013.05.24
#sub process do something
function a_sub_process {
echo "processing in pid [$$]"
sleep 1
}
@liwenxiang
liwenxiang / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@liwenxiang
liwenxiang / tips.md
Last active August 29, 2015 14:06
国外创意
@liwenxiang
liwenxiang / compile.sh
Created September 11, 2014 16:45
c++ 调用python
g++ new.cpp -I/usr/include/python2.4 -fPIC -lpython2.4
@liwenxiang
liwenxiang / 生产公钥私钥.md
Created August 17, 2014 14:13
生产公钥私钥
• nginx支持https
	○ http://wangye.org/blog/archives/732/
	○ 生成server.key
		§ openssl genrsa -out ca.key 2048
	○ 利用私钥创建根证书
		openssl req -new -x509 -days 36500 -key ca.key -out ca.crt -subj "/C=CN/ST=Jiangsu/L=Yangzhou/O=Your Company Name/OU=Your Root CA"
	○ openssl genrsa -out server.key 2048
	openssl req -new -key server.key -out server.csr -subj  "/C=CN/ST=Jiangsu/L=Yangzhou/O=Your Company Name/OU=codeboy.name/CN=codeboy.name"
	/O字段内容必须与刚才的CA根证书相同;/CN字段为公用名称(Common Name),必须为网站的域名(不带www);/OU字段最好也与为网站域名,当然选择其他名字也没关系

准备目录

JDK安装

默认是安装到/Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/
cd /System/Library/Frameworks/JavaVM.framework/Versions/
rm CurrentJDK
ln -s /Library/Java/JavaVirtualMachines/jdk1.8.0.jdk/Contents/  CurrentJDK

chrome自定义修改网页

进入Chrome  console 
document.body.contentEditable = 'True'

可以修改网页内容

http://www.ibm.com/developerworks/cn/linux/l-cn-shell-debug/
http://coolshell.cn/articles/1379.html
http://www.cyberciti.biz/tips/debugging-shell-script.html

sed

sed基本模式

[address]s/pattern/replacement/flags

sed可用参数

sed -n 默认sed输出所有的行,此参数表示不输出,常和flag的p配合使用,如 sed -n s/a//p x.txt 表示将x.txt中的所有出现a的行换成b并输出
sed -i sed默认不修改文件而是输出到stdout,此参数表示修改回源文件