wget https://github.com/rabbitmq/rabbitmq-server/releases/download/rabbitmq_v3_5_1/rabbitmq-server_3.5.1-1_all.deb
sudo dpkg -i rabbitmq-server_3.5.1-1_all.deb
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='user' | |
| pass='pass' | |
| host='host' | |
| cmd="mysql -u $user -p$pass -h $host -e 'SHOW GLOBAL STATUS;'" | |
| remoteCall='uptime' | |
| if ! /bin/bash -c "$cmd"; | |
| then |
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
| # Given | |
| Given I am on [the] homepage | |
| Given I am on "url" | |
| # When | |
| When I go to [the] homepage | |
| When I go to "url" | |
| When I reload the page |
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 | |
| checkSizeOver() { | |
| typeset -i LFSB LFSM LOG_SIZE=10 | |
| LF=$1 | |
| LOG_SIZE=$2 | |
| LFSB=$(stat -c "%s" $LF) | |
| # This is bytes - turn into MB, base 2} | |
| LFSM=${LFSB}/1048576 | |
| # This is bytes - turn into MB, base 2 | |
| if [ $LFSM -gt $LOG_SIZE ] |
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 | |
| #Removes files older than 14 days from directory | |
| #allows to set autoclean up some temp directory | |
| find ~/Downloads/* -mtime +14 -exec rm -rf {} \; | |
| #synchronize dirs with remote server | |
| rsync -avz --progress user@server:/some/path ./some_local_dir |
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 | |
| HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` | |
| dirs=('var' 'pub/media' 'pub/static') | |
| function fix_permission { | |
| sudo chmod -R +a "$HTTPDUSER allow delete,write,append,file_inherit,directory_inherit" $1 | |
| sudo chmod -R +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" $1 | |
| } |
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 775 for all directories | |
| find . -type d -exec chmod 775 {} \; | |
| #set 664 for all files | |
| find . -type f -exec chmod 664 {} \; |
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/sh | |
| # Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh | |
| # and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos | |
| if [ "`/usr/bin/whoami`" != "root" ]; then | |
| echo "You need to execute this script as root." | |
| exit 1 | |
| fi | |
| cat > /etc/yum.repos.d/centos.repo<<EOF |
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 | |
| # Delete all containers | |
| docker rm $(docker ps -a -q) | |
| # Delete all images | |
| docker rmi $(docker images -q) |
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
| def fib(n): | |
| if n <= 2: | |
| return 1 | |
| else: | |
| return fib(n-1) + fib(n-2) |