Skip to content

Instantly share code, notes, and snippets.

Avatar
🀄
Focusing

Per Guth perguth

🀄
Focusing
View GitHub Profile
View keybase.m
### Keybase proof
I hereby claim:
* I am perguth on github.
* I am perguth (https://keybase.io/perguth) on keybase.
* I have a public key ASD3o_J-jMaLeKSggjQSgtldX8rQ6LSnINuqT-WFNriRcgo
To claim this, I am signing this object:
@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 Aug 18, 2020
Configure ChromeOS Linux for a full stack developer.
View chromeos-setup
#!/bin/sh
# Configure ChromeOS Linux for a full stack developer.
#
# 🚀 More stable setup script here:
# https://github.com/perguth/chromeos-playbook
#
@perguth
perguth / theia
Last active May 6, 2020
👩‍💻 Start Theia in the current directory and open browser window.
View theia
#!/bin/sh
# Start Theia in the current directory and open browser window.
# Theia configuration will be stored under ~/.theia
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 $