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
| #!/usr/bin/env python | |
| # vim: set fileencoding=utf-8 | |
| # | |
| # USAGE: | |
| # Back up your tmux old config, run the script and redirect stdout to your conf | |
| # file. Example: | |
| # | |
| # $ cp ~/.tmux.conf ~/.tmux.conf.orig | |
| # $ python ./tmux-migrate-options.py ~/.tmux.conf.orig > ~/.tmux.conf | |
| # |
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 | |
| if git rev-parse --verify HEAD >/dev/null 2>&1 | |
| then | |
| against=HEAD | |
| else | |
| # Initial commit: diff against an empty tree object | |
| against=4b825dc642cb6eb9a060e54bf8d69288fbee4904 | |
| fi | |
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
| url - https://aws.amazon.com/blogs/security/a-safer-way-to-distribute-aws-credentials-to-ec2/ | |
| Finding hard-coded credentials in your code | |
| Hopefully you’re excited about deploying credentials to EC2 that are automatically rotated. Now that you’re using Roles, a good security practice would be to go through your code and remove any references to AKID/Secret. We suggest running the following regular expressions against your code base: | |
| Search for access key IDs: (?<![A-Z0-9])[A-Z0-9]{20}(?![A-Z0-9]). In English, this regular expression says: Find me 20-character, uppercase, alphanumeric strings that don’t have any uppercase, alphanumeric characters immediately before or after. | |
| Search for secret access keys: (?<![A-Za-z0-9/+=])[A-Za-z0-9/+=]{40}(?![A-Za-z0-9/+=]). In English, this regular expression says: Find me 40-character, base-64 strings that don’t have any base 64 characters immediately before or after. | |
| If grep is your preferred tool, run a recursive, Perl-compatible search using the following commands |
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 | |
| MYSQLADMIN_CFG="/etc/mysql/mariadb.conf.d/90-mysqladmin.cnf" | |
| # generate password | |
| PASS=$(perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..16)'); | |
| # adjust /etc/mysql/debian.cnf (used as defaults file by system scripts) | |
| sed -i "s/^password =.*$/password = ${PASS}/" /etc/mysql/debian.cnf | |
| sed -i "s/^user =.*$/user = debian-sys-maint/" /etc/mysql/debian.cnf | |
| # create config file for mysqladmin itself (maybe not needed) | |
| umask 066 | |
| cat > ${MYSQLADMIN_CFG} <<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
| #!/usr/bin/env ruby | |
| # | |
| # .git/hooks/prepare-commit-msg に配置する | |
| # コミットメッセージのテンプレ追加 | |
| if ARGV[1] && ARGV[1].include?("message") | |
| files = `git diff --cached --name-only` | |
| change_files = files.split("\n") |
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
| ls | xargs -IFILES echo FILES |
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
| Chapter 10 |
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 | |
| wget -O - http://nginx.org/keys/nginx_signing.key | sudo apt-key add - | |
| # For nginx mainline | |
| sudo sh -c 'echo "deb http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list' | |
| sudo sh -c 'echo "deb-src http://nginx.org/packages/mainline/ubuntu/ trusty nginx" >> /etc/apt/sources.list' | |
| sudo apt-get update | |
| sudo apt-get install nginx |
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
| <?xml version="1.0" encoding="utf-8"?> | |
| <resources> | |
| <color name="red_50">#fde0dc</color> | |
| <color name="red_100">#f9bdbb</color> | |
| <color name="red_200">#f69988</color> | |
| <color name="red_300">#f36c60</color> | |
| <color name="red_400">#e84e40</color> | |
| <color name="red_500">#e51c23</color> | |
| <color name="red_600">#dd191d</color> | |
| <color name="red_700">#d01716</color> |
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
| Chapter 9 |
NewerOlder