This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# defaults to 45 days if number of days is not given | |
# USAGE: datemath.py Aug 17 18:24:44 2014 GMT 45 | |
import time, datetime, sys | |
NOW = datetime.datetime.now().strftime("%s") | |
END = time.mktime(datetime.datetime.strptime(sys.argv[1], "%b %d %X %Y GMT").timetuple()) | |
if len(sys.argv) > 2: | |
WARN_DAYS = int(sys.argv[2]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* USAGE: passgen [-u UPPER] [-l LOWER] [-n NUMBER] -s [SPECIAL] -a LENGTH | |
* The approach is take the desired length, and set aside positions in the result | |
* string for the required characters, then fill in the other positions | |
* with random characters | |
*/ | |
#include <stdio.h> | |
#include <sys/time.h> | |
#include <stdlib.h> | |
#include <unistd.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# Set pidgin status to currently playing audacious track with configurable display. | |
import re, dbus, time, sys | |
CONFIGFILE="~/.config/pypiaud.conf" | |
current_message = '' | |
def get_player_interface(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import time, sys, re | |
OFFSET = sys.argv[1] # get the time offset in hours | |
OPERATION = OFFSET[0] # get the first character in OFFSET | |
if OPERATION != "+" and OPERATION != "-": # we only accept + and - as valid operations | |
print "usage: %s +3.5 (for UTC +3.5 hours)" % sys.argv[0] | |
sys.exit(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# the regexes may need some work as song names and stuff get weirder :) | |
if [ -z "`ps -ef | grep audacious | grep -v grep`" ]; then | |
return # dont do anything if audacious isnt running | |
fi | |
clear | |
METADATA=`qdbus org.mpris.audacious /Player org.freedesktop.MediaPlayer.GetMetadata` # use dbus to read track data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import sys | |
DEBUG = False | |
HEADER_ONLY = False | |
if len(sys.argv) >= 2: | |
FILENAME = sys.argv[1] | |
if len(sys.argv) >= 3: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* takes a temperature (like 28.5 F or -32C) as stdin and prints | |
* converted value | |
* USAGE: echo "-205.3 F" | ./ctof | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
int main(void) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
DEVICE="AUTO" # use the first detected drive. If this fails, hardcode a device, example 4,0,0 | |
if [ ! -e "$1" ]; then | |
echo "File does not exist." | |
exit 1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
maxRAM=0 | |
prevMax=0 | |
while [ 1 == 1 ]; do | |
initRAM=`free | grep "Mem:" | awk '{print$3}'` | |
freeRAM=`free | grep "Mem:" | awk '{print$3}'` | |
if [ $freeRAM -ge $initRAM ]; then | |
prevMAX=$freeRAM | |
if [ $freeRAM -ge $maxRAM ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.raidzero.xposed.bfquieter; | |
import de.robv.android.xposed.IXposedHookLoadPackage; | |
import de.robv.android.xposed.XC_MethodReplacement; | |
import de.robv.android.xposed.XposedBridge; | |
import de.robv.android.xposed.callbacks.XC_LoadPackage.LoadPackageParam; | |
import static de.robv.android.xposed.XposedHelpers.findAndHookMethod; | |
/** |