Linux development common index

9 篇文章 0 订阅
7 篇文章 0 订阅

(0)Basic command

  1. See file content
cat $certain_file
  1. find a file in specific folder
ls \xxx\xx*
  1. Find a softeare in terminal
apt-cache search $particular_keywords
  1. Download file form a website
wget $specific_webpage
  1. show usb devices:
lsusb
  1. 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
  1. 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
  1. View the space of disk:
df -hl
  1. 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
  1. Update specific software
apt-get upgrade $xxx
  1. Git download all modules
git submodule update --init --recursive
  1. soft link (copy to folder but do not occupy storage)
Ln -s $source $destination
  1. Start ssh
sudo service ssh start
  1. 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

  1. Download “Remote-ssh” extension on vscode !
  2. Config xxx.ssh\config file with format:
Host RV
    HostName 10.10.13.183
    User root
    port 22
  1. Click “connect” bottom on the top right of certain label
  2. Wait and see

(2)ssh on vscode with no password

  1. open terminal on windows plantform and input with
ssh-keygen
  1. Then tap “Enter” key twice till the following sentence occured
C:\Users\Administrator/.ssh/id_rsa already exists
  1. go to folder “C:\Users\Administrator/.ssh/” and ssh-key is stored in file “id_rsa.pub” and copy it.
  2. 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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值