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 | |
openssl req -nodes -x509 -newkey rsa:2048 -keyout /etc/ssl/private/test.key -out /etc/ssl/private/test.crt -days 30 | |
cat /etc/ssl/private/test.key /etc/ssl/private/test.crt > /etc/ssl/private/test.pem | |
cat <<EOL >> /etc/haproxy/haproxy.cfg | |
defaults | |
mode http | |
timeout client 10s | |
timeout connect 5s | |
timeout server 10s |
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 | |
# update, add docker gpg key, and docker apt repo | |
sudo apt update | |
sudo apt install apt-transport-https ca-certificates curl software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg | |
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | |
sudo apt update | |
apt-cache policy docker-ce | |
if [[ $(grep -i microsoft /proc/version) ]]; then |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"zipCode": "10100", | |
"subDistrictList": [ | |
{ | |
"subDistrictId": "100801", | |
"districtId": "1008", | |
"provinceId": "10", | |
"subDistrictName": "ป้อมปราบ" | |
}, |
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
killport() { | |
while test $# -gt 0 | |
do | |
port_number=$1 | |
pid=$(lsof -P | grep ':'$port_number'[[:space:]](LISTEN)' | awk '{print $2}') | |
if ! kill -QUIT $pid > /dev/null 2>&1; then | |
echo -e "\e[0;31mNo process running on \e[0m $port_number port" >&2 | |
else | |
echo -e "Kill $port_number \e[0;32msuccessfully\e[0m" | |
fi |
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
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64" vagrant plugin install vagrant-libvirt |
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
listen http-in | |
mode http | |
bind *:80 | |
server web1 172.22.20.21:8080 check | |
server web2 172.22.20.22:8080 check | |
server web3 172.22.20.23:8080 check | |
stats enable | |
stats refresh 3s | |
stats show-node | |
stats uri /haproxy?stats |
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 | |
SSH="/usr/local/bin/ssh" | |
case "$*" in | |
*'@'*) $SSH $* ;; | |
*' -l'*) $SSH $* ;; | |
*192\.168*) $SSH -l zdk $*;; | |
*) $SSH -l ec2-user $* ;; | |
esac |
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 | |
set -e | |
SECRETS_MANAGER="aws secretsmanager" | |
REGION="ap-southeast-1" | |
function get_secret { | |
$($SECRETS_MANAGER get-secret-value --secret-id $secret --query SecretString --output text --region $REGION) | |
} | |
function parse_secret { |
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
┌───────────────────────────────┐ | |
│ │ | |
│ │ | |
│ ┌────────────────────┐ │ ┌───────────────────┐ | |
│ │ │ │ │ │ | |
│ │ ┌──────────┐ │ ┌──┼─────│AWS Secrets Manager│ | |
│ │ │ APP │ │ │ │ │ │ | |
│ │ ├──────────┤ │ │ │ └───────────────────┘ | |
│ │ ┌─▶│ ENV │ │ │ │ |
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
┌───────────────────────────────┐ | |
│ ┌────────────────────┐ │ | |
│ │ ┌──────────┐ │ │ | |
│ │ │ APP │ │ │ | |
│ │ └──────────┘ │ │ | |
│ │ ┌──────────┐ │ │ | |
│ │ │ ENV │◀◀──┼──┐ │ ┌───────────────────┐ | |
│ │ └──────────┘ │ │ │ │ │ECS Task Definition│ | |
│ │ Container │ │ └──┼───┤ ENV │ |