Skip to content

Instantly share code, notes, and snippets.

View ziggear's full-sized avatar
😀
Enjoy opensource

Ziggear ziggear

😀
Enjoy opensource
  • Some Company
  • Earth
View GitHub Profile
<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>
#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];
#1
'(.+?)\{([\s\S.]+?)\}'
#2
'([\n\r\t\s\S]*?)(([\t\n])[a-zA-Z-]+?):(.+);([\n\t\s\S]*?)'
#3
'([\s]*?)([-]*?)([0-9]+)'
#mac下的sshd配置文件
/etc/sshd_config
#启动
sudo launchctl load -w /System/Library/LaunchDaemons/ssh.plist
#停止
sudo launchctl unload -w /System/Library/LaunchDaemons/ssh.plist
#查看
#说明
#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"
#netstat version
netstat -i | awk '{print $1,"\t",$4}'
#ifconfig version
ifconfig -a | grep 'inet*'
#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
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *oneCell = [tableView cellForRowAtIndexPath: indexPath];
if (oneCell.accessoryType == UITableViewCellAccessoryNone) {
oneCell.accessoryType = UITableViewCellAccessoryCheckmark;
} else
oneCell.accessoryType = UITableViewCellAccessoryNone;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
}
#(1)引导后按tab, 在后面追加数字3 .
#(2)root登录执行命令
/usr/sbin/anaconda --liveinst --method=livecd:///dev/mapper/live-osimg-min
#(3) 修改默认启动到文本界面
cd /etc/systemd/system
ln -s /lib/systemd/system/multi-user.target default.target
#Google
#:faster one
8.8.8.8
8.8.4.4
#V2EX
#:boost appstore speed
199.91.73.222
178.79.131.110