Skip to content

Instantly share code, notes, and snippets.

View affix's full-sized avatar
:shipit:
Code never lies, Comments might though

Keiran Smith affix

:shipit:
Code never lies, Comments might though
View GitHub Profile
@affix
affix / autoblock-twitter.py
Created November 25, 2012 14:56
Auto Block Twitter mentions who you do not follow
#!/usr/bin/env python
# autoblock-twitter.py
# Automatically block twitter users who mention you in a tweet that you do not follow.
# I wrote this as my user is @cli and I was constantly getting unrelated spam mentions
# License : GPLv2+
# Author : Keiran "Affix" Smith <Affix_AT_affix_DOT_me>
import tweepy
consumer_key=""
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}
@affix
affix / dumpit.py
Last active December 30, 2015 23:59
dumpit.py a python alternative to mysqldump. I wrote this after an innodb corruption and mysqdump kept crashing for me. This seemed to export all the data correctly although a little slower. It seems to be more fault tollerant.
#!/usr/bin/env python
#
# dumpit.py
# An Alternative to mysqldump written in Python
# Requires MySQLdb Python Module.
#
# Author : Keiran 'Affix' Smith
# Email : affix@affix.me
# Web : http://affix.me
# Copyright 2013 Keiran Smith
public function DistAB($lata, $lona, $latb, $lonb)
{
$delta_lat = $latb - $lata ;
$delta_lon = $lonb - $lona ;
$earth_radius = 6372.795477598;
$alpha = $delta_lat/2;
$beta = $delta_lon/2;
$a = sin(deg2rad($alpha)) * sin(deg2rad($alpha)) + cos(deg2rad($lata)) * cos(deg2rad($latb)) * sin(deg2rad($beta)) * sin(deg2rad($beta)) ;
@affix
affix / OpenShift Origin Puppet Deploy
Created March 14, 2014 17:00
Deploy a Broker/Node with Puppet
class { 'openshift_origin' :
roles => ['broker','named','activemq','datastore','node'],
broker_hostname => 'broker.',
node_hostname => 'broker.',
named_hostname => 'broker.',
datastore_hostname => 'broker.',
activemq_hostname => 'broker.',
bind_key => 'YOUR_KEY',
# Call Of Duty API Login
# Written by Keiran Smith <affix_at_affix_dot_me>
# (c) 2014 Keiran Smith
# This is not licensed via Activision or any other
# official call of duty publishers
# If I reveive a DMCA I will remove.
# Licenced under GNU/GPLv3
require 'uri'
require 'net/http'
@affix
affix / blocksync.py
Last active August 29, 2015 14:14 — forked from rcoup/blocksync.py
#!/usr/bin/env python
"""
Synchronise block devices over the network
Copyright 2006-2008 Justin Azoff <justin@bouncybouncy.net>
Copyright 2011 Robert Coup <robert@coup.net.nz>
License: GPL
Getting started:
@affix
affix / ripm38u
Created March 25, 2015 03:50
M3U8 Ripper
#!/bin/bash
# ripm3u8 - Rip TS Playlists to MP4
# Written by Affix - http://affix.me
# GNU/GPLv2+
echo "M3U8 Ripper - Rip M3U8 Playlist of ts Files to MP4"
echo "Written by Affix"
if [ -z $2]
then
echo "Usage : ripm3u8 <url> <file name>"

Keybase proof

I hereby claim:

  • I am Affix on github.
  • I am affix (https://keybase.io/affix) on keybase.
  • I have a public key whose fingerprint is B143 C0B3 D2C8 158D 0DFF 7CB0 3DF1 24CD EDE8 E0CA

To claim this, I am signing this object: