RedHat (CentOS)
List any process listening to the given port: lsof -i:5000
To kill a process by ID: kill 12345
Create a symbolic link: ln -s [target dir] [symlink name]
Find a symbolic link(s): find . -type l -ls
Create a recursive dir: mkdir -p foo/bar/blek
Remove user from a group: gpasswd --delete user group
Change file permission: chmod -R 755 my/files
Change ownership of file: chown owner_name file_name
Change the group ownership of file: chown :group1 file1.text
Check disk space: df -h --total
Generate ssh key: ssh-keygen
Verify that the swap space in disk is active: sudo free -h
Run script in the background. E.g:
- yarn command:
nohup yarn start &
- python command:
nohup python3 /path/to/app.py &
- npm command:
nohup npm run start:app &
- nohup w/out generating the output file:
nohup [some command] > /dev/null 2>&1&
Node
Run js file with environment variables: node --env-file .env build/src/index.js
Nginx
Restart nginx server: service nginx restart
Increase memory when running node: set NODE_OPTIONS=--max_old_space_size=4096
Git
Clear cache: git rm -r --cached .
Python
Install packages based on requirements: pip3 install -r /path/to/requirements.txt
Visual Studio Code
Search Files: Command + shift + F
Copy line down: Shift + alt + Down arrow
Copy line up: Shift + alt + Up arrow
Delete line: Ctrl + shift + K
Plugin: Prettier
Format document: Shift + alt + F
Top comments (0)