Skip to content

Instantly share code, notes, and snippets.

@ragzilla
ragzilla / bf4stats.py
Last active December 27, 2015 01:19
quick battlefield 4 stats fetch script
#! /usr/bin/python
from urllib2 import Request, urlopen
from sys import exit, argv
from simplejson import loads
from pprint import pprint
if len(argv) != 2: exit(1)
h = { 'X-AjaxNavigation': '1', 'User-Agent': 'urllib/2.7 - user@email.com', }
@ragzilla
ragzilla / advertise.sh
Created February 20, 2013 18:04
Basic HA AnyCast DNS Resolver Configs
#! /bin/bash
IP=/sbin/ip
GREP=/bin/grep
DIG=/usr/bin/dig
LOOPSTATE=0
DIGSTATE=0
# figure out our current state
#! /home/maddison/.virtualenv/nfdump-notifier/bin/python
from ipwhois import IPWhois
from ipwhois.utils import unique_addresses
from pprint import pprint
from struct import unpack, pack
import socket
import select
import sys
import string
/run x = CalendarEventGetNumInvites(); for i=1,x do n,l,c,z,v = CalendarEventGetInvite(i); w,o,d,y,h,m = CalendarEventGetInviteResponseTime(i); print(n..','..l..','..c..','..v..','..o*44640+d*1440+h*60+m); end;
@ragzilla
ragzilla / dockingportalignment-applauncher.patch
Created July 24, 2014 01:26
DockingPortAlignmentIndicator Stock AppLauncher Patch
diff --git a/DockingPortAlignment.cs b/DockingPortAlignment.cs
index e9aaa0d..f4a35b6 100644
--- a/DockingPortAlignment.cs
+++ b/DockingPortAlignment.cs
@@ -120,7 +120,8 @@ public class DockingPortAlignment : MonoBehaviour
private static bool toolbarAvailable = false;
private static IButton toolbarButton;
- private static CustomButton customButton;
+ private static ApplicationLauncherButton stockButton;
@ragzilla
ragzilla / pamenable.patch
Created April 25, 2014 17:55
Enables PAM for enable passwords in tac_plus, allows fallthrough to DEFAULT user for all(?) attributes, importantly login/enable (obviating the need for the PAM default authentication patch), and fixes a minor bug in aceclnt_fn which broke password authentication
diff -rup tacacs+-F4.0.4.27a/aceclnt_fn.c tacacs+-F4.0.4.27a-pamenable/aceclnt_fn.c
--- tacacs+-F4.0.4.27a/aceclnt_fn.c 2012-06-28 18:37:06.000000000 -0400
+++ tacacs+-F4.0.4.27a-pamenable/aceclnt_fn.c 2014-04-25 13:30:03.272400618 -0400
@@ -193,6 +193,7 @@ aceclnt_fn(struct authen_data *data)
return(1);
}
+ data->flags = TAC_PLUS_AUTHEN_FLAG_NOECHO;
snprintf(buf, ACEBUFSZ, "Enter PASSCODE: ");
data->server_msg = tac_strdup(buf);