Skip to content

horopchanu/linux-cheaTricks

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

linux-cheaTricks by yarscript

It could be useful


SSH connection

ssh user@225.225.225.1 -i ~/.ssh/some_key.pem

Change PHP/Python(?) Version Linux

sudo update-alternatives --set php /usr/bin/php8.0
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 2

Create Symlink

ln -s /opt/foo /usr/bin/bar

Install Xdebug

sudo apt install php-xdebug
sudo phpenmod -v 7.3 xdebug

Redis cli login & changepass

redis-cli -a redispass
config set requirepass ""

Remove package ubuntu

sudo apt-get --purge remove octave3.2

Installed packages list

dpkg -l OR apt list
dpkg -l | grep apt # SEARCH "apt"

Install package with version ubuntu

sudo apt install apt-transport-https=1.4.10

Download / Upload file terminal | ssh

scp root@servername.com:/tmp/1.sql ~/Downloads/1.sql  # Download
scp ~/1.sql root@servername.com:/tmp                  # Upload

Processes

pstree                                                # Tree
htpp                                                  # Informative

Draw tree in terminal

tree -L 4 dir_name

Run commant in background

(npm run start&)

Killing

sudo xkill                                             # Interactive kill 
sudo kill -9 $(sudo lsof -t -i:9001)                   # Kill by port
sudo kill -9 1234                                      # Kill by pid

.tar.gz EXTRACT

tar -xf archive.tar.gz

PostgreSQL install

sudo apt install postgresql postgresql-contrib
sudo -i -u postgres
psql
\q

About

It could be useful

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published