grimoire

personal wiki
git clone git://git.pyratebeard.net/grimoire.git
Log | Files | Refs

commit 843560cb394e3c724d5c4b0e82bec54b27d7ac7d
parent d112204b31568e8ad5aecffc7e131712d63adb2b
Author: pyratebeard <root@pyratebeard.net>
Date:   Tue, 23 Jan 2024 16:29:41 +0000

major re-org cont

Diffstat:
Mfilesystems/index.md | 1+
Rlinux/lvm.md -> filesystems/lvm.md | 0
Dlinux/fonts.md | 25-------------------------
Dlinux/i3lock.md | 9---------
Mlinux/index.md | 116++++++++++++++++++++++++++++---------------------------------------------------
Dlinux/processes.md | 16----------------
Mlinux/ricing.md | 36++++++++++++++++++++++++++++++++++++
Dlinux/systemctl.md | 48------------------------------------------------
Dlinux/truncate.md | 2--
Mnetworking/index.md | 6+++++-
Rlinux/rsync.md -> networking/rsync.md | 0
Rlinux/samba.md -> networking/samba.md | 0
Mprogramming/nubbins.md | 19++++++++++++++++++-
Rlinux/at.md -> software/at.md | 0
Asoftware/cron.md | 1+
Msoftware/index.md | 12++++++++++++
Rlinux/init.md -> software/init.md | 0
Asoftware/systemd.md | 50++++++++++++++++++++++++++++++++++++++++++++++++++
Rlinux/sysv.md -> software/sysv.md | 0
Rlinux/w3m.md -> software/w3m.md | 0
20 files changed, 164 insertions(+), 177 deletions(-)

diff --git a/filesystems/index.md b/filesystems/index.md @@ -1,5 +1,6 @@ # filesystems * [btrfs](btrfs) +* [lvm](lvm) * [mdadm](mdadm) * [zfs](zfs) diff --git a/linux/lvm.md b/filesystems/lvm.md diff --git a/linux/fonts.md b/linux/fonts.md @@ -1,25 +0,0 @@ -# fonts - -if font isn't working run `fc-cache -fv` - -``` - 1014 xset +fp /usr/share/fonts/local - 1015 sudo xset +fp /usr/share/fonts/local - 1016 ll /usr/lib/X11/fonts/misc/ - 1017 systemctl --all | grep xfs - 1018 fc-cache -fv - 1019 xset +fp /usr/share/fonts/local - 1020 ll /usr/share/fonts - 1021 ll /usr/share/fonts/local - 1022 xset +fp /usr/share/fonts/ - 1023 xset +fp /usr/share/fonts/local - 1024 sudo -i - cd /usr/share/fonts/local - mkfontscale - mkfontdir - 1025 xset +fp /usr/share/fonts/local - 1026 xset -q - 1027 fc-cache -fv - 1028 xlsfonts | grep -i tamzen - -``` diff --git a/linux/i3lock.md b/linux/i3lock.md @@ -1,9 +0,0 @@ -# i3lock - -lockscreen commands (https://www.reddit.com/r/unixporn/comments/8z15f9/i3lock_with_pixeleffect/) - -```zsh -ICON="/home/pyratebeard/tmp/stop2.png" ; TMPBG="/tmp/lockscreen.jpg" ; RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/') ; ffmpeg -f x11grab-video_size $RES -y -i $DISPLAY -vf frei0r=pixeliz0r=0.02:0.02 -vframes 1 $TMPBG -loglevel quiet -ICON="/home/pyratebeard/tmp/stop2.png" ; TMPBG="/tmp/lockscreen.jpg" ; RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/') ; ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $ICON -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $TMPBG -loglevel quiet -/home/pyratebeard/src/warez/i3lock-fancy-multimonitor/lock -p -``` diff --git a/linux/index.md b/linux/index.md @@ -1,89 +1,45 @@ # linux -## a -* [apt_dpkg](apt_dpkg) -* [at](at) - -## b -* [bin](bin) -* [bluetooth](bluetooth) - -## c -* [csgo](csgo) - -## d -* [dhcpcd](dhcpcd) -* [dmidecode](dmidecode) +## art * [durdraw](durdraw) -## e - -## f -* [fallout4](fallout4) -* [flatpak](flatpak) -* [fonts](fonts) - -## g - -## h - -## i -* [i3lock](i3lock) -* [init](init) - -## j -* [journalctl](journalctl) - -## k -* [keymaps](keymaps) - -## l -* [logrotate](logrotate) -* [lvm](lvm) - -## m -* [man_pages](man_pages) -* [mount](mount) +## audio * [mpd](mpd) -* [mpv](mpv) - -## n - -## o - -## p -* [pacman](pacman) * [pacmd](pacmd) * [pactl](pactl) -* [processes](processes) - -## q +* [spotifyd](spotifyd) -## r -* [ricing](ricing) -* [rpm](rpm) -* [rsync](rsync) -* [rtv](rtv) +## connectivity +* [bluetooth](bluetooth) -## s -* [samba](samba) -* [sar](sar) +## documentation +* [bin](bin) +* [man_pages](man_pages) * [scanning](scanning) -* [spotifyd](spotifyd) -* [systemctl](systemctl) -* [sysv](sysv) -## t -* [truncate](truncate) +## logging +* [journalctl](journalctl) +* [logrotate](logrotate) +* [sar](sar) -## u +## package managers +* [apt_dpkg](apt_dpkg) +* [flatpak](flatpak) +* [pacman](pacman) +* [rpm](rpm) -## v +## ricing +* [ricing](ricing) -## w -* [w3m](w3m) +## steam issues +* [csgo](csgo) +* [fallout4](fallout4) -## x +## system utilities +* [dhcpcd](dhcpcd) +* [dmidecode](dmidecode) +* [keymaps](keymaps) +* [mount](mount) * [xclip](xclip) * [xdotool](xdotool) * [xev](xev) @@ -91,16 +47,26 @@ * [xmodmap](xmodmap) * [xprop](xprop) -## y - -## z +## video +* [mpv](mpv) +## unsorted +### scsi echo 1 > /sys/class/scsi_device/2:0:1:0/device/rescan echo "- - -" > /sys/class/scsi_host/host2/scan +### key presses * view keys being pressed -https://unix.stackexchange.com/questions/144390/print-currently-pressed-keys-to-stdout-and-read-them-line-by-line ``` stdbuf -o0 showkey -a | cat - ``` + +https://unix.stackexchange.com/questions/144390/print-currently-pressed-keys-to-stdout-and-read-them-line-by-line + +### truncate +https://unix.stackexchange.com/questions/68523/find-and-remove-large-files-that-are-open-but-have-been-deleted + +### rtv +rtv --enable-media (to use mailcap, although it seems to default) +export RTV_BROWSER=qutebrowser diff --git a/linux/processes.md b/linux/processes.md @@ -1,16 +0,0 @@ -# processes - -## zombies -check the number of [zombie processes][] -``` -ps aux | awk '$8 ~ /Z/ { print }' | wc -l -``` - -## sort by resource usage -find [top processes][] sorted by mem or cpu usage -``` -ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head -``` - -[zombie processes]: https://www.howtogeek.com/119815/htg-explains-what-is-a-zombie-process-on-linux/ -[top processes]: https://tecmint.com/find-linux-processes-memory-ram-cpu-usage diff --git a/linux/ricing.md b/linux/ricing.md @@ -1,5 +1,41 @@ # ricing +## i3lock + +lockscreen commands (https://www.reddit.com/r/unixporn/comments/8z15f9/i3lock_with_pixeleffect/) + +```zsh +ICON="/home/pyratebeard/tmp/stop2.png" ; TMPBG="/tmp/lockscreen.jpg" ; RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/') ; ffmpeg -f x11grab-video_size $RES -y -i $DISPLAY -vf frei0r=pixeliz0r=0.02:0.02 -vframes 1 $TMPBG -loglevel quiet +ICON="/home/pyratebeard/tmp/stop2.png" ; TMPBG="/tmp/lockscreen.jpg" ; RES=$(xrandr | grep 'current' | sed -E 's/.*current\s([0-9]+)\sx\s([0-9]+).*/\1x\2/') ; ffmpeg -f x11grab -video_size $RES -y -i $DISPLAY -i $ICON -filter_complex "boxblur=5:1,overlay=(main_w-overlay_w)/2:(main_h-overlay_h)/2" -vframes 1 $TMPBG -loglevel quiet +/home/pyratebeard/src/warez/i3lock-fancy-multimonitor/lock -p +``` + +## fonts + +if font isn't working run `fc-cache -fv` + +``` + 1014 xset +fp /usr/share/fonts/local + 1015 sudo xset +fp /usr/share/fonts/local + 1016 ll /usr/lib/X11/fonts/misc/ + 1017 systemctl --all | grep xfs + 1018 fc-cache -fv + 1019 xset +fp /usr/share/fonts/local + 1020 ll /usr/share/fonts + 1021 ll /usr/share/fonts/local + 1022 xset +fp /usr/share/fonts/ + 1023 xset +fp /usr/share/fonts/local + 1024 sudo -i + cd /usr/share/fonts/local + mkfontscale + mkfontdir + 1025 xset +fp /usr/share/fonts/local + 1026 xset -q + 1027 fc-cache -fv + 1028 xlsfonts | grep -i tamzen + +``` + ## xsetroot ``` xsetroot -solid #111111 diff --git a/linux/systemctl.md b/linux/systemctl.md @@ -1,48 +0,0 @@ -# systemctl - -also see [journalctl](journalctl) - -```bash -systemctl list-units [ --all | --type=service ] -``` - -- show all enabled and disabled services -```bash -systemctl list-unit-files -``` - -#### create service file -``` -vi /etc/systemd/system/<name>.service -``` - -([manage systemd][]) - -## user services -run `systemctl` (without sudo) and with the `--user` option - -service files are created under '$HOME/.config/systemd/user' - -### example user service file -``` -[Unit] -Description=This is an example - -[Service] -ExecStart=/path/to/command - -[Install] -WantedBy=default.target -``` -([writing user units][]) - -enable and start the user service (without sudo) -``` -systemctl --user enable <service> -systemctl --user start <service> -systemctl --user status <service> -``` - - -[manage systemd]: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units -[writing user units]: https://wiki.archlinux.org/index.php/Systemd/User#Writing_user_units diff --git a/linux/truncate.md b/linux/truncate.md @@ -1,2 +0,0 @@ -# truncate -https://unix.stackexchange.com/questions/68523/find-and-remove-large-files-that-are-open-but-have-been-deleted diff --git a/networking/index.md b/networking/index.md @@ -1,6 +1,6 @@ # networking -## adminstration +## administration * [dig](dig) * [nmcli](nmcli) * [subnet_cheatsheet](subnet_cheatsheet) @@ -21,5 +21,9 @@ * [haproxy](haproxy) * [envoy](envoy) +## transferring +* [rsync](rsync) +* [samba](samba) + ## vpn * [openvpn](openvpn) diff --git a/linux/rsync.md b/networking/rsync.md diff --git a/linux/samba.md b/networking/samba.md diff --git a/programming/nubbins.md b/programming/nubbins.md @@ -1,8 +1,25 @@ # nubbins -### compare contents of two directories +## compare contents of two directories ``` for f in $(find dir1/ -type f | awk -F/ '{print $NF}') ; do find dir2/ -type f -name "$f" -exec echo {} is in both \; done ``` + +## processes + +### zombies +check the number of [zombie processes][] +``` +ps aux | awk '$8 ~ /Z/ { print }' | wc -l +``` + +### sort by resource usage +find [top processes][] sorted by mem or cpu usage +``` +ps -eo pid,ppid,cmd,%mem,%cpu --sort=-%mem | head +``` + +[zombie processes]: https://www.howtogeek.com/119815/htg-explains-what-is-a-zombie-process-on-linux/ +[top processes]: https://tecmint.com/find-linux-processes-memory-ram-cpu-usage diff --git a/linux/at.md b/software/at.md diff --git a/software/cron.md b/software/cron.md @@ -0,0 +1 @@ +# cron diff --git a/software/index.md b/software/index.md @@ -6,6 +6,9 @@ ## backups * [borg](borg) +## browsers +* [w3m](w3m) + ## communication systems * [exim4](exim4) * [gopher](gopher) @@ -24,6 +27,11 @@ * [oracle](oracle) * [postgresql](postgresql) +## init processes +* [init](init) +* [systemd](systemd) +* [sysv](sysv) + ## internet protocols * [ftp](ftp) * [ldap](ldap) @@ -34,6 +42,10 @@ * [ntfy](ntfy) * [nagios](nagios) +## scheduling +* [at](at) +* [cron](cron) + ## terminals * [tmux](tmux) diff --git a/linux/init.md b/software/init.md diff --git a/software/systemd.md b/software/systemd.md @@ -0,0 +1,50 @@ +# systemd + +## systemctl + +also see [journalctl](/linux/journalctl) + +```bash +systemctl list-units [ --all | --type=service ] +``` + +- show all enabled and disabled services +```bash +systemctl list-unit-files +``` + +#### create service file +``` +vi /etc/systemd/system/<name>.service +``` + +([manage systemd][]) + +## user services +run `systemctl` (without sudo) and with the `--user` option + +service files are created under '$HOME/.config/systemd/user' + +### example user service file +``` +[Unit] +Description=This is an example + +[Service] +ExecStart=/path/to/command + +[Install] +WantedBy=default.target +``` +([writing user units][]) + +enable and start the user service (without sudo) +``` +systemctl --user enable <service> +systemctl --user start <service> +systemctl --user status <service> +``` + + +[manage systemd]: https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units +[writing user units]: https://wiki.archlinux.org/index.php/Systemd/User#Writing_user_units diff --git a/linux/sysv.md b/software/sysv.md diff --git a/linux/w3m.md b/software/w3m.md