Last active
January 17, 2020 17:03
-
-
Save Gamblt/074a697befcec9d4be9e96c9af0f81e1 to your computer and use it in GitHub Desktop.
Revisions
-
Gamblt renamed this gist
Jan 17, 2020 . 1 changed file with 23 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ Create sudo user with bash and homedir: useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser ######################################################### FILES Truncate file truncate -s 0 /var/log/syslog @@ -18,6 +21,8 @@ Remove files by mask find ./path_to_find -name "*.spec.ts" -type f -delete ######################################################## DISK Disk Info: sudo aprted -l sudo df -h @@ -30,9 +35,27 @@ SSH keys ssh-keygen -t rsa ~/.ssh/authorized_keys ######################################################## NETWORK Show LISTEN ports netstat -ntlp | grep LISTEN #Show ports2 sudo iptables -t nat -L -n ######################################################## DOCKER #Show all docker containers internal IP #For common docker docker inspect -f '{{.Name}} - {{.NetworkSettings.IPAddress }}' $(docker ps -aq) #For docker-compose usage docker inspect -f '{{.Name}} - {{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $(docker ps -aq) ######################################################## DATABASE DB. Import big file by console psql --host=127.0.0.1 --port=5432 --dbname=mycity --username=mycity --password -f /path_dump/dump.sql -
Gamblt revised this gist
Jan 17, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ Create sudo user with bash and homedir: useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser Truncate file truncate -s 0 /var/log/syslog Find folders and set access for them: sudo find . -type d -exec chmod 755 {} + -
Gamblt revised this gist
Sep 15, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,6 +11,9 @@ Delete: find . -name "*.bak" -type f -delete Remove *.gz files older than 1 day find ./path_to_find -name "*.gz" -type f -mtime +1 -exec rm {} \; Remove files by mask find ./path_to_find -name "*.spec.ts" -type f -delete Disk Info: sudo aprted -l -
Gamblt revised this gist
Sep 15, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -26,3 +26,7 @@ ssh-keygen -t rsa Show LISTEN ports netstat -ntlp | grep LISTEN DB. Import big file by console psql --host=127.0.0.1 --port=5432 --dbname=mycity --username=mycity --password -f /path_dump/dump.sql -
Gamblt revised this gist
Sep 5, 2016 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,6 +4,10 @@ useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser Find folders and set access for them: sudo find . -type d -exec chmod 755 {} + Get/Delete files by mask: Check: find . -name "*.bak" -type f Delete: find . -name "*.bak" -type f -delete Remove *.gz files older than 1 day find ./path_to_find -name "*.gz" -type f -mtime +1 -exec rm {} \; -
Gamblt revised this gist
Jun 9, 2016 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -19,3 +19,6 @@ sudo du --max-depth=1 2> /dev/null | sort -n -r | head -n20 SSH keys ssh-keygen -t rsa ~/.ssh/authorized_keys Show LISTEN ports netstat -ntlp | grep LISTEN -
Gamblt revised this gist
May 31, 2016 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,4 +14,8 @@ sudo df -h sudo df -h --output=source,fstype,size,used,avail,pcent,target -x tmpfs -x devtmpfs Show largest directorries in current path: sudo du --max-depth=1 2> /dev/null | sort -n -r | head -n20 SSH keys ssh-keygen -t rsa ~/.ssh/authorized_keys -
Gamblt revised this gist
May 31, 2016 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,4 +5,13 @@ Find folders and set access for them: sudo find . -type d -exec chmod 755 {} + Remove *.gz files older than 1 day find ./path_to_find -name "*.gz" -type f -mtime +1 -exec rm {} \; Disk Info: sudo aprted -l sudo df -h sudo df -h --output=source,fstype,size,used,avail,pcent,target -x tmpfs -x devtmpfs Show largest directorries in current path: sudo du --max-depth=1 2> /dev/null | sort -n -r | head -n20 -
Gamblt revised this gist
May 31, 2016 . 1 changed file with 7 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,8 @@ Create sudo user with bash and homedir: useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser Find folders and set access for them: sudo find . -type d -exec chmod 755 {} + Remove *.gz files older than 1 day find ./path_to_find -name "*.gz" -type f -mtime +1 -exec rm {} \; -
Gamblt created this gist
May 31, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ Create sudo user with bash and homedir: useradd -m -d /home/testuser/ -s /bin/bash -G sudo testuser