Skip to content

Instantly share code, notes, and snippets.

👷

Per (ᵔᴥᵔ) perguth

👷
Block or report user

Report or block perguth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@perguth
perguth / sslh
Last active Dec 12, 2019
Configures the port multiplexer `sslh`.
View sslh
# Configures the port multiplexer sslh
# https://github.com/yrutschle/sslh
# Place in /etc/defaults/sslh
RUN=no
DAEMON=/usr/sbin/sslh
DAEMON_OPTS="--user sslh --listen [201:6779:c497:82f:68fd:188d:4338:1234]:443 --listen 0.0.0.0:443 --tls 127.0.0.1:4443 --anyprot 127.0.0.1:44478 --pidfile /var/run/sslh/sslh.pid"
@perguth
perguth / shell
Created Dec 12, 2019
Shared terminal start script.
View shell
#!/bin/sh
# Place in `/usr/local/bin/shell`
# Starts a terminal session that is shared among endpoints.
/usr/bin/tmux new -A -s session1
@perguth
perguth / chromeos-setup
Last active Jan 11, 2020
Configure ChromeOS Linux for a full stack developer.
View chromeos-setup
#!/bin/sh
# Configure ChromeOS Linux for a full stack developer.
sudo apt install -y git-svn
git config --global user.email "mail@perguth.de"
git config --global user.name "Per Guth"
# Apt sources and keys
@perguth
perguth / theia
Last active Nov 7, 2019
👩‍💻 Start Theia in the current directory and open browser window.
View theia
#!/bin/sh
# Start Theia in the current directory and open browser window.
previousInstance=$(docker ps -q --filter ancestor=theiaide/theia:next --format="{{.ID}}")
if [ "$previousInstance" ]; then
docker kill $previousInstance > /dev/null
fi
@perguth
perguth / nano
Last active Sep 13, 2019
⏲️📝 Back ups every file that gets touched by `nano`.
View nano
#!/bin/sh
# Back ups every file that gets touched by `nano`.
# Install by:
# 1. `sudo mv /bin/nano /bin/nano-real`
# 2. Put this file in `/usr/local/bin` and make it executable.
# 3. Set your user:
backupFolder=$HOME/.system-changes
currentFolder=$(pwd)
View .bashrc
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
export PATH="$PATH:`yarn global bin`"
export MOSH_TITLE_NOPREFIX=1
export GOROOT=/usr/local/go
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:/usr/local/go/bin:$PATH
export PATH=$PATH:~/.cargo/bin
@perguth
perguth / index.html
Last active Aug 16, 2019
Some website starter.
View index.html
<!doctype html>
<title>My website</title>
<!-- Validate your own here: https://validator.w3.org/ -->
<main>
<h1>My website</h1>
<p>Some texts.</p>
</main>
@perguth
perguth / computer
Last active Jul 23, 2019
Sleep host when Mosh is idle. Wake up on reconnect.
View computer
#!/bin/sh
wake-computer
echo 🚀 Connecting Mosh.
mosh user@computer.y
View code-server
#!/bin/bash
# /usr/local/bin/code
# Start [code-server](https://github.com/cdr/code-server)
# Mounts `~/.code-server` to store configuration
# Only a single `code-server` instance at at time
PORT=8040
docker kill $(docker ps -q --filter ancestor=codercom/code-server --format="{{.ID}}") &> /dev/null $
@perguth
perguth / start-yggdrasil
Last active Jul 20, 2019
Start `yggdrasil` when the tun device is added to lxc
View start-yggdrasil
#!/bin/sh
# Check if Yggdrasil is connected. If not make it to.
if ! ip a show tun0 up
then
service yggdrasil restart
exit 1
fi
You can’t perform that action at this time.