Skip to content

Instantly share code, notes, and snippets.

Avatar

Matt Gorecki mattgorecki

View GitHub Profile
@justinjahn
justinjahn / README.md
Last active Oct 19, 2021
Minecraft server(s) using systemd and screen.
View README.md

Install

# Install dependencies
sudo yum install -y java-1.8.0-openjdk screen

# Create a new unprivileged user for minecraft
useradd -r -m -d /opt/minecraft minecraft

# Create the directory that will house our minecraft instances
sudo su --shell /bin/bash minecraft
@radupotop
radupotop / iperf3.service
Last active Jan 12, 2019
iperf3.service for systemd
View iperf3.service
[Unit]
Description=iperf3 server
After=syslog.target network.target auditd.service
[Service]
User=iperf
ExecStart=/usr/bin/iperf3 -s --logfile /var/log/iperf.log
[Install]
WantedBy=multi-user.target
@kyledrake
kyledrake / ferengi-plan.txt
Last active Jul 12, 2021
How to throttle the FCC to dial up modem speeds on your website using Nginx
View ferengi-plan.txt
# The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited
#
# Current known FCC address ranges:
# https://news.ycombinator.com/item?id=7716915
#
# Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft
#
# In your nginx.conf:
location / {
@tmornini
tmornini / gist:10551841
Last active Nov 24, 2015
Subledger v2 create_and_post JSON body
View gist:10551841
{
"effective_at": "ISO8601 Date/Time",
"description": "Free form text",
"reference": "URL",
"lines": [
{
"account": "account_id",
"value": {
"type": "debit",
"amount": "10.00"
View peaks.py
#! /usr/bin/python
import Image
#_______________________________________________________load image/create 'canvas'
source = Image.open("test26.jpg")
img = source.load()
print source.format
View Japanify.py
#! /usr/bin/python
import Image
#Created by vvdr12
#Fully open license. Have fun.
#change threshold value in 'def contrastpoints' for higher/lower line density.
#put a 'test.jpg' file in the same folder as the code.
#_functions______________________________________________
View base_62_converter.py
#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
@mahmoudimus
mahmoudimus / fabfile.py
Created Apr 30, 2010 — forked from cyberdelia/fabfile.py
fabric deployment example
View fabfile.py
from fabric.api import env, run, sudo, local, put
def production():
"""Defines production environment"""
env.user = "deploy"
env.hosts = ['example.com',]
env.base_dir = "/var/www"
env.app_name = "app"
env.domain_name = "app.example.com"
env.domain_path = "%(base_dir)s/%(domain_name)s" % { 'base_dir':env.base_dir, 'domain_name':env.domain_name }