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 characters
| #!/bin/bash | |
| # Remove all exited container | |
| docker rm $(docker ps -q -f status=exited) | |
| # Remove none tag images (image with tag <none>) | |
| docker images | grep "<none>" | awk '{print $3}' |xargs docker rmi -f | |
| # Remove all images that is not using by any running container | |
| # note: docker ps --format {{.Image} -> List all images of running container then set it as grep pattern |
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 characters
| sudo fallocate -l 4G /swapfile && \ | |
| sudo chmod 600 /swapfile && \ | |
| sudo mkswap /swapfile && \ | |
| sudo swapon /swapfile && \ | |
| sudo swapon -s && \ | |
| sudo cp /etc/fstab /etc/fstab.bak && \ | |
| echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab |
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 characters
| truncate -s 0 /var/lib/docker/containers/*/*-json.log |
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 characters
| # Set vm max | |
| sudo sysctl vm.max_map_count=262144 |
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 characters
| #!/bin/bash | |
| USER="your_username" | |
| PASSWORD="your_password" | |
| #OUTPUT="/Users/rabino/DBs" | |
| #rm "$OUTPUTDIR/*gz" > /dev/null 2>&1 | |
| databases=`mysql -u $USER -p$PASSWORD -e "SHOW DATABASES;" | tr -d "| " | grep -v Database` |
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 characters
| sudo gitlab-ci-multi-runner unregister --url https://gitlab.com --token=your_runner_token |
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 characters
| git status -s | grep ^U | awk '{print $2}' | xargs git checkout --ours | |
| git status -s | grep ^U | awk '{print $2}' | xargs git add | |
| git commit |
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 characters
| #!/bin/bash | |
| #set -x | |
| # Shows you the largest objects in your repo's pack file. | |
| # Written for osx. | |
| # | |
| # @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
| # @author Antony Stubbs | |
| # set the internal field spereator to line break, so that we can iterate easily over the verify-pack output |
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 characters
| #!/bin/bash | |
| # I. Run this command on your server | |
| # 1. Create new User | |
| adduser your_user | |
| # 2. Add to sudo group | |
| sudo usermod -aG sudo your_user | |
| # 3. Allow to use sudo without password |
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 characters
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteBase / | |
| RewriteRule ^index\.html$ - [L] | |
| RewriteCond %{REQUEST_FILENAME} !-f | |
| RewriteCond %{REQUEST_FILENAME} !-d | |
| RewriteCond %{REQUEST_FILENAME} !-l | |
| RewriteRule . /index.html [L] |
OlderNewer