Skip to content

Instantly share code, notes, and snippets.

View sub314xxl's full-sized avatar

Konstantin Mokhnatkin sub314xxl

  • Moscow, Russian Federation
View GitHub Profile
@sub314xxl
sub314xxl / trim.awk
Created May 7, 2023 16:10
AWK multi space remover
#!/bin/bash
# chmod +x trim.awk
# mv trim.awk /usr/local/bin/trim and m
# use: 'aaa a a ' | trim
awk '{$1=$1};1'
@sub314xxl
sub314xxl / nmcli-batch-import.sh
Last active May 8, 2023 01:46
NetworkManager tricks
# Mass add VPN profiles with NetworkManager
for file in $(pwd)/*;
do
export config=$(ls -l $file | awk -F "$(pwd)/" '{print $2}'| cut -d . -f1)
nmcli connection import type wireguard file "$config.conf" && \
nmcli connection modify "$config" connection.autoconnect no && \
nmcli connection down "$config"
done
@sub314xxl
sub314xxl / rootless-flatpak-wireshark.sh
Created May 6, 2023 07:06
rootless flatpakked wireshark packet capture
pkexec tcpdump -i wlan0 -U -w - | flatpak run --branch=stable --arch=x86_64 \
--filesystem=host --file-forwarding=host --share=network org.wireshark.Wireshark -k -i -
# pkexec is more safer than sudo
pkexec tcpdump -i wlan0 -U -w - | flatpak run --branch=stable --arch=x86_64 --device=all --filesystem=host --file-forwarding=host --share=network org.wireshark.Wireshark -k -i -
| xargs -0 -n1 sh -c 'wireshark "$@" < /dev/null' sh
# https://towardsdev.com/how-to-capture-packets-on-using-flatpak-wireshark-directly-from-tcpdump-on-host-system-f1ae3d0d0e3b
# https://wiki.wireshark.org/CaptureSetup/
@sub314xxl
sub314xxl / keybase.md
Created May 5, 2023 08:02
keybase.md

Keybase proof

I hereby claim:

  • I am sub314xxl on github.
  • I am kmokhnatkin (https://keybase.io/kmokhnatkin) on keybase.
  • I have a public key ASAswA4lpsIPNPotcnCAwzp7KGooBqxoeSi8sc-38QM8iAo

To claim this, I am signing this object:

@sub314xxl
sub314xxl / laptop_unsuck.json
Created May 2, 2023 17:30 — forked from sebastian-de/laptop_unsuck.json
easyeffects preset to improve the sound of the built-in speakers on a Thinkpad P14s Gen 2 AMD. Based on the excellent guide by Markus Schmidt.
{
"output": {
"bass_enhancer": {
"amount": 22.0,
"blend": 0.0,
"floor": 10.0,
"floor-active": true,
"harmonics": 9.999999999999995,
"input-gain": 0.0,
"output-gain": -8.0,
--disable-features=UseSkiaRenderer,UseChromeOSDirectVideoDecoder,side-panel,read-later
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks,UseOzonePlatform
--enable-start-surface-disabled-feed-improvement
--wm-window-animations-disabled
--use-cmd-decoder=passthrough
--process-per-site
--ozone-platform=x11
--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
@sub314xxl
sub314xxl / readme.txt
Created April 10, 2023 06:06 — forked from mowings/readme.txt
haproxy timing events
Timers provide a great help in troubleshooting network problems. All values are
reported in milliseconds (ms). These timers should be used in conjunction with
the session termination flags. In TCP mode with "option tcplog" set on the
frontend, 3 control points are reported under the form "Tw/Tc/Tt", and in HTTP
mode, 5 control points are reported under the form "TR/Tw/Tc/Tr/Ta". In
addition, three other measures are provided, "Th", "Ti", and "Tq".
Timings events in HTTP mode:
first request 2nd request
lsfonts() {
fc-list|awk '{$1=""}1'|cut -d: -f1|sort|uniq
}
#discord #batbot #vqgan #clip #ai #eleutherai
https://discord.com/channels/729741769192767510/730510538060071043/
.imagine QUERY --step_size 0.01 --init_weight 0.99 --start_image
https://faraday.logge.top/