Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Heechan Park channprj

View GitHub Profile
@channprj
channprj / deep-link-from-browser.js
Created November 24, 2021 13:36 — forked from diachedelic/deep-link-from-browser.js
Deep link to a native app from a browser, with a fallback
@channprj
channprj / log-all-zsh-bash-commands-syslog.md
Last active August 3, 2021 16:24 — forked from dayreiner/log-all-zsh-bash-commands-syslog.md
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here: http://18pct.com/sending-bash-and-zsh-commands-to-syslog/

Your bash/zsh history is great if its complete, but it doesn't capture commands across all users, sudo's, root commands etc. In particular with test environments, someone may perform a "one-off" procedure and then months later it needs to be repeated. It would be nice to be able to look up what the user did at the time, and searching through multiple, possibly truncated history files is a pain.

Tools like typescript are great if you're actively documenting, but not something you would use all the time in practice and capture more than just a history of your commands. There are third-party tools like rootsh and Snoopy that can accomplish this, but third-party tools can be overkill if all you want is a quick reference in a re

🌞 Morning 61 commits █▊░░░░░░░░░░░░░░░░░░░ 8.8%
🌆 Daytime 130 commits ███▉░░░░░░░░░░░░░░░░░ 18.7%
🌃 Evening 216 commits ██████▌░░░░░░░░░░░░░░ 31.0%
🌙 Night 289 commits ████████▋░░░░░░░░░░░░ 41.5%
@channprj
channprj / disable-macbook-linux.sh
Created April 13, 2021 10:24
Turn off macbook (linux) screen
#!/bin/sh
echo 0 > /sys/class/backlight/nv_backlight/brightness
@channprj
channprj / remove-dangling-images-safely.sh
Last active February 18, 2021 01:32
Remove dangling container images safely
#!/bin/bash
# naive way
docker system prune -a -f
# ... or
# simple way
if [ $(echo -n $(docker images -f "dangling=true" -q) | wc -m) -gt 0 ]; then docker rmi -f $(docker images -f "dangling=true" -q); else echo "No Dangling container images"; fi
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 / {
// csrftoken 쿠키 설정
const csrftoken = pm.cookies.get('csrftoken')
pm.environment.set('csrftoken', csrftoken);
// jwt 토큰 환경변수 설정
const responseData = pm.response.json();
pm.environment.set('access', responseData.access);
pm.environment.set('refresh', responseData.refresh);
# 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 / npm-proxy.sh
Created September 24, 2020 03:19
NPM Proxy Setting
# Required
npm config set proxy http://<HOSTNAME>:<PORT>
npm config set https-proxy http://<HOSTNAME>:<PORT>
# Optional
npm config set strict-ssl false
@channprj
channprj / AWSSecurityContents.md
Created August 12, 2020 04:04 — forked from serithemage/AWSSecurityContents.md
AWS 보안 관련 자료 모음집

AWS 학습 링크집 시리즈

AWS 보안 관련 컨텐츠 모음집(http://bit.ly/secontents)

AWS 공식문서 중 보안에 관련된 자료들을 한글 자료 중심으로 정리한 페이지 입니다.