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 / bashpipe.go
Last active July 14, 2023 17:39
Execute Piped Shell Commands in Go
package main
import (
"bytes"
"io"
"log"
"os"
"os/exec"
)
@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 / extract.py
Created January 23, 2015 18:49
Parsing Maildir Mail Stored on Disk with Python
def unicode_it(data):
# Take a string of data and convert it to unicode
try:
return unicode(data, errors="replace").strip()
except TypeError as E:
return u""
def extract(msg, msg_obj, attachments):
if msg.is_multipart():
for part in msg.get_payload():
@tyndyll
tyndyll / get_gmail.py
Created February 10, 2015 15:18
Extract Mail from GMail and Import into Neo4J
#!/usr/local/env python
import argparse
import email
import extract
import getpass
import imaplib
import os
import sys
import uuid
@tyndyll
tyndyll / keybase.md
Last active April 18, 2018 20:25
keybase.md

Keybase proof

I hereby claim:

  • I am tyndyll on github.
  • I am tyndyll (https://keybase.io/tyndyll) on keybase.
  • I have a public key ASAD9vtg2PNFnl-C7IE2qUlHfWLJne1sz5m9YsRgiwes2go

To claim this, I am signing this object:

@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.