Skip to content

Instantly share code, notes, and snippets.

@cmachmeier75
cmachmeier75 / sshss.sh
Created November 22, 2021 08:55
SSH Server Selector (sshss)
#!/bin/bash
set -e
echo "SSH Server Selector (sshss)"
echo ""
echo "The following SSH-connection are available:"
export PS3="Which connection do you choose? "
hosts="$(grep Host ~/.ssh/config | grep -iv HostName | awk '{print $2}')"
select host in ${hosts}; do echo "Connecting to ${host}..."; echo ""; ssh ${host}; break; done
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
var STRUCTURE_LIST = 'List';
@cmachmeier75
cmachmeier75 / fix-wsl.sh
Created January 11, 2021 18:13
When WSL (Ubutnu) on Windows 10 w/ VPN does not work, fix resolv.conf and MTU
#!/bin/bash │Get:19 http://archive.ubuntu.com/ubuntu groovy-updates/universe amd64 DEP-11 Metadata [15.0 kB]
│Get:20 http://archive.ubuntu.com/ubuntu groovy-backports/universe amd64 DEP-11 Metadata [600 B]
sudo rm -f /etc/resolv.conf │Get:21 http://archive.ubuntu.com/ubuntu groovy-security/main amd64 DEP-11 Metadata [4,676 B]
│Get:22 http://archive.ubuntu.com/ubuntu groovy-security/universe amd64 DEP-11 Metadata [2,816 B]
read -r -d '' resolvconf <<'EOF'