Skip to content

Instantly share code, notes, and snippets.

@psychoweb
psychoweb / redbean.service
Last active February 2, 2022 09:59
systemd service file for redbean
# path: /etc/systemd/system/redbean.service
# (sudo) systemctl daemon-reload
[Unit]
Description=single-file distributable web server
After=network.target
[Service]
EnvironmentFile=/etc/conf.d/redbean
ExecStart=/bin/bash -C /usr/local/bin/redbean.com $DAEMON_OPTS
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDCshLazRgmdaWratuYtVHykFHyDbnRJU+vWWycBKXS1 JuiceSSH
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAqQkhvoAEoVqS1+t5Fv6ECRXpyLmaoOxhSrlVOn5VytejRJztfqYcBeNlTJ7rA8g7aAIq8SrbTfAMhWzkUOd0a/ib1V37WT85dw+PuUqn64Cl1mJ8DKpICTyb3LxOBradgczaZNX6JSa8+GudIfIFQ9HSEJxB0+LvDAhfxgSmoF3bbROYTgkvrb4NcHPtdeU3SRjxFO6UBZ3b3u/je3s1rzRCiho/+rHf1kQMt/LraD4WdcoJ0k09dpSC4NwvuU2v2h9kxLETxnzanID1e7FGYrIKMMmIA423rdScUd/WAl8JTOToucHdOZpop28SGuGHc9Ei5Xf7t9HWWpsyohlXRw== rsa-key-20180711
@psychoweb
psychoweb / https.py
Last active February 7, 2019 10:55
Quick&Dirty HTTPS Server in Python3 for certificates generated with certbot.
#!/usr/bin/python3
import http.server
import ssl
import sys
sys.stdout.write('USAGE: {} domain [port]\n\n'.format(sys.argv[0]) if (len(sys.argv) < 2) else '')
domain = sys.argv[1]
port = int(sys.argv[2]) if (len(sys.argv) > 2) else 443
certbot_prefix = '/etc/letsencrypt/live/{}'.format(domain)
sys.stdout.write('Starting https://{}{}\n'.format(domain,':{}'.format(port) if port != 443 else ''))
@psychoweb
psychoweb / welfaretokenfund.sol
Last active February 20, 2017 08:49
Welfare Token Fund Smart Contract (0.4.9, not optimized)
pragma solidity ^0.4.2;
contract mortal {
/* Define variable owner of the type address*/
address owner;
/* this function is executed at initialization and sets the owner of the contract */
function mortal() { owner = msg.sender; }
/* Function to recover the funds on the contract */

Keybase proof

I hereby claim:

  • I am psychoweb on github.
  • I am psychoweb (https://keybase.io/psychoweb) on keybase.
  • I have a public key ASB5KhQiQ13tTsu55dzx5kkjWP2W6PyoDUc9kGf5gRfOWQo

To claim this, I am signing this object:

@psychoweb
psychoweb / 3x3x3scrambler.py
Created October 1, 2015 13:13
3x3x3 rubik's cube scrambler
#!/usr/bin/env python2
from random import randrange
if __name__ == '__main__':
f = ['R','L','U','D','F','B'] # 2x3 flattened matrix
d = ['','\'','2']
last_f_index = [randrange(len(f)),randrange(len(f))]
s = ''
i = 0
@psychoweb
psychoweb / locked.png
Last active August 22, 2017 16:06
screen locker that randomly filter the current desktop. To use with i3lock and imagemagick
locked.png