Skip to content

Instantly share code, notes, and snippets.

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

James allen-munsch

⁉️
View GitHub Profile
@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.
@craSH
craSH / iptables-sol.sh
Last active September 4, 2018 18:23
Masquerade/redirect incoming TCP connections on all ports (1:65535) to $dst_ip port $dst_port.Great for creating a proxy/jump box that lets you SSH to your server, in cases when you're on strange/(poorly) restrictive networks and need to tunnel out.
#!/bin/bash
#
# Masquerade/redirect incoming TCP connections on all ports (1:65535) to $dst_ip port $dst_port
# Call with -f to force update, even if IP cache exists and shows no changes.
# Make sure this isn't a CNAME! Otherwise the below dig command won't follow it and return an IP.
dst_host="neg9.org"
target_ns="google-public-dns-a.google.com"
dst_port=22
@smoser
smoser / cloud-to-lxd
Last active January 10, 2019 16:07
lxc tools. Random tools around lxc.
#!/bin/bash
VERBOSITY=0
TEMP_D=""
UC_PREP="/usr/share/lxc/hooks/ubuntu-cloud-prep"
error() { echo "$@" 1>&2; }
fail() { [ $# -eq 0 ] || error "$@"; exit 1; }
Usage() {
@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"
@mdbecker
mdbecker / gist:1309633
Created October 24, 2011 17:50
multiprocess && gevent example
from multiprocessing import Pool as MPool
from time import sleep
import datetime
import multiprocessing
import random
def time_request():
from gevent import monkey; monkey.patch_socket
from jsonrequester import JsonRequester
@gustavohenrique
gustavohenrique / soap-curl-shell
Created June 11, 2013 19:24
SOAP request using curl
# request.xml
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wst="http://sensedia.com/repository/wstoolkit">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-1">
<wsse:Username>system</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">manager</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">DWk64SMfJ6RxHAKgPRGtPA==</wsse:Nonce>
<wsu:Created>2013-04-17T18:36:54.013Z</wsu:Created>
</wsse:UsernameToken>
@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];
@indiejoseph
indiejoseph / gist:3047593
Created July 4, 2012 14:13
UserScript - XHR Interceptor
function Interceptor(nativeOpenWrapper, nativeSendWrapper) {
XMLHttpRequest.prototype.open = function () {
// Code here to intercept XHR
return nativeOpenWrapper.apply(this, arguments);
}
XMLHttpRequest.prototype.send = function () {
this.onloadend = function() {
if(this.capture) {
console.log(this.responseText);
@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.