Skip to content

Instantly share code, notes, and snippets.


CHANN channprj

View GitHub Profile
View notion-worker.js
/* Step 1: enter your domain name like */
const MY_DOMAIN = '';
* Step 2: enter your URL slug to page ID mapping
* The key on the left is the slug (without the slash)
* The value on the right is the Notion page ID
channprj /
Last active Aug 3, 2021 — forked from dayreiner/
Log all users zsh / bash commands via syslog without 3rd-party tools or auditd

Sending Bash and ZSH Commands to Syslog

Also posted here:

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

View I'm a night 🦉
🌞 Morning 61 commits █▊░░░░░░░░░░░░░░░░░░░ 8.8%
🌆 Daytime 130 commits ███▉░░░░░░░░░░░░░░░░░ 18.7%
🌃 Evening 216 commits ██████▌░░░░░░░░░░░░░░ 31.0%
🌙 Night 289 commits ████████▋░░░░░░░░░░░░ 41.5%
channprj /
Created Nov 5, 2020
Read html file and make pdf with pyppeteer
import asyncio
from pyppeteer import launch
async def main():
browser = await launch(
'headless': True,
'args': [
channprj /
Created Apr 13, 2021
Turn off macbook (linux) screen
echo 0 > /sys/class/backlight/nv_backlight/brightness
channprj /
Last active Feb 18, 2021
Remove dangling container images safely
# 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
View simple-react-nginx.conf
server {
listen 80;
root /home/app/html;
index index.html;
access_log /var/log/nginx/;
error_log /var/log/nginx/;
location / {
View postmanTest.js
// 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 | bash
curl -L > ${HOME}/.iterm2/imgcat
# Remote server
sudo curl -o /usr/local/bin/imgcat -O && sudo chmod +x /usr/local/bin/imgcat
# sudo wget /usr/local/bin && sudo chmod +x /usr/local/bin/imgcat
# Enjoy it now! :-)
imgcat /tmp/sample.png
channprj / django-admin-toggle-filter-panel.js
Created Nov 10, 2020
Toggle Django Admin Filter Panel
View django-admin-toggle-filter-panel.js
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
$('<div id="show-filters" style="float: right;"><a href="#">&larr; 필터 보기</a></p>').prependTo('div.actions');
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">필터 &rarr;</a>');
$('#show-filters').click(function() {