wiki

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 7d407966d6727c2d0e38a3d454ec9315242d08b5
parent c5f185fb51e39279526ad489dcc980140aa007c3
Author: nxuv <nxuv@disr.it>
Date:   Sat, 10 Jan 2026 23:28:27 +0300

add pages

Diffstat:
Mpublic/all_pages.md | 16+++++++++-------
Mpublic/w/aa.md | 1-
Apublic/w/cron.md | 62++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apublic/w/git_email.md | 43+++++++++++++++++++++++++++++++++++++++++++
Apublic/w/runit.md | 115+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Apublic/w/screen.md | 59+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mpublic/w/web_browsers.md | 6+++---
Apublic/w/wpa_supplicant.md | 28++++++++++++++++++++++++++++
8 files changed, 319 insertions(+), 11 deletions(-)

diff --git a/public/all_pages.md b/public/all_pages.md @@ -1,9 +1,11 @@ |||| |:-|:-|:-| -|[aa](w/aa.md)|[kana_sounds](w/kana_sounds.md)|[recursion](w/recursion.md)| -|[ayashii_world](w/ayashii_world.md)|[maintenance](m/maintenance.md)|[smartctl](w/smartctl.md)| -|[html_entities](w/html_entities.md)|[make](w/make.md)|[style_guidelines](m/style_guidelines.md)| -|[html_furigana](w/html_furigana.md)|[markdown_flavour](m/markdown_flavour.md)|[style_test](m/style_test.md)| -|[index](/)|[memtester](w/memtester.md)|[vim_digraphs](w/vim_digraphs.md)| -|[japanese_onomatopeia](w/japanese_onomatopeia.md)|[oekaki](w/oekaki.md)|[web_browsers](w/web_browsers.md)| -|[kagai_nihongo](w/kagai_nihongo.md)|[options](m/options.md)| +|[aa](w/aa.md)|[kana_sounds](w/kana_sounds.md)|[runit](w/runit.md)| +|[ayashii_world](w/ayashii_world.md)|[maintenance](m/maintenance.md)|[screen](w/screen.md)| +|[cron](w/cron.md)|[make](w/make.md)|[smartctl](w/smartctl.md)| +|[git_email](w/git_email.md)|[markdown_flavour](m/markdown_flavour.md)|[style_guidelines](m/style_guidelines.md)| +|[html_entities](w/html_entities.md)|[memtester](w/memtester.md)|[style_test](m/style_test.md)| +|[html_furigana](w/html_furigana.md)|[oekaki](w/oekaki.md)|[vim_digraphs](w/vim_digraphs.md)| +|[index](/)|[options](m/options.md)|[web_browsers](w/web_browsers.md)| +|[japanese_onomatopeia](w/japanese_onomatopeia.md)|[recursion](w/recursion.md)|[wpa_supplicant](w/wpa_supplicant.md)| +|[kagai_nihongo](w/kagai_nihongo.md)| diff --git a/public/w/aa.md b/public/w/aa.md @@ -123,4 +123,3 @@ r-'ァ'"´/  /! ハ  ハ  !  iヾ_ノ i イ iゝ、イ人レ ``` [filename](../hub/japan.md ':include') - diff --git a/public/w/cron.md b/public/w/cron.md @@ -0,0 +1,62 @@ +# Cron + +This will be particularly about `dcron` with Void Linux (i.e runit). + +## Jobs + +Syntax is: + +``` +%M %H %d %m %a command +``` + +Where `%?` is `date +format` specifiers (`%M` is minute, etc). + +Cron follows certain specifications, +- * - is a wildcard which makes specifier be ignored. +- [0-9]+ instead of * will make cron run at specified time. +- [0-9]+`,`[0-9]+ will execute job at multiple specified times. +- [0-9]+`-`[0-9]+ will limit execution between certain time (i.e every hour between 13-19). +- *`/`[0-9]+ will run every N time period. +- `@hourly`, `@daily`/`@midnight`, `@weekly`, `@monthly` and `@reboot` are shorthands, with hourly being `0 * * * *`. + +Command can be anything that shell can execute. + +You can access `$HOME`, `$USER`/`$LOGNAME`, `$SHELL` and `$PATH` environment variables. Which makes it possible to `. $HOME/.bashrc; $HOME/script.sh` + +## Examples + +> TODO: examples + +Verify environment, +``` +* * * * * printenv > ~/cron_env_test.txt +``` + +## Commandline + +List, +``` +crontab -l +``` + +Edit, +``` +crontab -e +``` + +Remove **all**, +``` +crontab -r +``` + +Replace with file, +``` +crontab <filename> +``` + +Insert from stdin, +``` +crontab - +``` + diff --git a/public/w/git_email.md b/public/w/git_email.md @@ -0,0 +1,43 @@ +# Git Email + +## Setup in `.gitconfig` + +```ini +[sendemail] + smtpserver = {SMTP.SERVER.DOMAIN} + smtpuser = {EMAIL}@{SOME.DOMAIN} + ; ssl + smtpencryption = ssl + smtpserverport = 465 + ; smtpencryption = tls + ; smtpserverport = 587 +``` + +### GNU Pass + +```ini +[credential "smtp://{EMAIL}%40{SOME.DOMAIN}@{SMTP.SERVER.DOMAIN}:465"] + ; important line, see https://stackoverflow.com/questions/79696018 + helper = + helper = "!pass git/{EMAIL}@{SOME.DOMAIN}" +``` + +## Sending + +> TODO: [gitmail](https://git-send-email.io/#step-4) + +```bash +git add . +git commit -m "Commit message" # or `git commit` to open editor +git send-email --to="{MAINTIANER}@{SOME.DOMAIN}" HEAD^ +``` + +## Applying + +```bash +git apply --stat a_file.patch +git apply --check a_file.patch +git am < a_file.patch +``` + + diff --git a/public/w/runit.md b/public/w/runit.md @@ -0,0 +1,115 @@ +# Runit + +## Usage + +- sv status, sv s + > prints status of service +- sv up, sv u + > start service, restart if stops +- sv down, sv d + > stop service, do not restart +- sv once, sv o + > start service, do not restart +- sv pause, cont, hup, quit, term, kill + > restarts service +- sv exit, sv e + > kill service, do not restart + +## User services + +Create a service named `runsvdir-<uname>` with `run` script containing: + +```bash +#!/bin/sh + +export USER="<uname>" +export HOME="/home/<uname>" + +groups="$(id -Gn "$USER" | tr ' ' ':')" +svdir="$HOME/<servicedir>" + +exec chpst -u "$USER:$groups" runsvdir "$svdir" +``` + +Afterwards you can export `SVDIR="$HOME/<servicedir>"` for convenience. + +## Service management + +### Service structure + +``` +*run - (mandatory) starts process +*check - exit 0 means service is running +*finish - is ran after any shutdown (for cleanup) +control/ +├── *c - replaces SIGCONT +├── *d - is ran after control/t for down +├── *x - is ran after control/t for exit +├── *t - replaces SIGTERM +└── *u - is ran before run +log/ - managed by sv, contains logs +supervise/ - managed by sv +``` + +### Files + +#### run + +Mandatory (everything else is optional) script that is ran to start the service. + +#### check + +Script that performs manual check of service status and returns `0` if service is up and running or any non-zero code otherwise. + +#### finish + +A cleanup script. Is ran last after service is terminated by any means, including crashes. + +#### control/d and control/x + +Ran after `SIG____` when `sv` is called with either `down` or `exit` respectively. + +#### control/t, control/c, control/h, etc + +Scripts that replace `SIGTERM`, `SIGCONT` and `SIGHUP` respectively. Can be used to control the way that service is shut down. If they fail to stop service then they must exit with any non-zero code. + +The letter comes from first letter that comes after `SIG`. + +#### control/u + +Ran when `sv` is called with `up` before the `run` script. + +### Using with screen + +#### Run + +```bash +#!/bin/sh + +# exec seems to be crucial +exec screen -DmS session_name program +``` + +#### Stop, term and down + +```bash +#!/bin/sh + +screen -S session_name -X kill +# or if needs to be terminated with command +screen -S session_name -X stuff stop + +sleep 5 +``` + +### Do not autostart + +Create `/path/to/service/down` + +### Fast check status as exit code + +```bash +sv status devdocs | perl -ne 'exit(/^run:/gi ? 0 : 1)' && $() || $() +``` + + diff --git a/public/w/screen.md b/public/w/screen.md @@ -0,0 +1,59 @@ +# GNU Screen + +## Usage + +```bash +screen program +``` + +```bash +screen -S session_name program +``` + +```bash +screen -DmS session_name program & +``` + +```bash +screen -r session_name +``` + +```bash +screen -S session_name -X stuff text +``` + +```bash +screen -S session_name -X kill +``` + +```bash +screen -S session_name -X hardcopy filepath.txt +``` + +```bash +screen -S session_name -X log on +``` + +## Keys + +- <C-a>' - prompt a window to switch to +- <C-a>" - show window list for session +- <C-a>[0-9] - switch to window [0-9] +- <C-a><C-a> - <C-w>p +- <C-a>d, <C-a><C-d> - detach +- <C-a>DD - detach and logout (kill?) +- <C-a>i, <C-a><C-i> - show info +- <C-a>k, <C-a><C-k> - kill +- <C-a>l, <C-a><C-l> - refresh (vi <C-l>) +- <C-a>q, <C-a><C-q> - send ^q to current window +- <C-a>s, <C-a><C-s> - send ^s to current window +- <C-a>S - <C-w>s +- <C-a><C-v> - enter digraph +- <C-a>w, <C-a><C-w> - <cmd>ls<cr> +- <C-a>X - <cmd>bd<cr>??? +- <C-a>? - show keybinds +- <C-a>\\ - <cmd>qall!<cr> +- <C-a>: - <cmd> +- <C-a>| - <C-w>v +- <C-a>* - <cmd>ls<cr>??? again? + diff --git a/public/w/web_browsers.md b/public/w/web_browsers.md @@ -17,8 +17,8 @@ The ever ubiquitous browsers have gradually consumed the world and are evil and - w3m > It's fine - [chawan](https://git.sr.ht/~bptato/chawan) - > Honestly most powerful and good looking, supports HTTP(S), (S)FTP, Gopher, Gemini, etc what a package! -- (the firefox backend one) + > Honestly most powerful and good looking, supports HTTP(S), (S)FTP, Gopher, Gemini, etc what a package! (apparently it looses to elinks on that front since it also supports all those and more). +- (the firefox backend one) (browsh?) > Could be better, fails at both ends ## Open source @@ -42,7 +42,7 @@ Always spying on you and weigh a ton. > See chrome - IE > Never worked (why is it here?) -- Firefox +- Firefox (it is) > Feels bad - Chrome (and all offshoots) > Hi, I would like your data and your data and your data and your life please diff --git a/public/w/wpa_supplicant.md b/public/w/wpa_supplicant.md @@ -0,0 +1,28 @@ +# WPA Supplicant + +Manages WIFI networks. Use `wpa_cli` to control it. + +- status + > prints current status/network + +- list_network + > prints list of networks and connection status + +- select_network ID + > switches to network ID given by list_network + +- scan + > starts network scan + +- scan_results + > prints result of scan + +- add_network + > creates new network and prints it's ID + +- set network ID ssid "SSID" + > sets network ssid to SSID + +- set network ID psk "PASS" + > sets network passkey to PASS +