Skip to content

Instantly share code, notes, and snippets.

View imylomylo's full-sized avatar

Captain Mylo imylomylo

View GitHub Profile
@imylomylo
imylomylo / gist:1011ca329621ce1c4b86cbc3e0de7ac5
Last active March 8, 2019 05:59
Iguana restart terminates unexpectedly from script (hypothesis)
#############
ENV different
#############
My cron restarts iguana like this:
13 0 * * 1 . $HOME/.profile;/home/me/cron_rotate.sh 2>&1
The `. $HOME/.profile` is needed because the cron ENV is not the same as the logged in user ENV.
##########################
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-apache
certbot --apache -d example.com -d www.example.com
certbot renew --dry-run
Need to check out
https://medium.com/@richardkall/setup-lets-encrypt-ssl-certificate-on-amazon-cloudfront-b217669987b2
docker pull gitlab/gitlab-ce
docker run --detach --hostname git.test.smartad.com.au --publish 2180:80 --name gitlab --restart always --volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:latest
docker exec -it mediawiki /bin/bash
# Disable reading by anonymous users
$wgGroupPermissions['*']['read'] = false;
# Disable anonymous editing
$wgGroupPermissions['*']['edit'] = false;
# Prevent new user registrations except by sysops
sudo a2enmod proxy
sudo a2enmod proxy_http
sudo a2enmod proxy_balancer
sudo a2enmod lbmethod_byrequests
sudo systemctl restart apache2
<VirtualHost *:443>
SSLEngine on
RequestHeader set X-Forwarded-Proto 'https'
@imylomylo
imylomylo / docker-install-ubuntu1804.md
Last active June 20, 2019 10:11
docker-install-ubuntu-18.04
   sudo apt update
   sudo apt install apt-transport-https ca-certificates curl software-properties-common
   curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
   sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
   sudo apt update
   apt-cache policy docker-ce
   sudo apt install docker-ce
   sudo systemctl status docker
 sudo usermod -aG docker ${USER}
komodod -regtest -ac_name=REGTESTKMDICE -pubkey=03511aab41ccdef8586a79460765c1f260b6082a52772dfb80054ba17c74652f81 -ac_cc=2 -ac_supply=5000
sudo fallocate -l 4G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
@imylomylo
imylomylo / gist:7e2fc21c855b130b4c28ef095d208f16
Last active December 5, 2018 09:11
rate limit bad miners
-N BADMINER creates a new iptables chain called "BADMINER"
-A INPUT appends to the "INPUT" chain this rule, which searches for the string "authorize" on tcp/4646 and then jumps (-j) to the rules of chain BADMINER (-j BADMINER)
-A BADMINER has the rate limit of 10/min and logs to syslog
iptables -N BADMINER
iptables -A BADMINER -m limit --limit 10/min -j LOG --log-prefix "BADMINER DROP: "
iptables -A BADMINER -m comment --comment "Rate limit exceeded, reject" -j REJECT
iptables -A INPUT -i eth0 -p tcp -m tcp --dport 4646 -m string --string "authorize" --algo bm -m comment --comment "Catch BADMINER" -j BADMINER
https://medium.com/@nickdenardis/working-with-vuepress-v0-10-and-tailwind-css-v0-6-f9a928fbae98