This file contains hidden or 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 | |
set -euo pipefail \ | |
${DEBUG:+-x} | |
executable="${1:?no executable}" | |
shift | |
if [ "${executable%/*}" != "$executable" ] | |
then |
This file contains hidden or 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 | |
: "${REMOTE:=lsw}" | |
: "${CMD64_SH:=cmd64.sh}" | |
eval_in_remote() { | |
# shellcheck disable=SC2029 | |
ssh "$REMOTE" "$CMD64_SH" "$(base64 -w0 - <<< ' | |
'"${DEBUG:+set -x}"' | |
'"$1"' |
This file contains hidden or 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 | |
set -euo pipefail \ | |
${DEBUG:+-x} | |
declare -a -- STYX_FREERDP_FLAGS=() | |
declare -A -- STYX_DRIVES=() | |
conf_file="$1" | |
shift |
This file contains hidden or 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
@echo off | |
chcp 65001 > nul | |
set "HOME=%HOMEDRIVE%%HOMEPATH%" | |
C:\msys64\msys2_shell.cmd -defterm -here -no-start -ucrt64 %* | |
rem New-ItemProperty -Path "HKLM:\SOFTWARE\OpenSSH" -Name DefaultShell -Value "C:\msys64\default_shell.cmd" -PropertyType String -Force |
This file contains hidden or 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 | |
set -euo pipefail \ | |
${DEBUG:+-x} | |
readarray active_rdp_sessions <<< "$(query session | sed 's/^>/> /; s/^ /- /' \ | |
| awk 'NR > 1 && $2 ~ /^rdp-/ && $5 == "Active" { print $1"\t"$2"\t"$3"\t"$4 }')" | |
for line in "${active_rdp_sessions[@]}"; do | |
IFS=$'\t' read -r cur_flag session username session_id <<< "$line" |
This file contains hidden or 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
- name: Install Docker on RHEL | |
hosts: rhel_servers | |
become: true | |
tasks: | |
- name: Ensure required packages are installed | |
ansible.builtin.dnf: | |
state: present | |
name: | |
- dnf-plugins-core |
This file contains hidden or 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
import time | |
import warnings | |
from typing import Sequence, Union, Iterable | |
import numpy as np | |
import pypdf | |
_PDF_FILTER_WITH_LOSS = [ | |
"DCTDecode", "DCT", | |
"JPXDecode", |
This file contains hidden or 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 Union, Tuple, Iterable, Iterator | |
class LeveledKV: | |
Key, Value = str, Union[str, 'LeveledKV'] | |
Entry = Tuple[Key, Value] | |
def __init__(self): | |
self._store = dict() |
This file contains hidden or 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 | |
curl -L -- "${1-https://controlplane.tailscale.com/derpmap/default}" \ | |
| jq 'walk(if type == "object" then with_entries(.key |= ascii_downcase) else . end)' \ | |
| yq -p json -o yaml '.regions |= with_entries(.key |= (tonumber // .))' > derps.yaml |
This file contains hidden or 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
const __QURE_ROOT = 'https://raw.githubusercontent.com/Koolson/Qure/master/IconSet/'; | |
const __RIS = new Map(Array.from('ABCDEFGHIJKLMNOPQRSTUVWXYZ').map((ch) => | |
[ch, String.fromCodePoint(ch.charCodeAt() - 0o101 + 0x1F1E6)])); | |
function flagOf(regionCode) { | |
return Array.from(regionCode).map((c) => __RIS.get(c)).join(''); | |
} | |
function main(config, profileName) { |
NewerOlder