Skip to content

Instantly share code, notes, and snippets.

@xergio
xergio / graphite.md
Created July 21, 2017 07:09 — forked from albertohm/graphite.md
Install and configure graphite on ubuntu

Install python-pip

sudo apt-get install python-pip libcairo2 python-cairo

Install Graphite and Dependencies

pip install carbon
pip install whisper
pip install django
pip install django-tagging
pip install graphite-web
@xergio
xergio / info.txt
Created July 11, 2017 10:13
nginx + letsencrypt
$ mkdir -p /var/www/letsencrypt/.well-known/acme-challenge
$ sudo systemctl restart nginx
$ ~/opt/letsencrypt/letsencrypt-auto -c /etc/letsencrypt/webroot.ini -d domain.com certonly
# renew certs
$ ~/opt/letsencrypt/letsencrypt-auto renew --renew-hook "systemctl restart nginx"
# crontab
@weekly ~/opt/letsencrypt/letsencrypt-auto renew --renew-hook "systemctl restart nginx"
@xergio
xergio / weakauras_new-aggro
Created July 4, 2017 09:39 — forked from kodewulf/weakauras_new-aggro
WeakAuras Aggro Table Export
{
["outline"] = true,
["fontSize"] = 28,
["color"] = {
[1] = 1,
[2] = 0.086274509803922,
[3] = 0.11372549019608,
[4] = 1,
},
["displayText"] = "%c",
@xergio
xergio / do-config.sh
Created June 29, 2017 09:22
Create and destroy DigitalOcean droplets from snapshots
# https://cloud.digitalocean.com/settings/api/tokens
TOKEN="digitalocean api key"
DO_API="https://api.digitalocean.com/v2"
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "$DO_API/account/keys"
SSH_KEY_IDS="key1,key2,..."
# curl -X GET -H 'Content-Type: application/json' -H "Authorization: Bearer $TOKEN" "$DO_API/snapshots"
SNAPSHOT="snapshot id"
@xergio
xergio / youtube2twitch.sh
Last active August 13, 2017 06:34
Send YouTube live stream to Twitch
#! /bin/bash
TWITCH_RTMP="rtmp://live-cdg.twitch.tv/app/live_ID_KEY" #?bandwidthtest=true"
# You can change "cdg" with any other server: https://twitchstatus.com/
if [ -z "$1" ]; then
echo "The YouTube URL is mandatory"
echo "Usage: $0 https://youtu.be/Video_ID"
exit 1
fi

Build the following and make it run as fast as you possibly can using Python 3 (vanilla). The faster it runs, the more you will impress us!

Your code should:

All of that in the most efficient way you can come up with.

ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@xergio
xergio / gist:cea1bba43d8e71ca3f2a9932506b2f5e
Created May 4, 2017 09:36 — forked from mtigas/gist:952344
Mini tutorial for configuring client-side SSL certificates.

Client-side SSL

For excessively paranoid client authentication.

Using self-signed certificate.

Create a Certificate Authority root (which represents this server)

Organization & Common Name: Some human identifier for this server CA.

openssl genrsa -des3 -out ca.key 4096
openssl req -new -x509 -days 365 -key ca.key -out ca.crt
@xergio
xergio / letsencrypt_2016.md
Created April 28, 2017 12:58 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 16.04 (including IPv6, HTTP/2 and A+ SLL rating)

There are two modes when you don't want Certbot to edit your configuration:

  • Standalone: replaces the webserver to respond to ACME challenges
  • Webroot: needs your webserver to serve challenges from a known folder.

Webroot is better because it doesn't need to replace Nginx (to bind to port 80) to renew certificates.

In the following, we're setting up mydomain.com to be served from /var/www/mydomain, and challenges will be served from /var/www/letsencrypt.

#!/usr/bin/env bash
echo Git Commit Sequence
echo Adding files...
git add *
echo Enter your commit message:
read message
git commit -m "$message"
echo Pushing files to website...
git push
echo Sequence done. It may take a few moments for Jekyll to build the files properly.