Skip to content

Instantly share code, notes, and snippets.

View 9to6's full-sized avatar
🏠
Working from home

Gunner Kwon 9to6

🏠
Working from home
View GitHub Profile
@9to6
9to6 / diff.md
Last active February 26, 2021 02:55
AMI Cleaning opensource
@9to6
9to6 / execute.sh
Created February 12, 2020 05:36
node exporter only enable Text Collect
#!/bin/bash
./node_exporter --web.disable-exporter-metrics --collector.textfile.directory "/home/9to6/tmp" \
--no-collector.arp \
--no-collector.bcache \
--no-collector.bonding \
--no-collector.buddyinfo \
--no-collector.cpu \
--no-collector.cpufreq \
--no-collector.cpu.info \
--no-collector.conntrack \
@9to6
9to6 / apply_acl_to_all_obj.sh
Created October 21, 2019 10:07
s3 public ACL script
aws --profile 9to6 s3api list-objects --bucket bucket_name |while read line
do
echo $line
command=$(echo "aws --profile 9to6 s3api put-object-acl --acl public-read --bucket bucket_name --key $line")
echo "$command"
bash -c "$command"
done
@9to6
9to6 / run.sh
Created October 10, 2019 04:46
The command to remove old directories exclude last two
ls -ld */ | grep "$DIRECTORY_NAME" |head -n -2 | awk '{print $9}' |xargs rm -rf
@9to6
9to6 / jenkins-restore.sh
Created September 24, 2019 03:37
Bash script to restore jenkins jobs
#!/bin/bash
JENKINS_URL=$1
PWD=$(pwd)
ls ./jobs/ |
while read line
do
filepath="'$PWD/jobs/$line'"
filename="${line%%.*}"
@9to6
9to6 / jenkins-jobs-backup.sh
Last active September 23, 2019 14:50
for migration jenkins jobs
#!/bin/bash
JENKINS_URL=$1
VIEW=$2
if [ -z "$1" ]
then
echo "Need to JENKINS URL for first argument"
exit 1
fi
@9to6
9to6 / sysbench-usage.md
Created April 1, 2019 09:23
Sysbench usage

cpu

sysbench --test=cpu --cpu-max-prime=100000 --num-threads=2 run

mem

write

sysbench --test=memory run
@9to6
9to6 / iptables-desc.md
Last active March 31, 2019 14:58
iptables description
@9to6
9to6 / Caddyfile
Created February 25, 2019 17:16
Caddyfile
cinema.uniqbuild.tk uniqbuild.tk {
proxy / localhost:3000 {
}
header / {
#Include any headers for your site here
}
gzip
@9to6
9to6 / init.sh
Last active February 24, 2019 16:43
Lightsail initial script for Docker on ubuntu 18.04
#!/bin/bash
sudo apt-get update
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88