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
#useage: qrcode yourcontent | |
#then you will get a qrcode png file which included to your content | |
function qrcode() { | |
content=$1 | |
savename=$(date +%Y%m%d)"_"${content:0 :4 }".png" | |
url="https://chart.googleapis.com/chart?cht=qr&chld=H&chs=200x200&chl=" | |
req=$url$content | |
curl $req > $savename |
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
#netstat version | |
netstat -i | awk '{print $1,"\t",$4}' | |
#ifconfig version | |
ifconfig -a | grep 'inet*' |
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
#说明 | |
#1. [ -z "$1" ] 判断字符串是否为空 | |
#2. [ $1 == "off" ] && foo 简化的if写法 | |
#3. nohup foo & 让程序在后台运行 | |
#4. xargs 让管道的输出作为args (正常情况管道的输出是作为标准输入) | |
function goagent() { | |
if [ -z "$1" ] ; then | |
echo "Args too few" | |
echo "e.g. goagent on" |
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
#mac下的sshd配置文件 | |
/etc/sshd_config | |
#启动 | |
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist | |
#停止 | |
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist | |
#查看 |
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
#1 | |
'(.+?)\{([\s\S.]+?)\}' | |
#2 | |
'([\n\r\t\s\S]*?)(([\t\n])[a-zA-Z-]+?):(.+);([\n\t\s\S]*?)' | |
#3 | |
'([\s]*?)([-]*?)([0-9]+)' |
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
#define GOOGLE_AUDIO_URL @"http://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=zh-CN" | |
[self uploadAudioToGoogle:GOOGLE_AUDIO_URL]; | |
- (void) uploadAudioToGoogle:(NSString *)sURL | |
{ | |
NSLog(@"%@", sURL); | |
NSURL *url = [NSURL URLWithString:sURL]; | |
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; |
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
<2a080000 00000000 0a000000 0a000000 234a0000 01000000>* | |
<c6070000 00000000 0a000000 0a000000 210a0000 02000000>* | |
<63070000 00000000 0a000000 0a000000 20490000 03000000>* | |
<ff060000 00000000 0a000000 0a000000 1f090000 04000000>* | |
<9c060000 00000000 0a000000 0a000000 1e480000 05000000>* | |
<38060000 00000000 0a000000 0a000000 1c080000 06000000>* | |
<d5050000 00000000 0a000000 0a000000 1b470000 07000000>* | |
<71050000 00000000 0a000000 0a000000 1a070000 08000000>* | |
<0e050000 00000000 0a000000 0a000000 19460000 09000000> | |
<aa040000 00000000 0a000000 0a000000 17060000 0a000000> |
NewerOlder