# Autostart VcXsrv
. <(~/vcxserv_helpers.sh ~/.vcxsrv.port)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
eval_on_ztncui () { | |
# shellcheck disable=1090 | |
(source ~/containers/ztncui.sh && ztncui-compose exec -T ztncui bash -c "$1"); return $? | |
} | |
# Arguments are escaped, last argument gets the address of the server prepended, auth token is added to the header | |
curl_on_ztncui () { | |
# shellcheck disable=2016 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM alpine:3 | |
RUN apk add --no-cache ffmpeg inotify-tools bash python3 coreutils tzdata | |
RUN mkdir /app | |
WORKDIR /app | |
COPY ./recorder.sh ./util.sh /app/ | |
ENTRYPOINT [ "/app/recorder.sh" ] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
decode_hp_xcas_program () { | |
python3.8 -c ' | |
import sys | |
enc = "utf-16le" | |
delims = ("#cas".encode(enc), "#end".encode(enc)) | |
print(((lambda conts: conts[conts.find(delims[0])+len(delims[0]):conts.rfind(delims[1])])( | |
open(sys.argv[1], mode="rb").read())).decode(enc))' \ | |
"$1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3.9 | |
from itertools import chain | |
from typing import Iterator | |
import argh | |
ichain = chain.from_iterable | |
def up_to_multiple(mul: int, val: int) -> int: | |
""" | |
Rounds a value up to the nearest multiple | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import overload, Any, Tuple, Callable, TypeVar | |
T=TypeVar('T') | |
@overload | |
def free_var(initial: T) -> Tuple[Callable[[T], T], Callable[[], T]]: ... | |
@overload | |
def free_var(*, like: T) -> Tuple[Callable[[T], T], Callable[[], T]]: ... | |
def free_var(*args, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- generalized n-ary gray code generator | |
gray :: (Integral a) => [b] -> a -> [[b]] | |
gray elems 1 = map (:[]) elems | |
gray elems n = | |
concat $ zipWith ($) prependers $ flipN $ gray elems (n-1) | |
where flipN = (take $ length elems) . (iterate reverse) | |
prependers = [ map (elem:) | elem <- elems ] |
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Evaporado ;0;10;20;30;40;50;60;70;80;90;100 | |
Temperatura (°C) ;32;53;69;88;102;115;126;137;154;177;182 |
This switch does not allow you to choose which ports the default VLAN is connected to. Seeing that the configs for the default VLAN do get dumped into the config backup file, I decided to patch that file, modifying and uploading the internal config of the switch instead of politely asking it to remove that VLAN from some ports.
If you open the config file with a hex editor, you'll notice somewhere in the middle the strings "Default_VLAN", followed by the names of the VLANs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://www.reddit.com/r/termux/comments/ubtuua/hi_i_need_help_with_this_problem_any_ideas/ | |
# binutils and libsodium are required to build pynacl | |
# while rust is required to build cryptography | |
pkg install python rust libsodium binutils | |
export CARGO_BUILD_TARGET=aarch64-linux-android | |
pip install magic-wormhole |