Automating drudgery


As I've been doing a lot of reinstalling and moving around lately, I got tired of doing the same thing over and over again, and decided to automate some of it, as I was planning for a long time.

First up, opening up the live system for SSH connections using my keys.
mkdir -p .ssh
chmod 700 .ssh
cd .ssh
curl -sSL >> authorized_keys
chmod 600 authorized_keys

echo "All done, backdoor'd"
curl -sSL | sh

CAUTION: do not run this unless you are particularly keen on me having access to your system. Also, do not run any shell script you don't understand with curl | sh, it could have literally any effect, up to and including deleting all your data and borking hardware. This is for me to set access up on throwaway live systems, you can modify it to suit your needs, but please don't run it as-is. I'm calling it a backdoor half-jokingly, but it's basically what it is. Or a front door, even.

git clone

All of this is facilitated by a little bit of nginx magic:

server {
    listen 443 ssl;
    override_charset on;
    charset utf-8;
    access_log /var/log/nginx/;
    error_log /var/log/nginx/ error;

    location / {
        root /srv/http/;

    location /strap {

    # <certbot config skipped>

Update: I no longer endorse SourceHut, since the author had a fit and basically banned all cryptocurrency projects, for no other reason that he doesn't like it. Putting aside whether one should or shouldn't agree with his contentions about the tech, that's no way to run a neutral platform, which a code forge should be, at least in my opinion.