Skip to content

Instantly share code, notes, and snippets.

@tyndyll
tyndyll / podcast_download.py
Last active October 14, 2015 08:49
Take a Podcast/MP3 RSS feed and download and all the media files contained therein
#!/usr/bin/env python
import hashlib
import logging
import optparse
import os
import sys
import urllib2
import xml.dom.minidom
@tyndyll
tyndyll / README.md
Last active November 4, 2021 05:54
Download Podcast from Overcast Permalinks

Download From Overcast

Overcast on iOS is my primary podcasting listening method, but I have an occasional need to download podcasts for archival or offline listening purposes. This script takes advantage of Overcast's permalink and showpage to get the podcast author and title before downloading the podcast itself from the original page.

Usage: python download_from_overcast.py 
@tyndyll
tyndyll / marathon-deploy.go
Created October 21, 2015 23:30
A handy shortcut for deploying apps to Marathon.
package main
import (
"bytes"
"encoding/json"
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
@tyndyll
tyndyll / run_customer_tests.py
Created July 26, 2016 13:22 — forked from mcbhenwood/run_customer_tests.py
Run Selenium tests against the django test server, from command line with no GUI
"""
Run Selenium headless tests against Django test server
------------------------------------------------------
Creates and destroys a test environment each time.
Requires Xvfb and IceWeasel to be installed. For Debian flavours:
sudo apt-get install xvfb iceweasel
@tyndyll
tyndyll / Makefile
Created June 23, 2017 23:06 — forked from prwhite/Makefile
Add a help target to a Makefile that will allow all targets to be self documenting
# Add the following 'help' target to your Makefile
# And add help text after each target name starting with '\#\#'
help: ## Show this help.
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//'
# Everything below is an example
target00: ## This message will show up when typing 'make help'
@echo does nothing
@tyndyll
tyndyll / Dockerfile
Last active June 28, 2017 21:11
HTTP Referer Handler for Files
FROM golang:latest
EXPOSE 8000
ENV HOST_REFERER ""
WORKDIR /go/src/app
COPY . .
RUN go-wrapper install # "go install -v ./..."
@tyndyll
tyndyll / output.txt
Created February 21, 2018 07:53
Getting Latest Kubernetes Deployment
➜ Desktop kubectl get deployments kubia -o yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
annotations:
deployment.kubernetes.io/revision: "3"
creationTimestamp: 2018-02-20T20:05:14Z
generation: 4
labels:
app: kubia-go
@tyndyll
tyndyll / strip-url-trackers.py
Last active May 16, 2021 06:59
Strip UTM parameters from a URL
#!/usr/bin/env python
#
# Copyright 2018 Tyndyll
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#/bin/bash
#
# https://twitter.com/samykamkar/status/1011166802880020482
# Sniff network traffic from your iOS device, no jailbreak necessary! Just plug into your mac and run:
system_profiler SPUSBDataType|perl -0 -ne'/iP(?:hone|ad):.*?Serial Number: (\S+)/s?`rvictl -s $1`:0' ; sudo tcpdump -i rvi0 # standard tcpdump options/filters apply
@tyndyll
tyndyll / README.md
Last active February 26, 2019 12:44
Introduction to Go - Hello World Server

Hello World

This gist is the code portion of a talk given at the Crystal Ball Bash.

The talk was a very high level introduction to go, and the code here is a commented example of the syntax and features that Go has to offer. It is a Hello World example, but with the twist of being a HTTP server, that uses concurrency to print out to the terminal. It looks long, but it amounts to about 50 lines of actual code once you remove the comments

Running

It is assumed that you have previously downloaded and installed Go, and configured it appropriately

Clone this gist or simply download the hello_world.go file. We are not importing any external packages so it doesn't necessarily have to exist inside the GOPATH.