Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Heechan Park channprj

View GitHub Profile
@channprj
channprj / digicheck.py
Created November 5, 2019 08:18 — forked from petri/digicheck.py
Single-file Python digital signature maker and checker
"""digicheck - create and verify signatures for files
Usage:
digicheck keys
digicheck public <keyfilename>
digicheck sign <filename> <keyfilename>
digicheck check <filename> <keyfilename> <signaturefilename>
digicheck (-h | --help)
digicheck --version
@channprj
channprj / 99-custom-banner.sh
Created October 20, 2019 17:13
My Custom MOTD
#!/bin/sh
# /etc/update-motd.d/99-custom-banner.sh
# redirect errors to stdout -- just in case
exec 2>&1
[ -r /etc/lsb-release ] && . /etc/lsb-release
if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then
# Fall back to using the very slow lsb_release utility
@channprj
channprj / setup github issues labels.sh
Created July 22, 2019 07:32 — forked from rentzsch/setup github issues labels.sh
Shell script to set up a GitHub Project's Issues' Labels as described in <http://rentzsch.tumblr.com/post/252878320/my-lighthouse-ticket-settings-with-colors>. WARNING: script assumes a newish project that hasn't really used labels yet. It deletes all default labels, which means DATA LOSS if you've used them for anything.
USER=rentzsch
PASS=mypassword
REPO=mogenerator
# Delete default labels
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/bug"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/duplicate"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/enhancement"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/invalid"
curl --user "$USER:$PASS" --include --request DELETE "https://api.github.com/repos/$USER/$REPO/labels/question"
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --app="https://www.google.com"
@channprj
channprj / attributes.rb
Created April 22, 2019 15:31 — forked from lizthegrey/attributes.rb
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
# Local
curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash
curl -L https://iterm2.com/utilities/imgcat > ${HOME}/.iterm2/imgcat
# Remote server
sudo curl -o /usr/local/bin/imgcat -O https://iterm2.com/utilities/imgcat && sudo chmod +x /usr/local/bin/imgcat
# sudo wget https://iterm2.com/utilities/imgcat /usr/local/bin && sudo chmod +x /usr/local/bin/imgcat
# Enjoy it now! :-)
imgcat /tmp/sample.png
@channprj
channprj / remove-gitlab-runner-helper-cache.sh
Created February 20, 2019 01:47
Remove GitLab Runner Cache
docker rm $(docker ps -a --format '{{.ID}}:{{.Image}}' | grep $(docker images --format '{{.Repository}}:{{.Tag}}:{{.ID}}' | grep gitlab-runner-helper | cut -d':' -f3) | cut -d':' -f1)
@channprj
channprj / README.md
Last active February 8, 2019 05:27
Very simple and naive systemd daemon for simple api.

Commands

# create systemd service
vim /lib/systemd/system/simple-api.service
...

# install systemd service unit and enable it so it will be executed at the boot time
systemctl enable simple-api.service
server {
listen 80;
server_name example.com;
root /home/app/html;
index index.html;
access_log /var/log/nginx/example.com.access.log;
error_log /var/log/nginx/example.com.error.log;
location / {
@channprj
channprj / I_HATE_SHINHAN_MARKANY.md
Created January 23, 2019 08:01
신한카드랑 마크애니 둘 중 누구를 욕해야 하는가

신한카드랑 마크애니 둘 중 누구를 욕해야 하는가

연말정산 때문에 신용카드 사용내역서를 뽑으려는데 신한카드가 나에게 MarkAny 라는 똥을 줬다.

똥을 피하려고 VMWare 를 켰지만, 가상머신 환경ㄴㄴ 라면서 자꾸 빠꾸를 당해서 그냥 맥으로 시도를 해봤다.

그러자 물소똥 같은 pkg 파일을 주면서 root 권한으로 설치를 강요했다. 망할놈들...

하지만 root 권한까지 다 줘 가면서 까라는 대로 깠으나 내 손에 소득공제 증빙자료를 쥘 수는 없었다.

매우 열받는 일이지만 어쨌건 더러운 마크애니 놈들 때문에 설치(당)한 패키지들을 색출해서 조져야 했다.