Skip to content

Instantly share code, notes, and snippets.

View tierra's full-sized avatar

Bryan Petty tierra

View GitHub Profile
[43881.471021] usb 3-3: new SuperSpeed USB device number 3 using xhci_hcd
[43881.488529] usb 3-3: New USB device found, idVendor=152d, idProduct=0551
[43881.488538] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=5
[43881.488544] usb 3-3: Product: USB to ATA/ATAPI Bridge
[43881.488548] usb 3-3: Manufacturer: JMicron
[43881.488551] usb 3-3: SerialNumber: 6290003FFFFF
[43886.485186] usb 3-3: Set SEL for device-initiated U1 failed.
[43891.483389] usb 3-3: Set SEL for device-initiated U2 failed.
[43891.483515] usb-storage 3-3:1.0: USB Mass Storage device detected
[43891.483688] scsi5 : usb-storage 3-3:1.0
@tierra
tierra / drop-tables.sql
Created September 8, 2014 16:27
Drop Tables SQL
SET FOREIGN_KEY_CHECKS = 0;
SET @tables = NULL;
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables
FROM information_schema.tables
WHERE table_schema = 'database_name'; -- specify DB name here.
SET @tables = CONCAT('DROP TABLE ', @tables);
PREPARE stmt FROM @tables;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
SET FOREIGN_KEY_CHECKS = 1;
@tierra
tierra / glibchash.c
Created September 30, 2014 22:02
tierra's C++ vs dataw0lf's Python speedhash challenge!
// Kill me if I ever have to use glibc ever again, almost as bad as Perl.
#define _GNU_SOURCE
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
@tierra
tierra / remove_duplicates.py
Created September 30, 2014 22:11
Recursively remove duplicate files
#!/usr/bin/env python
import os
from optparse import OptionParser
def remove_duplicates(working_path, compare_path, pretend = False,
compare_size = False, recurse = False):
'''Compares contents of two paths, removing
identical content in the working path.'''
@tierra
tierra / phpfpm_average
Last active August 29, 2015 14:07
Munin plugins for PHP-FPM
#!/bin/sh
#%# family=manual
#%# capabilities=autoconf
if [ "$1" = "autoconf" ]; then
echo yes
exit 0
fi
if [ "$1" = "config" ]; then
@tierra
tierra / Vagrantfile
Last active August 29, 2015 14:14
wxWidgets Documentation Vagrant Box
# -*- mode: ruby -*-
# vi: set ft=ruby :
$sudo_script = <<SUDOSCRIPT
apt-get update
apt-get -y install doxygen graphviz
apt-get -y --no-install-recommends install texlive-latex-extra texlive-fonts-recommended
SUDOSCRIPT
Vagrant.configure("2") do |config|
@tierra
tierra / gist:3061041
Created July 6, 2012 15:57 — forked from markjaquith/gist:2628225
Script to sync wxWidgets SVN to GitHub
#!/bin/bash
# Intial git svn clone:
# git svn clone --prefix=svn/ -A ~/.svn2git/authors -s https://svn.wxwidgets.org/svn/wx/wxWidgets wxWidgets
cd ~/svn-git-mirrors/wxWidgets;
if [ -f .sync-running-wxWidgets ]; then exit 1; fi;
touch .sync-running-wxWidgets
@tierra
tierra / gist:3214247
Created July 31, 2012 06:30
wxPython GitHub Mirror Stats
$ time git clone https://github.com/wxWidgets/wxPython.git
Cloning into 'wxPython'...
remote: Counting objects: 614154, done.
remote: Compressing objects: 100% (96371/96371), done.
remote: Total 614154 (delta 512959), reused 613563 (delta 512368)
Receiving objects: 100% (614154/614154), 199.46 MiB | 1.94 MiB/s, done.
Resolving deltas: 100% (512959/512959), done.
real 3m32.011s
user 0m44.066s
@tierra
tierra / gist:3380971
Created August 17, 2012 17:48
WordPress tickets still "Awaiting Review" based on total number of opened tickets per month.
Report Run on Aug 17th, 2012
----------------------------
Aug, 2011: 242 tickets, 67 awaiting review (28%)
Sep, 2011: 261 tickets, 74 awaiting review (28%)
Oct, 2011: 260 tickets, 53 awaiting review (20%)
Nov, 2011: 299 tickets, 60 awaiting review (20%)
Dec, 2011: 296 tickets, 74 awaiting review (25%)
Jan, 2012: 230 tickets, 72 awaiting review (31%)
Feb, 2012: 196 tickets, 58 awaiting review (30%)
@tierra
tierra / retag-wx.sh
Created October 23, 2015 00:58
Script used to create v* tags for wxWidgets.
#!/bin/bash
for t in $(git tag -l | grep -v '@' | egrep '^(WX_[23]_[0-9]_[0-9])'); do
export GIT_COMMITTER_DATE=$(git log -1 --format=%ad $(echo $t))
VTAG=$(echo $t | sed -e 's/WX_2_4_0_CANDIDATE/WX_2_4_0-rc1/;s/2rc/2-rc/;s/_rc/-rc/;s/^WX_/v/;s/_/\./g;')
echo "Tagging $t as $VTAG with $GIT_COMMITTER_DATE"
git tag -m "Release $VTAG." $VTAG $t;
done