Skip to content

Instantly share code, notes, and snippets.

@andromedarabbit
andromedarabbit / Dockerfile
Last active March 26, 2024 04:34
Create or modify the AWS security group, which only allows GitHub servers to access to our services
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/*
@andromedarabbit
andromedarabbit / elastalert-rule.yaml
Created March 3, 2017 15:44
ElastAlert rule example
# Alert when the rate of events exceeds a threshold
# (Required)
# Rule name, must be unique
name: OutOfMemoryError
# (Required)
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time
type: frequency
@andromedarabbit
andromedarabbit / create-bootable-el-capitan-iso.sh
Last active June 20, 2023 21:41
Create bootable El Capitan ISO
#!/usr/bin/env bash -x
hdiutil attach "/Applications/Install OS X El Capitan.app/Contents/SharedSupport/InstallESD.dmg" -noverify -nobrowse -mountpoint /Volumes/install_app
exitStatus=$?
if [ $exitStatus -ne 0 ]; then
exit $exitStatus
fi
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o "/tmp/El Capitan"
@andromedarabbit
andromedarabbit / how-to-create-a-cpu-spike-with-a-bash-command.md
Last active January 30, 2023 15:39
How to create a CPU spike with a bash command

I use stress for this kind of thing, you can tell it how many cores to max out.. it allows for stressing memory and disk as well.

Example to stress 2 cores for 60 seconds

stress --cpu 2 --timeout 60

출처: How to create a CPU spike with a bash command

설치 방법

@andromedarabbit
andromedarabbit / gradle-commands.md
Last active October 30, 2022 08:13
자주 쓰는 Gradle 명령어

자주 쓰는 Gradle 명령어

단위 테스트 돌리기

gradle test

단위 테스트는 건너뛰고 빌드하기

@andromedarabbit
andromedarabbit / ngrinder-agents.yaml
Created December 25, 2016 05:30
Ngrinder agents for Kubernetes
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
 name: ngrinder-agent
spec:
 replicas: 5
 template:
 metadata:
 labels:
 app: ngrinder-agent
@andromedarabbit
andromedarabbit / create-bootable-mavericks.sh
Created February 6, 2016 14:58
Create bootable Mavericks ISO
#!/usr/bin/env bash -x
hdiutil attach /Applications/Install\ OS\ X\ Mavericks.app/Contents/SharedSupport/InstallESD.dmg -noverify -nobrowse -mountpoint /Volumes/install_app
exitStatus=$?
if [ $exitStatus -ne 0 ]; then
exit $exitStatus
fi
# Convert the boot image to a sparse bundle
hdiutil convert /Volumes/install_app/BaseSystem.dmg -format UDSP -o /tmp/Mavericks
@andromedarabbit
andromedarabbit / dl_hankyung.sh
Last active October 31, 2021 13:17
한경컨센서스에서 보고서 다운로드 받기
#!/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
@andromedarabbit
andromedarabbit / dr-ec2-instances-per-az.sh
Last active June 3, 2021 01:54
Get a report on How EC2 instances are deployed across multiple AZs
#!/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}"
#!/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