Skip to content

Instantly share code, notes, and snippets.

View jgysland's full-sized avatar

Jake Gysland jgysland

  • Minneapolis, Minnesota
View GitHub Profile
I was drawn to programming, science, technology and science fiction
ever since I was a little kid. I can't say it's because I wanted to
make the world a better place. Not really. I was simply drawn to it
because I was drawn to it. Writing programs was fun. Figuring out how
nature works was fascinating. Science fiction felt like a grand
adventure.
Then I started a software company and poured every ounce of energy
into it. It failed. That hurt, but that part is ok. I made a lot of
mistakes and learned from them. This experience made me much, much
@bgulla
bgulla / rancherOnProx.md
Last active June 17, 2020 16:35
Rancher Install Guide for n00bs

Greenfield Rancher install

Pre-Rancher Steps

Kubernetes Persistent Storage

Head to your synology/freenas and setup a new NFS share just for your kubernetes persistent storage. Make sure to turn off authentication.

Networking - Create a vlan just for your VMs

  1. Create a vlan (10.0.X.1 or 192.168.X.1) just for your VMs in your Unifi Controller, dont worry about firewall or traffic shaping. What I typically do is once I have created the vlan, I go to the Unifi Switch configuration area, and assign the port that the server is being plugged-into as being mapped to my VM-VLAN.
  2. Create a vlan for your Ingress Controller/Metallb. Just create the vlan and we'll worry about the rest later.
@Sporif
Sporif / protonenv
Last active October 4, 2021 16:51
A simple script that sets environment variables to allow launching applications using Proton's wine
#!/usr/bin/env bash
# A simple script that sets environment variables to allow launching applications using Proton's wine
# You can either source the script for use in the current shell, after which you can use wine commands as usual
# Or execute it with a program as the arguments e.g `protonenv winetricks` or `protonenv winecfg`
# Paths to check for Steam installation
STEAM_DIRS="
$HOME/.local/share/Steam
$HOME/.steam/steam
@gaearon
gaearon / modern_js.md
Last active July 18, 2024 10:37
Modern JavaScript in React Documentation

If you haven’t worked with JavaScript in the last few years, these three points should give you enough knowledge to feel comfortable reading the React documentation:

  • We define variables with let and const statements. For the purposes of the React documentation, you can consider them equivalent to var.
  • We use the class keyword to define JavaScript classes. There are two things worth remembering about them. Firstly, unlike with objects, you don't need to put commas between class method definitions. Secondly, unlike many other languages with classes, in JavaScript the value of this in a method [depends on how it is called](https://developer.mozilla.org/en-US/docs/Web/Jav
@anthonyeden
anthonyeden / simplistic-ffmpeg-streaming.py
Created May 28, 2018 11:46
Sending FFmpeg output to HTTP, via Python's Flash
"""
Streaming FFmpeg to HTTP, via Python's Flask.
This is an incredibly simple example, which will yield issues due to inconsistant input and output rates.
If you're going to use this, VLC works okay as a client.
You really need to move FFmpeg into a separate thread, which should help stream audio more consistantly to the HTTP client.
Example by Anthony Eden (https://mediarealm.com.au)
"""
from flask import Flask
@adamhaney
adamhaney / dag.py
Created June 14, 2017 18:10
DBT Airflow DAG with model/graph introspection
from datetime import datetime, timedelta
import networkx as nx
from airflow import DAG
from airflow.operators import BashOperator, SubDagOperator
start_date = datetime(year=2017, month=6, day=13, hour=19, minute=0)
schedule_interval = '0 * * * 1-5'
default_args = {
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active June 5, 2024 21:05
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@criccomini
criccomini / airflow-supervisord.conf
Created June 22, 2016 14:54
airflow-supervisord.conf
; Configuration for Airflow webserver and scheduler in Supervisor
[program:airflow]
command=/bin/airflow webserver
stopsignal=QUIT
stopasgroup=true
user=airflow
stdout_logfile=/var/log/airflow/airflow-stdout.log
stderr_logfile=/var/log/airflow/airflow-stderr.log
environment=HOME="/home/airflow",AIRFLOW_HOME="/etc/airflow",TMPDIR="/storage/airflow_tmp"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jsheedy
jsheedy / iter_file.py
Last active June 16, 2024 15:27
Sometimes you need a file-like object when all you have is an iterator, for instance when using psycopg2's cursor.copy_from. This class will handle the impedance mismatch.
import io
import sys
class IteratorFile(io.TextIOBase):
""" given an iterator which yields strings,
return a file like object for reading those strings """
def __init__(self, it):
self._it = it
self._f = io.StringIO()