Media
- incress volume
pactl set-sink-volume 0 150%
security
- sha1sum
echo -n <password> | sha1sum
echo -n "password" | sha256sum
ArchLinux
- Archlinux 下载源码
abs
makepkg -od
工具
写文档
mkdocs #生成文档网页
mscgen #生成时序图
UMLet #画图
下载
#1
aria2c -x5 -s5 -k1M <url>
#2 curl 分段
curl --range 0-199999999 -o file.part1 -L -- <url>
curl --range 100000000- -o file.part2 -L -- <url>
cat file.part? > file.one
搜索
grep -n -e pattern1 -e pattern2 file1
-n
搜索到的数据显示行号展示
-e
pattern1 多个匹配模式下可以通过这个参数选择,多项关系为任一匹配。
排序
sort -t ':' -k 3 -n /etc/passwd
-t ':'
按照冒号分割每行
-k 3
取第三列的数据排序
-n
将排序的列数据转换成数字排序,默认是按字符串排序的。
查看端口属于哪个程序
lsof -i :8080
查看主机
查看操作系统相关信息 uname -a
查看内核版本 cat /proc/version
查看发行版本信息 cat /etc/issue
Kill Process
ps -ef | grep openvpn | grep -v grep| awk '{print $2}' | xargs sudo kill -9
SETTING
- 设置wireshark Nonroot
sudo usermod -a -G wireshark $USER
- xrand 多屏设置
xrandr --output HDMI1 --auto --primary --output VGA1 --right-of HDMI1 --rotate left
- android 使用 adb 设置可写
# Mount system RW:
mount -o rw,remount,rw /system
# Mount system RO:
mount -o ro,remount,ro /system
XTerm
edit ~/.Xresources
! XTerm*reverseVideo: on xterm*faceName:DejaVu Sans Mono:antialias=True:pixelsize=14 xterm*faceNameDoublesize:WenQuanYi Micro Hei:antialias=True:pixelsize=14 Xterm*locale:zh_CN.UTF-8 XTerm*background: rgb:00/00/00 XTerm*foreground: rgb:ee/ee/ee XTerm*selectToClipboard: true
run command
xrdb ~/.Xresources
开发工具
C 语言分析
qcachegrind gprof2dot
The
nm
command to find symbols.# 在库中查找函数 nm -u <lib_name.[.so][.a]> | grep "<function_name>" # 在obj文件中查找外部函数 nm -g <obj_file> | grep "<external_func>"
The
objdump
command to disassemble a program.# print the disassembly in a readable format. objdump -d -M intel -S <obj_file> #1. The -d flag is to begin the disassembly process. #2. The -M intel option is to print the output in Intel assembly format.
- The
ldd
command to display dynamic dependencies.
shell
ldd <obj_file>
#<obj_file> is the name of your executable along with its path.
- The
addr2line
command to map an address to a location in the program.
shell
addr2line -e <your_program> <mem_addr>
#your_program is the name of your program.
#mem_addr is the address you like to interpret.
- The
lsof
command to identify open files.
shell
#Check the open state of a file.
lsof <path/filename>
# Show files opened under a directory.
lsof +D /home/test/
# Show files opened by a user.
lsof -u <username>
# Show files opened by a process.
lsof -p <process_id>
# Show processes listening on a particular port.
lsof -i :8080
Show all TCP/UDP connections.
lsof -i tcp; lsof -i udp;
The
readelf
command to display ELF information.readelf --symbols ./elfdemo #To get a list of the dynamically linked dependencies for of a binary. readelf -d elfdemo | grep NEEDED
The
od
command to display octal dump.# Show content of a file in octal format. od -b /usr/lib/libc.so # Show content of a file in char format. od -c /usr/lib/libc.so # Show content after skipping some bytes. od -j7 -c /usr/lib/libc.so