https://github.com/buildwithlal/helpful-commands
Some helpful linux commands
https://github.com/buildwithlal/helpful-commands
Last synced: 2 months ago
JSON representation
Some helpful linux commands
- Host: GitHub
- URL: https://github.com/buildwithlal/helpful-commands
- Owner: BuildWithLal
- Created: 2023-12-11T16:17:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-03T16:54:15.000Z (over 1 year ago)
- Last Synced: 2024-07-31T22:51:49.804Z (9 months ago)
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
#### Helpful Commands for Daily Use
###### Disk usage
```
df -h
```###### Find Size of a Dir and its content
```
du -hs /path/to/dir
```###### Find Size of a Dir individual folders and sort by size
```
du -h | sort -h
```###### Add user to sudoers file
```
su root
nano /etc/sudoers
```Then add the user below admin user like below syntax.
```
{YOUR_USERNAME} ALL=(ALL) ALL
```###### use SUDO without password prompt for current user
```
sudo visudo
```In the bottom of the file, add the following line:
```
$USER ALL=(ALL) NOPASSWD: ALL
```###### Check port usage
```
sudo lsof -i :8000
```###### Trigger Kubernetes Job from CronJob
```
kubectl create job --from=cronjob/ -n
```###### Find the current connection slot usage and limits in PostgreSQL
```
select max_conn, used, res_for_super,((max_conn - res_for_super)-used) as res_for_normal
from
(select count(*) used from pg_stat_activity) t1,
(select setting::int res_for_super from pg_settings
where name='superuser_reserved_connections') t2,
(select setting::int max_conn from pg_settings where name='max_connections') t3
```###### Enable COPY PASTE between HOST machine and Virtualbox machine
https://codetryout.com/vbox-guest-additions-ubuntu-22/###### Kdenlive Noise Suppressor Plugin for Ubundu
https://kentwest.neocities.org/westk/librnnoise###### Export all env vars from `.env` before running a script
```
export $(cat .env | xargs) && python main.py
```