(0)Basic command
- See file content
cat $certain_file
- find a file in specific folder
ls \xxx\xx*
- Find a softeare in terminal
apt-cache search $particular_keywords
- Download file form a website
wget $specific_webpage
- show usb devices:
lsusb
- See which program dominated the port
#print certain port message from eth0 network card
tcpdump -i eth0 -nnA 'port 443'
#see pid by port
lsof -i:443
#see port by pid
netstat -anp|grep pid
#see pid by process name
pgrep name
- Error handle : “cannot open shared object file: No such file or directory”
sudo gedit ~/.bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/path
source ~/.bashrc
- View the space of disk:
df -hl
- Mirror local port to public network server
- Download particular zip file at Link according to your system and cpu.Or you can compile the source file yourself.
Modify frps.ini on server A and set the bind_port to be connected to frp clients:
# frps.ini
[common]
bind_port = 7000
Start frps on server A:
./frps -c ./frps.ini
#or run in background
nohup ./frps -c frps.ini >/dev/null 2>&1 &
- On server B, modify frpc.ini to put in your frps server public IP as server_addr field:
# frpc.ini
[common]
server_addr = x.x.x.x
server_port = 7000
[ssh]
type = tcp
local_ip = 127.0.0.1
local_port = 22
remote_port = 6000
-
Note that local_port (listened on client) and remote_port (exposed on server) are for traffic goes in/out the frp system, whereas server_port is used between frps.
-
Start frpc on server B:
./frpc -c ./frpc.ini
#Or run in background
nohup ./frpc -c frpc.ini >/dev/null 2>&1 &
- From another machine, SSH to server B like this (assuming that username is test):
ssh -oPort=6000 test@x.x.x.x
- Update specific software
apt-get upgrade $xxx
- Git download all modules
git submodule update --init --recursive
- soft link (copy to folder but do not occupy storage)
Ln -s $source $destination
- Start ssh
sudo service ssh start
- Git common command
#Git global setup
git config --global user.name "Asil"
git config --global user.email "XXXX@gmail.com"
#Create a new repository
git clone ssh://git@gitlab.xxxx.com:8322/Lee/1_2_test.git
cd 1_2_test
touch README.md
git add README.md
git commit -m "add README"
git push -u origin master
#Push an existing folder
cd existing_folder
git init
git remote add origin ssh://git@gitlab.xxxx.com:8322/Lee/1_2_test.git
git add .
git commit -m "Initial commit"
git push -u origin master
#Push an existing Git repository
cd existing_repo
git remote rename origin old-origin
git remote add origin ssh://git@gitlab.xxxx.com:8322/Lee/1_2_test.git
git push -u origin --all
git push -u origin --tags
(1)ssh on vscode
- Download “Remote-ssh” extension on vscode !
- Config xxx.ssh\config file with format:
Host RV
HostName 10.10.13.183
User root
port 22
- Click “connect” bottom on the top right of certain label
- Wait and see
(2)ssh on vscode with no password
- open terminal on windows plantform and input with
ssh-keygen
- Then tap “Enter” key twice till the following sentence occured
C:\Users\Administrator/.ssh/id_rsa already exists
- go to folder “C:\Users\Administrator/.ssh/” and ssh-key is stored in file “id_rsa.pub” and copy it.
- Go to folder “/root” or “/home”, and check if there is a folder named with “.ssh”. If existed, cd to this “.ssh” folder, if not, you need to create folder “.ssh” in each path and have a try. Once you cd to the “.ssh” path:
touch authorized_keys
and copy the whole content of “id_rsa.pub” to file authorized_keys
5. reopen the vscode and you will find there will not need to type password anymore
(3)Connect wifi on terminal
view device list:
sudo nmcli dev
```bash
turn on wifi:
```bash
sudo nmcli r wifi on
scan wifi nearby:
sudo nmcli dev wifi
connect to specific wifi:
sudo nmcli dev wifi connect "SSID" password "xxxx" ifname wlan0
example:
sudo nmcli dev wifi connect "E2:B8:E6:01:86:2F" password "xxxx" ifname wlan0
(4)Close and open graph interface
close:
systemctl set-default multi-user.target
open:
systemctl set-default graphical.target
(5)Connect with 4G on rv1126
- first Dial
pppd call quectel-ppp &
- then add remote
route add default dev ppp0
- then test
- Reference: R1