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 | |
| #name=($@) | |
| name=(`cat file`) | |
| for (( i=0;i<${#name[@]}; i++ )) | |
| do | |
| touch ${name[$i]} | |
| if [ $? -eq 0 ]; then | |
| rename=$(sed 's/-/_/g' <<< ${name[$i]} ) |
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
| ## rsync files | |
| rsync -av --progress sourcefolder /destinationfolder --exclude thefoldertoexclude | |
| ## Check If file exist and do | |
| #!/bin/bash | |
| file="/etc/hosts" | |
| if [ -f "$file" ] | |
| then | |
| echo "$file found." | |
| else |
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
| fallocate -l 50G big_file | |
| truncate -s 50G big_file | |
| dd of=bigfile bs=1 seek=50G count=0 |
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
| yum install kernel-devel-$(uname -r) kernel-headers-$(uname -r) dkms -y | |
| vagrant plugin install vagrant-vbguest |
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 docker ps -a | grep Exit | cut -d ' ' -f 1 | xargs sudo docker rm | |
| docker stop $(docker ps -a -q) | |
| docker rm $(docker ps -a -q) | |
| #You can then remove untagged images if you rebuilt the same version with | |
| docker rmi $(docker images | grep "^<none>" | awk "{print $3}") | |
| 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
| server { | |
| listen 0.0.0.0:80; | |
| server_name awsaudit.com www.awsaudit.com; | |
| access_log /var/log/nginx/awsaudit.com.access.log; | |
| root /var/www/schoolofdevops/www; | |
| try_files $uri /index.php?$args; | |
| set $cache_uri $request_uri; |
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
| user www-data; | |
| worker_processes 4; | |
| pid /run/nginx.pid; | |
| events { | |
| worker_connections 768; | |
| # multi_accept on; | |
| } | |
| http { |
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
| default_type application/octet-stream; | |
| ## | |
| # Logging Settings | |
| ## | |
| access_log /var/log/nginx/access.log; | |
| error_log /var/log/nginx/error.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
| http://www.markdowntutorial.com/lesson/2/ | |
| http://www.markdown-tutorial.com/#/lesson/6 |
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
| SSH ( Secure Shell ) is widely used for remote login to Linux servers. | |
| When we login to a remote system using ssh,it prompts for password and then only allow us to login to server. | |
| This article will help you to Setup SSH without password in Linux Systems suing ssh ( rsa/dsa ) key pair. | |
| Step 1: Generate SSH Key Pair | |
| Firstly you would required to generate a key pair (RSA or DSA), you can specify option rsa or dsa key using ‘t’ command line switch. If we do not pass -t parameter, it will create rsa key by default. |