[command with duplicate output |] awk '!a[$0]++' [filename with duplicate values]
This file contains 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 | |
# | |
# Recursive chmod for directories and files. | |
# | |
# all directories within the current path to 755 (-rwxr-xr-x) | |
find . -type d -exec chmod 755 {} \; | |
# all files within the current path to 644 (-rw-r--r--) |
This file contains 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 | |
# | |
# Delete the whole data created by the user. TAKE CARE!!! | |
# | |
# kill all running containers | |
docker kill $(docker ps -q) | |
# delete all containers |
This file contains 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 | |
# | |
# Find files containing a string | |
# | |
grep -rnw /path/to/search/ -e "<PATTERN>" |
This file contains 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 | |
# | |
# An alternative to killall command | |
# | |
kill -9 $(pgrep <PROCESS_NAME>) |
This file contains 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
# get CONTAINER_ID with 'docker ps' | |
docker exec -it <CONTAINER_ID> bash | |
# or with docker-compose | |
docker-compose exec <CONTAINER_NAME> bash |
This file contains 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
# | |
# Avoid the message 'External file changes sync may be slow: The current inotify(7) watch limit is too low.' from JetBrains products. | |
# | |
# 1. Create the file /etc/sysctl.d/60-jetbrains.conf and paste this code | |
# 2. Restart the sysctl service: sudo sysctl -p --system | |
# 3. Restart the IDE | |
# | |
# More info: | |
# https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit |
This file contains 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 | |
process() { | |
if [ $# -eq 1 ] && ([ "$1" = "-h" ] || [ "$1" = "--help" ]); then | |
show_help | |
else | |
launch_containers | |
while true; do | |
case $1 in |
OlderNewer