Skip to content

Instantly share code, notes, and snippets.

@tjb0607
tjb0607 / visualizer.py
Last active December 26, 2021 19:24
a 2D audio visualizer script for Blender 2.5+ (v0.3)
# To use this script, you must first change a few things.
# First, you'll want to change the filepath for the sound file.
# This is on line 76. Second, you might want to change the materials or the settings.
# To render this, you'll need to set the background color, enable Only Render on the display window, and render it with OpenGL (it's much faster and most optimal for 2D renders.)
# LICENSE = wtfpl
# VERSION = 0.3
import bpy
def makeMaterial(name, diffuse, alpha):
@tjb0607
tjb0607 / skygrid-tjb.py
Created May 6, 2012 09:29
Tjb0607's patch for SethBling's SkyGrid filter for MCEdit to fix reeds updating water/lava sources above.
# SkyGrid Filter by SethBling (Reed fix by tjb0607)
# Feel free to modify and reuse, but credit to SethBling would be nice.
from pymclevel import MCSchematic
from pymclevel import TileEntity
from pymclevel import TAG_Compound
from pymclevel import TAG_Short
from pymclevel import TAG_Byte
from pymclevel import TAG_String
@tjb0607
tjb0607 / MinecraftServerListMOTD.py
Created June 27, 2012 22:40
Minecraft server list MOTD and kick message thing
#!/bin/env python2
# -*- coding: utf-8 -*-
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.
import asyncore
#!/bin/env python2
import socket
import time
def get_info(host, port):
#Start the timer
start = time.time()
#Set up our socket
@tjb0607
tjb0607 / MyCroft Rules 20121118.txt
Created November 18, 2012 23:50
MyCroft Minecraft Server Rules 20121118
OFFICIAL MYCROFT MINECRAFT SERVER RULES
2012-11-18
SHORT VERSION:
1. You can prank like on Mindcrack.
2. Don't grief/steal.
3. Don't be a dick.
4. Don't go killing animals, or leaving half-trees or 1x1 towers everywhere.
5. Don't spam or be annoying.
6. Administrators can ban you, and the rules can change.
@tjb0607
tjb0607 / avgpps.sh
Last active December 19, 2015 23:09
Dependencies: bash (bash, grep, sed, echo, date), gawk, bc
#!/bin/bash
cd ~/.primecoin
touch ./primerate.txt
grep "prime/h" ./debug.log | sed "s/primemeter //" | sed "s/ prime\/h .*\/h//" >> ./primerate.txt
echo "" > ./debug.log
totalprimes=$(echo $(cat primerate.txt | sed "s/.*013.*:.* //" | awk '{if(min==""){min=max=$1}; if($1>max) {max=$1}; if($1<min) {min=$1}; total+=$1; count+=1} END {print int(total)}')/60|bc -l)
totaltimemined=$(echo $(date +%s)-$(date -u -d "$(head -n 1 .//primerate.txt|sed s/'\w*$'//)" +%s)+60|bc -l)
avgpps=$(echo "scale=2; $totalprimes/$totaltimemined"|bc -l)
echo $avgpps
#/bin/bash
echo "Converts an MP3 file and a JPG file into a YouTube-ready MP4 file."
echo "usage: jpegmp3mp4.sh <mp3> <jpg> [mp4 dir] [resize & convert to jpeg]"
if [[ -z "$3" ]] || [[ "$3" == "False" ]]; then
OUTFILE=$(echo "$1"|sed -e s/.mp3//|sed -e s/.ogg//|sed -e s/.flac//|sed -e s/.wav//)".mp4"
else
OUTFILE="$3/"$(basename "$(echo "$1"|sed -e s/.mp3//|sed -e s/.ogg//|sed -e s/.flac//|sed -e s/.wav//)")".mp4"
fi
if [[ "$4" == "False" ]] || [[ "$3" == "False" ]]; then
image=$2
###
# Copyright (c) 2002-2004, Jeremiah Fincher
# Copyright (c) 2008-2010, James McCoy
# Copyright (c) 2014, Valentin Lorentz
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice,
### Keybase proof
I hereby claim:
* I am tjb0607 on github.
* I am tjb0607 (https://keybase.io/tjb0607) on keybase.
* I have a public key whose fingerprint is 01EB 0F11 25FC D85E 6180 49F1 5AF3 3686 1207 E19A
To claim this, I am signing this object:
#!/usr/bin/python3
import subprocess
import urllib.request
import time
import re
while True:
print('checking')
response = urllib.request.urlopen('http://honestjons.com/shop/latest_100_arrivals')
plaintext = response.read().decode('utf-8')
if re.search('Loefah', plaintext, flags=re.I):