Skip to content

Instantly share code, notes, and snippets.

@benok
benok / cloud-init.yml
Last active September 11, 2024 07:44
My cloud-config file for BurmillaOS (Use custom console, add packages for debian/ubuntu console, setup swap, install latest docker compose/buildx etc.)
#cloud-config
hostname: burmilla
rancher:
upgrade:
#url: https://raw.githubusercontent.com/benok/burmilla-os-releases/master/releases.yml
url: https://raw.githubusercontent.com/burmilla/releases/master/releases.yml
repositories:
console:
url: https://raw.githubusercontent.com/benok/burmilla-os-console/master
console: debian-testing
@benok
benok / SKS3200M-auto-select-english.js
Last active May 23, 2024 10:05
UserScript for Xikestor managed switch SKS3200M to auto-select English on login
// ==UserScript==
// @name Xikestor managed switch SKS3200M auto-select english on login
// @namespace https://github.com/benok
// @version 2024.05.23.1
// @description auto-select "English" on login (confirmed on firmware version 1.9)
// @author benok
// @match http://192.168.10.12/login.cgi
// @match http://(modify with your ip here)/login.cgi
// @icon https://xikestor.com/img/web_support/XikeStor.jpg
// @grant none
@benok
benok / save_spotlight.sh
Last active July 25, 2023 04:51
Save Windows Spotlight cache images
#!/bin/sh
# Save Windows Spotlight cache images
# (execute from Git-bash, please)
CACHE_DIR=${LOCALAPPDATA}/Packages/Microsoft.Windows.ContentDeliveryManager_cw5n1h2txyewy/LocalState/Assets
DEST_DIR=~/Pictures/WindowsSpotlight
mkdir -p $DEST_DIR
cd ${CACHE_DIR}
@benok
benok / RzSizePanelTest.dpr
Last active May 29, 2023 04:47
Problem of RzSizePanel on right side with custom aligned panel (Align=clCustom)
program RzSizePanelTest;
uses
Vcl.Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.res}
begin
Application.Initialize;
@benok
benok / radiko_addl_ctrl.js
Last active April 22, 2022 05:50 — forked from 1024kibits/radiko_addl_ctrl.js
radiko に再生速度変更ボタンと指定秒ジャンプボタンを追加する bookmarklet
javascript:((i,a,p,c,m,s,l,e,j,r,u)=>{
if($('#'+i)[0])return;
$('#stream-player').append(
`<div id=${i} textAlign="center">
Jump:
<button>-30s</button><button> -10s</button>
<button> +10s</button><button>+30s</button><button>+1m</button><button> +3m</button><button>+10m</button>
Rate:
<input type=number step=0.05 min=0.25 max=4.0 value=1.00 style=width:4em>
@benok
benok / github-gist-apply-dark-theme-on-secret-gists.user.js
Last active November 30, 2022 03:41
GitHub Gist apply dark theme on secret Gists
// ==UserScript==
// @name GitHub Gist apply dark theme on secret Gists
// @namespace https://github.com/benok/
// @description Apply dark theme to your secret Gists on GitHub Gist
// @include https://gist.github.com/*
// @version 2022.11.30.1
// @homepage https://gist.github.com/benok/69b98fc38aa5884234fe50326ef014ae
// @downloadURL https://gist.github.com/benok/69b98fc38aa5884234fe50326ef014ae/raw/github-gist-apply-dark-theme-on-secret-gists.user.js
// @author benok
// @grant none
@benok
benok / github-apply-dark-theme-on-private-repos.user.js
Last active November 30, 2022 03:41
GitHub apply dark theme on private repo
// ==UserScript==
// @name GitHub apply dark theme on private repo
// @namespace https://github.com/benok/
// @description Apply dark theme to your private repository pages on Github
// @match https://github.com/*
// @run-at document-idle
// @version 2022.11.30.0
// @homepage https://gist.github.com/benok/301f7a9667a598202f10111af054ae77
// @downloadURL https://gist.github.com/benok/301f7a9667a598202f10111af054ae77/raw/github-apply-dark-theme-on-private-repos.user.js
// @updateURL https://gist.github.com/benok/301f7a9667a598202f10111af054ae77/raw/github-apply-dark-theme-on-private-repos.user.js
@benok
benok / opkg_list_installed.sh
Last active September 18, 2024 23:44
[entware] List up manually installed packages
#!/bin/ash
list_pkgs() {
opkg list-installed | cut -f 1 -d " "
}
show_deps() {
opkg depends $1 | sed -e 1d -e 's/^\s*//'
}
@benok
benok / archive-vm.zsh
Last active January 24, 2020 12:21
Create virtual machine(sparse file) tar.zst archive with progress output and create md5 file
# Usage: chdir to parent directory & set target directory name to D
# (zsh pipe related -> https://stackoverflow.com/a/4995875/26736)
# (md5 creation -> https://serverfault.com/a/120597/70666)
# TODO: convert this one liner to function or shell script with options
tar cvSf - $D 2> >(xargs -I '{}' sh -c "test -f '{}' && md5sum '{}'" |tee $D.md5) | pv -pteb -s $(du -sB1 $D |awk '{print$1}') | nice -10 zstd -15 --sparse -T0 | tee ./$D.tar.zst | md5sum | sed "s/-/$D.tar.zst/" >> $D.md5
@benok
benok / check_caps.sh
Last active May 14, 2019 07:20
check capability (useful checking inside docker container)
#!/bin/sh
# how can a docker container check if it has a capability - Stack Overflow
# https://stackoverflow.com/questions/46702043/how-can-a-docker-container-check-if-it-has-a-capability
# need to install capsh (libcap2-bin for debian)
for i in $(capsh --print | grep "Current:" | cut -d ' ' -f3 | sed 's/,/ /g'); do
echo $i
done