一些难记的Linux命令
显示所有进程信息,连同命令行: ps -ef
杀死进程(等同于Ctrl+C): kill -s 2 pid
根据进程名获取PID:ps -ef | grep name | grep -v grep | awk '{print $2}'
设置变量:pid=$(ps -ef | grep name | grep -v grep | awk '{print $2}')
杀死指定进程:kill -s 2 $pid
查看systemctl日志: journalctl -u service-name.service
创建symlink: ln -sf source ...
Wireshark: Chrome浏览器https抓包
目前该方案只支持 Chrome 和 Firefox 浏览器,通过设置 SSLKEYLOGFILE 环境变量,可以指定浏览器在访问 SSL/TLS 网站时将对应的密钥保存到本地文件中,有了这个日志文件之后 wireshake 就可以将报文进行解密了。
首先设置SSLKEYLOGFILE环境变量,指定文件路径。
配置Wireshake,Edit->Preferences->Protocols->TLS->(pre)-Master-Secret log filename,输入上面配置环境变量的路径。
重启浏览器,进行抓包
iOS - 奇葩警告及报错
linking against a dylib which is not safe for use in application extensions
因为app extension限制了某些API的使用, ( App Extensions不能使用的一些API ) ,因此在自定义自己的framework后,这个framework可能包含了某些在App Extensions里不能使用的API,因此为了安全起见才会给出这个警告。
选中自定义framework的target,然后选中Build Settings,(记住选择All,而不是Basic),在过滤框中输入"...
正则表达式
转义字符
. $ ^ { [ ( | ) * + ? \
字符匹配
[character_group] 匹配 character_group中的任何单个字符。
[^character_group] 匹配不在character_group中的任意单个字符匹配。
[first-last] 匹配从first到last的范围中的任意单个字符匹配。
. 匹配除\n之外的任意单个字符。
\w 匹配任何单词字符。
\W 匹配任何非单词字符。
\s 匹配任何空白字符。
\S 匹配任何非空白字符。
\d 匹配任何十进制数字。
\D 匹配不是十进制数的任意字符。
定位点
...
MySQL Installation
Ubuntu下安装
bash
sudo apt-get install mysql-server
登录MYSQL
根用户登录
bash
mysql -u root -p
指定用户名密码登录
bash
mysql --user=user_name --password=your_password
创建用户
bash
CREATE USER 'user_name'@'localhost' IDENTIFIED BY 'password';
CREATE USER 'user_name'@'%' IDENTIFIED BY 'passwo...
ffmpeg
Download
bash
ffmpeg -i http://www.xxx.com/xxx.m3u8 name.mp4
Mp3 to m3u8
bash
ffmpeg -i source.mp3 -c:a libmp3lame -b:a 128k -map 0:0 -f segment -segment_time 10 -segment_list name.m3u8 -segment_format mpegts name%03d.ts
Angular
更新Angular CLI
bash
npm uninstall -g angular-cli
npm cache verify
sudo npm install -g @angular/cli@latest
使用ng version查看当前安装的版本
更新Angular
bash
ng update @angular/core
创建项目
创建Angular项目目录
bash
ng new angular-apps --createApplication=false --minimal=true
创建Angular应用
bash
ng generate...
C#、Swift、Kotlin、Java语法对比
基本类型
|c#|swift|kotlin|java|
|--|-----|------|----|
|byte|-|Byte|byte|
|bool|Bool|Boolean|boolean|
|int|Int|Int|int|
|long|-|Long|long|
|float|Float|Float|float|
|double|Double|Double|double|
|string|String|String|String|
|decimal|Decimal|BigDecimal|BigDecimal|
可空类型
|c#|s...
Git简单命令说明
config
git config --local user.name "tongqijie"
git config --local user.email "tongqijie@hotmail.com"
git config credential.helper store
pull
git pull
push
git push
clone
git clone [remove-repository] [local folder]
Chnages
git status
Stage untracked/modified files/folder
git...
Android开发纪要
adb文件位置: AndroidSdk\platform-tools\adb.exe
模拟进程被杀死命令: adb shell am kill package-name
截图并保存到PC: adb shell /system/bin/screencap -p /sdcard/screenshot.png & adb pull /sdcard/screenshot.png "this/is/target/folder"
模拟屏幕按压: adb shell input swipe 100 100 120 120 1000
打开Android Device Moni...