Skip to content

Instantly share code, notes, and snippets.

View channprj's full-sized avatar

Park Hee Chan channprj

View GitHub Profile
@channprj
channprj / safari-hacks.css
Created February 11, 2022 10:15
Hacks for Safari
@media not all and (min-resolution:.001dpcm) {
@supports (-webkit-appearance:none) {
div.something.annoying {
line-height: 18px;
}
}
}
@channprj
channprj / alert-ssh-login.sh
Last active May 12, 2022 07:34
Simple SSH Login Notifier via PAM
# Create trigger file
touch /etc/ssh/sshd_notifier.sh
chmod +x /etc/ssh/sshd_notifier.sh
vim /etc/ssh/sshd_notifier.sh
#!/bin/bash
# /etc/ssh/sshd_notifier.sh
BOT_TOKEN="xxxxxx:12345678901234567890"
CHAT_ID="1234567890"
@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

@channprj
channprj / notion-worker.js
Last active November 28, 2021 18:33
Publish Notion homepage using https://fruitionsite.com
/* CONFIGURATION STARTS HERE */
/* Step 1: enter your domain name like fruitionsite.com */
const MY_DOMAIN = 'chann.dev';
/*
* 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
*/
🌞 Morning 136 commits β–ˆβ–Šβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 8.8%
πŸŒ† Daytime 663 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 42.9%
πŸŒƒ Evening 639 commits β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 41.3%
πŸŒ™ Night 108 commits β–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 7.0%
@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
// 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);
@channprj
channprj / django-admin-toggle-filter-panel.jquery.js
Last active August 23, 2024 05:32
Toggle Django Admin Filter Panel
(function($) {
$(document).ready(function($) {
$("tr input.action-select").actions();
$('<div id="show-filters" style="float: right;"><a href="#">&larr; ν•„ν„° 보기</a></p>').prependTo('div.actions');
$('#show-filters').hide();
$('#changelist-filter h2').html('<a style="color: white;" id="hide-filters" href="#">ν•„ν„° &rarr;</a>');
$('#show-filters').click(function() {
$('#changelist-filter').show('fast');
$('#changelist').addClass('filtered');
@channprj
channprj / pyppeteer.py
Created November 5, 2020 17:54
Read html file and make pdf with pyppeteer
import asyncio
from pyppeteer import launch
async def main():
browser = await launch(
options={
'headless': True,
'args': [
'--no-sandbox',