Skip to content

Instantly share code, notes, and snippets.

View ThatDevopsGuy's full-sized avatar

Sebastian Weigand ThatDevopsGuy

View GitHub Profile
@ThatDevopsGuy
ThatDevopsGuy / indexer.py
Created December 9, 2011 01:46
A very simple music indexer prototype for Unix-like operating systems, in Python.
#!/usr/bin/env python
# Sebastian Weigand 2011
from mutagen.easymp4 import EasyMP4
from subprocess import *
import sys, time
print 'Proof that Microsoft sucks ass at parsing media files:\n'
raw_input('Press enter when ready.')
@ThatDevopsGuy
ThatDevopsGuy / smj6a.py
Last active October 3, 2015 19:28
Simple Media Jukebox v6.0a
Visit https://github.com/sebastianweigand/multimedia
@ThatDevopsGuy
ThatDevopsGuy / flac2aac.py
Last active January 4, 2021 14:16
A Script to Convert FLAC Songs to MPEG4/AAC Using Apple's CoreAudio Encoder Which Preserves Song Information/Metadata
Visit https://github.com/sebastianweigand/multimedia
@ThatDevopsGuy
ThatDevopsGuy / EmbeddedTimer.py
Created February 21, 2013 17:31
EmbeddedTimer is a fun timer!
class EmbeddedTimer():
def __init__(self):
self.start = time()
def stop(self):
end = time()
diff = end - self.start
if 1 < diff:
@ThatDevopsGuy
ThatDevopsGuy / highlighter.py
Last active December 15, 2015 03:08
Quick-and-Easy Colorization Snippet
for i, highlightable_item in enumerate(highlightable_items):
hue = (360 / len(highlightable_items)) * i
yield '<span style="color: hsl(%s,50%%, 50%%);">%s</span>' % (hue, highlightable_item)
@ThatDevopsGuy
ThatDevopsGuy / wordr.py
Last active December 15, 2015 18:59
A 4-Pics-1-Word solver, which highlights adjectives for easier findings on harder puzzles.
#!/usr/bin/env python
# coding: utf-8
'''
===============================================================================
__ __ _
\ \ / /__ _ __ __| |_ __
\ \ /\ / / _ \| '__/ _` | '__|
\ V V / (_) | | | (_| | |
\_/\_/ \___/|_| \__,_|_|
@ThatDevopsGuy
ThatDevopsGuy / ssh-keyscan.py
Created October 14, 2013 03:07
A (very outdated) replacement for ssh-keyscan
#!/usr/bin/env python
# ssh-keyscan-aliases (version is in first parser line)
# Sebastian Weigand, February 2010 (and later modifications)
# Requires Python 2.5 - 2.x | x > 5, and a UNIX-like OS
# A smarter `ssh-keyscan`
from os import access, R_OK, putenv
from socket import getfqdn, gethostbyname, gethostbyname_ex, gaierror, herror
from subprocess import Popen, PIPE
from sys import stdin, stderr
@ThatDevopsGuy
ThatDevopsGuy / progress_bar.py
Created November 9, 2013 00:04
A simple progress bar, showing a spinner, and featuring deferred polling which can easily be replaced. To use this as-is, create a file called 'progress' next to the script, and `echo 0 > progress`. Then, echo your new progress into it, and watch the bar update.
#!/usr/bin/env python
from os import popen
from sys import stdout
from time import sleep
largest_max = 0
while True:
with open('progress') as f:
progress = int(f.read()) or 0