Skip to content

Instantly share code, notes, and snippets.

@rterbush
rterbush / ssh.ps1
Created April 17, 2023 14:16 — forked from Hashbrown777/ssh.ps1
A workaround for Windows official openssh client not supporting -f nor -N
#accepts all arguments for ssh except command, -N and -f
#command can be piped in
Filter ssh-f {
$N = $False
if (!$_) {
#the same as -N
$_ = 'read'
$N = $True
}
$_ = 'echo SUCCESS;' + $_
@rterbush
rterbush / DownloadFromIB.py
Created December 29, 2021 18:41 — forked from jwsmithers/DownloadFromIB.py
Function to download from IB
from ib_insync import *
import asyncio
import nest_asyncio
async def update_from_IB(stock):
"""
Asynchronous call example to update stocks from Interactive broker.
Args:
stock(str): Stock, I.e. AAPL
from django.db import models
from wagtail.wagtailcore.models import Page
from satchless.item import StockedItem
from wagtail.wagtailimages.edit_handlers import ImageChooserPanel
from wagtail.wagtailadmin.edit_handlers import (TabbedInterface, ObjectList,
PageChooserPanel, FieldPanel,
InlinePanel, MultiFieldPanel)
#from wagtail.wagtailadmin.views.pages import PAGE_EDIT_HANDLERS
from wagtail.wagtailcore.fields import RichTextField
from wagtail.wagtailcore.models import Orderable
@rterbush
rterbush / wireless-link-wds.sh
Created October 23, 2017 01:28 — forked from braian87b/wireless-link-wds.sh
How to setup Wireless Links to avoid Wired backbone using WDS on Atheros for OpenWRT / LEDE
@rterbush
rterbush / cool_gpu2.sh
Created September 28, 2017 22:15 — forked from squadbox/cool_gpu2.sh
A script to control Nvidia GPU fan speed on headless (non-X) linux nodes
#!/bin/bash
# cool_gpu2.sh This script will enable or disable fixed gpu fan speed
#
# Description: A script to control GPU fan speed on headless (non-X) linux nodes
# Original Script by Axel Kohlmeyer <akohlmey@gmail.com>
# https://sites.google.com/site/akohlmey/random-hacks/nvidia-gpu-coolness
#
# Modified for newer drivers and removed old work-arounds
@rterbush
rterbush / pairs.py
Created February 28, 2017 05:18 — forked from dat-boris/pairs.py
Quantopian tool for researching pair trading algorithm
"""
A simple tool for researching Pairs based on:
https://www.quantopian.com/clone_notebook?id=57ed7c41144f8837290000da
"""
from datetime import date, timedelta
import matplotlib.pyplot as plt
from statsmodels.tsa.stattools import coint
from zipline import TradingAlgorithm
@rterbush
rterbush / update-route53.sh
Created October 29, 2016 22:16 — forked from d90/update-route53.sh
BASH Script to keep Route53 updated with your current external IP address
#!/bin/bash
# (optional) You might need to set your PATH variable at the top here
# depending on how you run this script
#PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
# Hosted Zone ID e.g. BJBK35SKMM9OE
ZONEID="enter zone id here"
# The CNAME you want to update e.g. hello.example.com
@rterbush
rterbush / MockSQS.java
Created October 11, 2016 14:47 — forked from UnquietCode/MockSQS.java
Mock AWS SQS implementation which operates in-memory rather than hitting the real SQS.
package com.studyblue.test.aws;
import com.amazonaws.AmazonClientException;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.AmazonWebServiceRequest;
import com.amazonaws.ResponseMetadata;
import com.amazonaws.regions.Region;
import com.amazonaws.services.sqs.AmazonSQS;
import com.amazonaws.services.sqs.model.*;
import com.google.common.hash.Hashing;

For me the perfect developer (if there is such a person) has these qualities:

  • Friendly: is respected and liked by all they work with and are always approachable (even in times of stress)
  • Humble: has great humilty and is not driven by ego
  • Calm: doesn't get emotive within discussions (including discussions that are both in their favour and those that aren't)
  • Understanding: appreciates that business requirements do change regularly and that there are no perfect scenarios; so is able to adapt to problematic situations in the appropriate manner
  • Agile: recognises when they are potentially moving down a rabbit hole/time sink/yak shave and will successfully re-evaluate the situation and refocus their attention
  • Patient: appreciates that no dev is born equal and so varying soft/practical skills will be encountered
  • Experienced: has a wide ranging skill set with relevant practical experience and most importantly realises the fundamentals of simple code design and recognised patt
@rterbush
rterbush / ec2query.boot
Created June 16, 2016 16:10 — forked from alandipert/ec2query.boot
Example of querying AWS infrastructure with Amazonica and Datomic, in Clojure with Boot-clj
#!/usr/bin/env boot
;; or `BOOT_FILE=ec2query.boot boot repl' for interactive use
(set-env! :dependencies '[[amazonica "0.3.23"]
[com.datomic/datomic-free "0.9.5344"]])
(require '[amazonica.aws.ec2 :as ec2]
'[amazonica.core :refer [defcredential]]
'[boot.cli :refer [defclifn]]
'[boot.util :refer [info]]