-
Notifications
You must be signed in to change notification settings - Fork 0
/
cheat_sheet
61 lines (43 loc) · 2.59 KB
/
cheat_sheet
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#HOSTAPD
#checking who is connecting to me
sudo hostapd_cli all_sta
###The LIFX now works for CHANNEL 1, WPA 2
## Detect wifi channels
sudo iwlist wlp4s0 scan | grep Frequency | sort | uniq -c | sort -n
## nc is a useful tool for conducting network testing
## Use bmon to monitor the network traffic
## Use the following command line to read from file to tcpdump command
## sudo nohup tcpdump $(cat easyfilter)
## Note, the file path following the -w must be a full path, which means that neither $HOME nor ~ could be recognized by the tcpdump. Also, should not use tcpdump "$(cat easyfiler)", in which case tcpdump will recognize the every args following -i as the interface name, for unknown reason
## location of interface.d and interface
/etc/network/interface
### The following describes daemon and service
## location of the system.d or .service file
/lib/systemd/system or /etc/systemd/system
https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units
## usable list for service
systemctl list-units
## another way of checking service, which should return the identical result
service snort status
###How to start hostapd, we can use the /run/hostapd.pid file to find the pid of the process so as to kill it
/usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
#or the following
sudo hostapd -dd /etc/hostapd/hostapd.conf
##Backup with rsync
sudo rsync -aHv --exclude-from /home/kun/Rpi_Bak/ersync-exculde.txt --rsh="ssh" [email protected]:/ ~/Rpi_Bak/bak
##Store Iptables
sudo sh -c "iptables-save > /etc/iptables/rules.v4"
##Crontab
sudo crontab -e
##change my mac address
/etc/init.d/networking stop
ifconfig eth0 hw ether 02:01:02:03:04:08
/etc/init.d/networking start
## dictionary StarDict Console Version
dict word or
sdcv word
## dmesg is the tool to log boot information before the syslog daemon is setup in the kernal buffer ring, such that all information can be read.
## GRUB2 is a boot instruction program such that to control which os, and how that os be booted after reading MBR. I used the dmesg to track how the network interfaces being renamed and the use th GRUB to configure the network interface to be no-renamed. can be seen from /etc/default/grub. Following the link
http://www.itzgeek.com/how-tos/mini-howtos/change-default-network-name-ens33-to-old-eth0-on-ubuntu-16-04.html
## However, this only solv for the pci device, not for a usb device. Then I follow the following link to disable the network rename rules.
https://askubuntu.com/questions/826325/how-to-revert-usb-wifi-interface-name-from-wlxxxxxxxxxxxxx-to-wlanx