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
| { | |
| "agent": { | |
| "metrics_collection_interval": 10, | |
| "logfile": "/opt/aws/amazon-cloudwatch-agent/logs/amazon-cloudwatch-agent.log" | |
| }, | |
| "metrics": { | |
| "metrics_collected": { | |
| "cpu": { | |
| "resources": [ | |
| "*" |
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
| [Unit] | |
| Description=PostgreSQL container | |
| Requires=docker.service | |
| After=docker.service | |
| [Service] | |
| Restart=on-failure | |
| RestartSec=10 | |
| ExecStartPre=-/usr/bin/docker stop postgres | |
| ExecStartPre=-/usr/bin/docker rm postgres |
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
| # How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli | |
| KEY_ID=alias/my-key | |
| SECRET_BLOB_PATH=fileb://my-secret-blob | |
| SECRET_TEXT="my secret text" | |
| ENCRYPTED_SECRET_AS_BLOB=encrypted_secret_blob | |
| DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target | |
| encrypt-text: |
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 | |
| FILE=/home/ubuntu/mysql_backup/mysql-credentials.cnf | |
| if [ -f "$FILE" ]; then | |
| echo "$FILE exists." | |
| rm $FILE | |
| else | |
| echo "$FILE does not exist." | |
| fi | |
| credentialsFile=/home/ubuntu/mysql_backup/mysql-credentials.cnf |
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
| # Let us consider the following typical mysql backup script: | |
| mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
| # It succeeds but stderr will get: | |
| # Warning: Using a password on the command line interface can be insecure. | |
| # You can fix this with the below hack: | |
| credentialsFile=/mysql-credentials.cnf | |
| echo "[client]" > $credentialsFile | |
| echo "user=$mysqlUser" >> $credentialsFile | |
| echo "password=$mysqlPassword" >> $credentialsFile |
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
| import yaml | |
| import gitlab | |
| from prettytable import PrettyTable | |
| ############################# | |
| # THIS SCRIPT WILL PRINT THE SHORT COMMIT_ID,AUTHOR,DATE,TITLE OF COMMIT FROM GITLAB API | |
| ############################## | |
| ########################################################################################### | |
| # 1. Create the personal access token in the gitlab profile settings then user in th eprivate_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
| Key Sublime Text 3.2.1 Build 3207 | |
| ----- BEGIN LICENSE ----- | |
| Member J2TeaM | |
| Single User License | |
| EA7E-1011316 | |
| D7DA350E 1B8B0760 972F8B60 F3E64036 | |
| B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD | |
| FA0A2ABE 25F65BD8 D51458E5 3923CE80 | |
| 87428428 79079A01 AA69F319 A1AF29A4 | |
| A684C2DC 0B1583D4 19CBD290 217618CD |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| $init = <<-SHELL | |
| yum update -y | |
| # SELinux 無効 | |
| setenforce 0 | |
| sed -i 's/^SELINUX=enforcing$/SELINUX=disabled/' /etc/selinux/config | |
| # firewall 無効 | |
| systemctl disable --now firewalld |
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=beta | |
| disk=4096 | |
| swap=1024 | |
| mem=4096 | |
| suite=precise | |
| ip="192.168.199.199" | |
| cpu=8 |
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 | |
| # ------------------------------------------------------------------------------ | |
| # FILE: autossh | |
| # DESCRIPTION: This is an SSH-D proxy with auto-reconnect on disconnect | |
| # AUTHOR: Hector Nguyen (hectornguyen at octopius dot com) | |
| # VERSION: 1.0.0 | |
| # ------------------------------------------------------------------------------ | |
| VERSION="1.0.0" | |
| GITHUB="https://github.com/hectornguyen/autossh" | |
| AUTHOR="Hector Nguyen" |