View dl_hankyung.sh
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 -e | |
TODAY=$(date '+%Y-%m-%d') | |
DOWNLOAD_DIR="${HOME}/Downloads/${TODAY}" | |
mkdir -p "${DOWNLOAD_DIR}" | |
type qpdf &>/dev/null || brew install qpdf | |
type recode &>/dev/null || brew install recode | |
curl -H 'Accept-Charset: euc-kr' --silent "http://consensus.hankyung.com/apps.analysis/analysis.list?&pagenum=800" | iconv -f euc-kr -t utf-8 | grep report_idx | while IFS= read -r LINE; do |
View debug-github-actions.sh
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 -ex | |
if (! which sshd) ; then | |
sudo apt-get update -y | |
sudo apt-get install -y openssh-server | |
sudo mkdir /run/sshd | |
sudo /usr/sbin/sshd -d & | |
fi | |
if [[ -z "$NGROK_TOKEN" ]]; then |
View rds.sh
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 rds describe-db-instances | jq -r '.DBInstances[] | select(.CACertificateIdentifier == "rds-ca-2015") | .DBInstanceIdentifier' | xargs -I {} sh -c 'aws rds modify-db-instance --db-instance-identifier {} --ca-certificate-identifier=rds-ca-2019 --apply-immediately' |
View gist:28c116d5a5f63a69ed80e1a6a2b9e329
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
Verifying my Blockstack ID is secured with the address 12fPpBGuz3WutxpmUMwRmSkAoEyrPLJwKv https://explorer.blockstack.org/address/12fPpBGuz3WutxpmUMwRmSkAoEyrPLJwKv |
View Dockerfile
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
FROM python:3.7 | |
# Set the timezone to KST | |
RUN cat /usr/share/zoneinfo/Asia/Seoul > /etc/localtime | |
RUN set -ex \ | |
&& apt-get clean && apt-get update \ | |
&& apt-get install --no-install-recommends -y groff \ | |
&& rm -rf /var/lib/apt/lists/* |
View backup-to-gdfs.sh
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 | |
if [ -n "${SKIP_BACKUPS}" ]; then | |
exit 0 | |
fi | |
type pigz || brew install pigz | |
type rsync || brew install rsync | |
type rsync-time-backup.sh || brew install rsync-time-backup | |
SRC_DIRS=( |
View dr-ec2-instances-per-az.sh
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 | |
type csvsql || brew instal csvkit | |
type jq || brew install jq | |
type aws || brew intall awscli | |
TABLE_NAME=tmp | |
TMP_FILE=${TABLE_NAME}.csv | |
OUTPUT_FILE="output.csv" | |
truncate -s 0 "${OUTPUT_FILE}" |
View dr-k8s-apps-per-az.sh
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 -e | |
type csvjson || brew install csvkit | |
type jq || brew install jq | |
RED='\033[0;31m' | |
NC='\033[0m' # No Color | |
OUTPUT_PODS=pods.csv | |
truncate -s 0 "${OUTPUT_PODS}" |
View reclaim-policy.yaml
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
kind: ServiceAccount | |
apiVersion: v1 | |
metadata: | |
name: reclaim-policy | |
namespace: monitoring | |
--- | |
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRoleBinding | |
metadata: | |
name: reclaim-policy |
View set-reclaimpolicy-to-retain.sh
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 | |
# See https://kubernetes.io/docs/tasks/administer-cluster/change-pv-reclaim-policy/ | |
set -eo pipefail | |
echo ">>> BEFORE" | |
kubectl get pv | |
kubectl patch pv $(kubectl get pv -o json | jq -r '.items[] | select(.spec .persistentVolumeReclaimPolicy != "Retain") | .metadata .name') -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' |
NewerOlder