Skip to content

Instantly share code, notes, and snippets.

View adriantorrie's full-sized avatar

Adrian Torrie adriantorrie

View GitHub Profile
@adriantorrie
adriantorrie / git_undo.sh
Last active January 26, 2016 10:23
Steps to clean a git repo that has unstaged changes
# http://stackoverflow.com/questions/14075581/git-undo-all-uncommitted-changes
git reset
git checkout .
git clean -fdx
git pull
# make all shell files in the repo /bin directory executable
find ./bin -name "*.sh" -exec chmod u+x {} \;
@pjbull
pjbull / jupyter_notebook_config.py
Last active November 13, 2023 20:17
Create .py and .html on save of Jupyter notebook
import os
import re
from nbconvert.nbconvertapp import NbConvertApp
from nbconvert.postprocessors.base import PostProcessorBase
class CopyToSubfolderPostProcessor(PostProcessorBase):
def __init__(self, subfolder=None):
self.subfolder = subfolder
# Try to get futures working with Zipline
import pytz
import pandas as pd
import matplotlib.pyplot as plt
import Quandl
from zipline.api import *
from zipline.algorithm import TradingAlgorithm
from zipline.finance.trading import TradingEnvironment
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@troyharvey
troyharvey / deployment.yml
Last active April 20, 2025 15:39
Using Kubernetes envFrom for environment variables
# Use envFrom to load Secrets and ConfigMaps into environment variables
apiVersion: apps/v1beta2
kind: Deployment
metadata:
name: mans-not-hot
labels:
app: mans-not-hot
spec:
replicas: 1
@brentjanderson
brentjanderson / Howto.md
Created February 20, 2018 17:55
SSH Tunneling with Firefox

Sometimes it is useful to route traffic through a different machine for testing or development. At work, we have a VPN to a remote facility that we haven't bothered to fix for routing, so the only way to access a certain machine over that VPN is via an SSH tunnel to a machine that is reachable over the VPN. Other times, I have used this technique to test internet-facing requests against sites I am developing. It is pretty easy, and if you don't use firefox regularly, you can treat Firefox as your "Proxy" browser and other browsers can use a normal configuration (Although you can also configure an entire system to use the proxy, other articles exists that discuss this potential).

  1. Open a terminal
@yiays
yiays / openssh-for-windows-proxyjump-guide.md
Last active March 25, 2024 06:21
How to setup OpenSSH for Windows for ProxyJumping

ProxyJumping

Introduction

ProxyJumping is a method used to get access to a terminal in a private network via SSH.

First, you SSH into a JumpGate (a SSH server exposed to the internet), and then use that JumpGate to pass through a SSH connection to a machine on the JumpGate's local network. By the end of this guide, you should be able to seamlessly connect to a remote private host through a JumpGate with one parameter in a ssh command.

Security should always be paramount when establishing connections like this because the password of a JumpGate can and will be brute-forced by bots on the internet constantly.

Compatiblilty notes

The provided client-side commands are intended for PowerShell. Open PowerShell by right-clicking on the start menu button and selecting Windows Powershell.