Skip to content

Instantly share code, notes, and snippets.

View allen-munsch's full-sized avatar
⁉️

James allen-munsch

⁉️
View GitHub Profile
#!/usr/bin/env bash
# Given a commit sha (defaults to current commit), creates PRs for every
# branch on the stack of the given commit. Each PR is created with its base
# as the nearest ancestor of the given branch that is also a branch.
set -euo pipefail
commit="${1:-.}"
base="$(git config branchless.core.mainBranch)"
remote="origin"
@MitchRatquest
MitchRatquest / forward
Last active April 17, 2019 14:09
iptables forwarding script, basic and working
#!/bin/bash
if [ $UID != 0 ]; then echo "Please run as root"; exit 1; fi
SUBNET_ADDRESS='10.0.0.1'
SUBNET_RANGE='10.0.0.2,10.0.0.100,12h'
INTERNET="eno1" #upstream
SUBNET="enp7s0f0" #downstream
ifconfig "$SUBNET" "$SUBNET_ADDRESS" #set your ip for downstream
#ip addr add "$SUBNET_ADDRESS" dev "$SUBNET"
@pawl
pawl / readme.md
Last active January 8, 2023 13:39
test to see if psycogreen is necessary to run sqlalchemy + gevent + psycopg2 concurrently

This is a test to see if psycogreen is necessary to run sqlalchemy + gevent + psycopg2 concurrently.

benchmark command (concurrency of 10)

ab -n 10 -c 10 127.0.0.1:8080/wait

psychopg2 - sync worker (expecting concurrency of 2)

gunicorn -b 127.0.0.1:8080 -w 2 test:app

@kenmori
kenmori / error Your lockfile.md
Last active December 4, 2023 14:58
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`

error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.

if you update your package.json only. and then run yarn install --frozen-lockfile

The above error show you on console.

it's say that you need to run just yarn install.

@mohanpedala
mohanpedala / bash_strict_mode.md
Last active May 1, 2024 13:29
set -e, -u, -o, -x pipefail explanation
@MitchRatquest
MitchRatquest / organelle-clone-july5.ino
Created July 6, 2018 00:43
organelle clone controller stm32 blue pill
#include <OSCBundle.h>
#include <SLIPEncodedSerial.h>
#include <OSCMessage.h>
SLIPEncodedSerial SLIPSerial(Serial);
// encoder stuff below vvvvv
#define MAXENCODERS 1
volatile uint32_t encstate[MAXENCODERS];
volatile uint32_t encflag[MAXENCODERS];
@MitchRatquest
MitchRatquest / scroll.py
Last active December 22, 2017 21:21
string scrolling in python with curses
#!/usr/bin/python
import curses
from time import sleep
curses.initscr()
string = "this is a really fun scrolling string "
def scroll(stdscr):
try:
curses.curs_set(0)
@joergsteinkamp
joergsteinkamp / PythonGIS_Intro.ipynb
Created September 7, 2017 06:45
Python GIS example by Christian Werner
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joergsteinkamp
joergsteinkamp / Grass-GIS.ipynb
Last active December 14, 2021 07:40
Simple Opensource GIS examples with Grass and R
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@TySkby
TySkby / timeout.py
Last active March 9, 2023 04:24
Timeout decorator/context manager using signals (for Python 3)
#!/usr/bin/env python3
"""Easily put time restrictions on things
Note: Requires Python 3.x
Usage as a context manager:
```
with timeout(10):
something_that_should_not_exceed_ten_seconds()
```