Skip to content

Instantly share code, notes, and snippets.

View adriantorrie's full-sized avatar

Adrian Torrie adriantorrie

View GitHub Profile
@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.

@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
@troyharvey
troyharvey / deployment.yml
Last active September 13, 2024 19:00
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
# 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
@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
@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 {} \;
@devxoul
devxoul / git-tag-semver.sh
Last active November 11, 2019 12:28
Replace git tags to semantic version
#!/bin/bash
# Replace git tags to semantic version
# e.g. v1.0.0 -> 1.0.0
for vtag in $(git tag -l | awk '$0 ~ /^v/')
do
tag=$(echo $vtag | sed -e 's/^v//')
git tag $tag $vtag
git tag -d $vtag
git push origin :refs/tags/v$tag
@garystafford
garystafford / helpful-docker-commands.sh
Last active August 9, 2024 16:14
My list of helpful docker commands
###############################################################################
# Helpful Docker commands and code snippets
###############################################################################
### CONTAINERS ###
docker stop $(docker ps -a -q) #stop ALL containers
docker rm -f $(docker ps -a -q) # remove ALL containers
docker rm -f $(sudo docker ps --before="container_id_here" -q) # can also filter
# exec into container
@dideler
dideler / upgrade-postgres-9.3-to-9.4.md
Last active June 8, 2020 03:24
Upgrading PostgreSQL from 9.3 to 9.4 when upgrading Ubuntu 14.04 to 14.10

TL;DR

Create a backup:

pg_dumpall > mybackup.sql

Perform the upgrade:

sudo pg_dropcluster 9.4 main --stop