Skip to content

Instantly share code, notes, and snippets.

View euikook's full-sized avatar
🎯
Focusing

euikook euikook

🎯
Focusing
View GitHub Profile
@euikook
euikook / 70-avrisp.rules
Created January 9, 2022 12:46
How to use avrisp mkii with without root privileges
SUBSYSTEM=="usb", ATTRS{idVendor}=="03eb", ATTRS{idProduct}=="2104", TAG+="uaccess"
@euikook
euikook / avgutil.py
Last active May 31, 2021 07:27
moving-average
import numpy as np
def do_cma(s):
return s.expanding().mean()
def do_sma(s, N=15):
return s.rolling(N, min_periods=1).mean()
def do_ema(s, N=15):
@euikook
euikook / average.py
Created April 23, 2021 00:22
Average Filter
def avg_batch(v):
return sum(v)/len(v)
def avg_recursive(a, v, n):
return n/(n + 1)*a + v/(n+1)
if __name__ == '__main__':
ages = [10, 12, 26, 30, 40, 33, 21, 34, 54, 3]
print(f'Average using Batch Expression: {avg_batch(ages)}')
@euikook
euikook / lsb.arch.sh
Last active March 11, 2021 00:22
ssh-config-and-include-statement
$ lsb_release -a
LSB Version: 1.4
Distributor ID: Arch
Description: Arch Linux
Release: rolling
Codename: n/a
$ ssh -V
OpenSSH_8.4p1, OpenSSL 1.1.1h 22 Sep 2020
@euikook
euikook / 99-usb-ssd.rules
Last active March 10, 2021 13:03
auto-mount-removable-drives-to-specific-mounting-point
ACTION=="add", SUBSYSTEM=="block", ENV{ID_FS_UUID}=="ef6e4eba-7ad9-4a4c-be75-3b85ba2d14a3", ENV{UDISKS_IGNORE}="1", RUN+="/usr/bin/systemctl start usb.mount@$env{ID_FS_UUID}.service"
ACTION=="remove", SUBSYSTEM=="block", ENV{ID_FS_UUID}=="ef6e4eba-7ad9-4a4c-be75-3b85ba2d14a3", ENV{UDISKS_IGNORE}="1", RUN+="/usr/bin/systemctl stop usb.mount@$env{ID_FS_UUID}.service"
@euikook
euikook / local.fwd.ssh.config
Last active March 10, 2021 12:51
keep-persistent-ssh-session-using-autossh-and-cron
Host 1.2.3.4 autossh
Hostname 1.2.3.4
User autossh
SendEnv LANG LC_*
IdentityFile ~/.ssh/autossh
ConnectTimeout 0
HashKnownHosts yes
LocalForward 2222 localhost:22
ServerAliveInterval 30
ServerAliveCountMax 3
@euikook
euikook / head.css.html
Created March 10, 2021 12:26
hugo-tag-cloud-with-jqcloud
<link rel="stylesheet" href="https://golangkorea.github.io/js/jqcloud/jqcloud.min.css">
[Unit]
Description=insync on start up
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/insync-headless start
[Install]
WantedBy=default.target
{{ partial "utterances" . }}
[params.utterances]
repo = "<username>/<username>.github.io"
# term = "pathname"
# theme = "github-light"
# crossorigin = "anonymous"