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
{ | |
"hosts": [ | |
"tcp://172.16.1.200:2375", | |
"unix:///var/run/docker.sock" | |
], | |
"exec-opts": [ | |
"native.cgroupdriver=cgroupfs" | |
] | |
} |
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
sleep 3 | |
xinput set-prop "pointer:Getech HUGE TrackBall" "libinput Button Scrolling Button" 10 | |
xinput set-prop "pointer:Getech HUGE TrackBall" "libinput Scroll Method Enabled" 0 0 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
# Loads .env files with comments and values containing spaces | |
IFS="\n" env "$(cat .env | sed -r 's/#.+$//gi;/^\s*$/d')" printenv |
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 | |
DEVICE_NAME="Bose QC35 II" | |
DEFAULT_PROFILE="High Fidelity Playback (A2DP Sink, codec AAC)" | |
HEADSET_PROFILE="Headset Head Unit (HSP/HFP, codec mSBC)" | |
function get-headphones-id() { | |
local dev_name="$1" | |
pw-cli dump Device | grep -B 8 '"'"$dev_name"'"' | head -n1 | awk '{ print $2 }' |
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
#!/bin/bash | |
while read line | |
do | |
echo -e "\x1b[48;5;235m$line\x1b[K\x1b[0m" | |
read line | |
echo -e "$line" | |
done |
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
v1=$(docker-compose --version | awk '{print $3}' | sed 's/,//gi') | |
v2="1.20" | |
compose_v="1.26.0" | |
python3 -c "a, b = tuple(map(lambda x: int(x[0]) + int(x[1]) * 0.001, map(lambda s: s.split('.'), ['$v1', '$v2']))); exit(int(a < b))" \ | |
|| { | |
sudo apt remove -f docker-compose | |
sudo curl -L "https://github.com/docker/compose/releases/download/${compose_v}/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose; | |
} |
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
echo -e "services: {a: 'foo'}" \ | |
| python -c "import sys; import json; import yaml; print(json.dumps(yaml.safe_load(''.join(l for l in sys.stdin))))" \ | |
| jq . |
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
# https://www.parallels.com/blogs/ras/configuring-windows-server-firewall-for-parallels-ras/ | |
Set-Service sshd -StartupType Automatic | |
Set-Service ssh-agent -StartupType Automatic | |
New-NetFirewallRule -DisplayName "OpenSSH" -Direction Inbound -Action -Allow -Protocol TCP -LocalPort 22 |
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
#!/bin/bash | |
# This script runs ssh-agent if it does not running | |
# or uses existing ssh-agent instance. | |
# Loads a private key ONLY IF you are running an interactive shell. | |
cat << 'SH' >> ~/.profile | |
export SSH_AUTH_SOCK=$(\ | |
find /tmp \ | |
-path '*/ssh-*' -name 'agent*' -uid $(id -u) 2>/dev/null \ |
NewerOlder