Skip to content

Instantly share code, notes, and snippets.

[Unit]
Description=Ferron web server
After=network.target
[Service]
Type=simple
User=ferron
ExecStart=/usr/local/bin/ferron -c /etc/ferron.yaml
ExecReload=kill -HUP $MAINPID
Restart=on-failure
@seungjin
seungjin / gist:49ba92899d67ee98a04f2a5018e9dee8
Created March 22, 2025 05:15
Emacs keybinding in Firefox input
https://thanosapollo.org/posts/firefox-with-emacs-keybindings/#step-i-aboutconfig
```
Step I: about:config
First visit about:config.
To enable Emacs keybindings while editing text in Firefox, make the following changes:
Set ui.key.accelKey to 18
@seungjin
seungjin / tog-arr.fish
Last active March 22, 2025 05:15
disable/enable arrow keys
function tog-arr -d "toggle arrow keys"
# Check if keycode 111 is currently mapped to 0xff52
xmodmap -pk | grep '^[[:space:]]*111' | grep 0xff52 >/dev/null 2>&1
if test $status -eq 0
# Unmap arrow keys
xmodmap -e "keycode 111 = " # UP
xmodmap -e "keycode 113 = " # LEFT
xmodmap -e "keycode 114 = " # RIGHT
xmodmap -e "keycode 116 = " # DOWN
else
@seungjin
seungjin / gist:ef555ef22023ffb4d99e92adc2226a0e
Created December 2, 2024 02:42
Result of YABS, Zap-hostring Lifetime, US West, 4 cores, 8G Ram, 60G SSD NAS, 500 Mbit/S
$ curl -sL https://yabs.sh | bash
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2024-06-09 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sun Dec 1 09:18:26 PM EST 2024
Basic System Information:
@seungjin
seungjin / gist:4cb9264772f8e6c71e42e6831d11dd3b
Created December 2, 2024 02:30
Result of YABS, Contabo VPS1, Japan, 4 cores, 6G Ram, 100G Nvme, 200 Mbit/S
$ curl -sL https://yabs.sh | bash
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
# Yet-Another-Bench-Script #
# v2024-06-09 #
# https://github.com/masonr/yet-another-bench-script #
# ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## #
Sun 1 Dec 21:16:51 EST 2024
Basic System Information:
@seungjin
seungjin / vimrc
Last active October 22, 2024 04:46
nnoremap h j
nnoremap l k
nnoremap <M-h> h
nnoremap <M-l> l
@seungjin
seungjin / .gitignore
Last active October 6, 2024 04:54
emacs config for emacs-nw
# Ignore everything
*
# But not these files...
!.gitignore
!init.el
!LICENSE
@seungjin
seungjin / bash
Last active April 29, 2024 04:05
remove duplicated eml in thunderbird maildir
for file in $(ls | egrep '^.+-[0-9].eml$'); do
mv -- "$file" "`echo $file | sed "s/-[0-9].eml$/.eml/"`";
done;
autosave = "!f () { \
origin=$(git remote) ; \
project_name=$(git remote get-url $origin | xargs basename -s .git) ; \
current_branch=$(git rev-parse --abbrev-ref HEAD) ; \
gsm=$(git status) ; \
ntc=$(echo $gsm | grep \"nothing to commit, working tree clean\" | wc -l) ; \
ybi=$(echo $gsm | grep \"Your branch is ahead of '$origin/$current_branch' by\" | wc -l) ; \
ybi2=$(echo $gsm | grep \"Your branch is ahead of '$origin/main' by\" | wc -l) ; \
if [ $ntc -ne 1 ] || ([ $ybi -ne 1 ] && [ $ybi2 -ne 0 ]); then\
echo \"💾 Autosaving...\" ; \
use base64::{engine::general_purpose, Engine as _};
use chrono::Utc;
use http::HeaderMap;
use openssl::hash::MessageDigest;
use openssl::pkey::{PKey, Private};
use openssl::sha::Sha256;
use openssl::sign::Signer;
use std::collections::HashMap;
use std::fs;