Skip to content

Instantly share code, notes, and snippets.

@tyndyll
tyndyll / cheerleader.go
Last active August 29, 2015 14:02
Simple script/binary that prints a message at a prescribed --interval either infinitely or for --count number of times.
// author: tyndyll
// Simple script/binary that prints a message at a prescribed --interval either infinitely or
// for --count number of times.
// It is being used a simple service target for setting up and testing systemd files. To that
// end it handles SIGINT
//
// To use:
//
// ~GOPATH go run src/cheerleader.go --interval 1 --count 1
// I am the cheerleader, I will save the world
@tyndyll
tyndyll / overcast_download.py
Created September 18, 2014 10:55
Get Source URL from Downcast Link
#!/usr/bin/env python
# Requirements: BeautifulSoup - http://www.crummy.com/software/BeautifulSoup/
# Example:
# overcast_downloader (~) python download.py https://overcast.fm/podcasts/episode/101217043409120
# http://traffic.libsyn.com/oneyoufeed/Mini_Episode_7.mp3#t=0
#
# overcast_downloader (~) python download.py https://overcast.fm/podcasts/episode/101217043409120 | xargs wget
# --2014-09-18 11:53:45-- http://traffic.libsyn.com/oneyoufeed/Mini_Episode_7.mp3
# Resolving traffic.libsyn.com... 204.16.245.39
# Connecting to traffic.libsyn.com|204.16.245.39|:80... connected.
@tyndyll
tyndyll / logpipe.go
Last active August 29, 2015 14:08
Printing Bytes Passing through a Pipe
package main
import (
"bufio"
"io"
)
type LoggedPipe struct {
Stdin *io.PipeReader
Stdout *PipeCloner
@tyndyll
tyndyll / spec_ops_eyes.py
Created September 25, 2015 14:34
Spec Ops Eyes
#!/usr/bin/env python
from SimpleCV import Camera, Display, Color
cam = Camera()
display = Display(resolution = (800, 600))
while display.isNotDone():
img = cam.getImage()
@tyndyll
tyndyll / translink_extract.py
Created September 25, 2015 14:41
Extracting Translink NI Timetable Data
@tyndyll
tyndyll / audio-splitter.sh
Created September 25, 2015 14:46
Given an audio file, break it into chunks
#!/bin/bash
# Copyright (c) 2013, Tyndyll
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
@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 / 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