Skip to content

Instantly share code, notes, and snippets.

@spacetime
spacetime / tjkirch_mod_mod
Created April 11, 2013 13:03
tjkirch_mod Derivation with battery status (Hindi)
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[green]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY=" %{$fg[red]%}⚡"
ZSH_THEME_GIT_PROMPT_CLEAN=""
function prompt_char {
if [ $UID -eq 0 ]; then echo "%{$fg[red]%}#%{$reset_color%}"; else echo $; fi
}
PROMPT='%(?,,%{$fg[red]%}FAIL: $?%{$reset_color%}
@spacetime
spacetime / cyberroam.sh
Last active December 11, 2015 14:59
Simple loop to login every seven minutes. This one tested on Mac OSX. Revision 2 on Linux.
#!/bin/bash
while true
do
curl -d "mode=191&username=UUUU&password=PPPPPP" http://172.10.1.2:8090/httpclient.html -o /dev/null
sleep $[7*60];
done
<?xml version="1.0" encoding="utf-8" ?>
<!-- SQL XML created by WWW SQL Designer, http://code.google.com/p/wwwsqldesigner/ -->
<!-- Active URL: file:///home/spacetime/Downloads/wwwsqldesigner-2.6/index.html -->
<sql>
<datatypes db="sqlite">
<group label="Affinity">
<type label="Text" default="" length="1" sql="TEXT" quote="'" color="rgb(255,200,200)"/>
<type label="Numeric" default="0" length="0" sql="NUMERIC" quote="" color="rgb(238,238,170)"/>
<type label="Integer" default="0" length="0" sql="INTEGER" quote="" color="rgb(238,238,170)"/>
<type label="Real" default="0" length="0" sql="REAL" quote="" color="rgb(238,238,170)"/>
@spacetime
spacetime / nexus4.py
Created November 14, 2012 21:38
Nexus 4 availability email script (using sendmail)
#!/usr/bin/python
from urllib import urlopen
import smtplib
import logging
import os
sender = 'youremail@here.com'
recipients = ['abc@gmail.com'
'abc@def.com',
'asd@asd.com',
@spacetime
spacetime / main.py
Created February 19, 2012 13:59
Simple AppEngine code to add two numbers
#Bare bones Example used to demonstrate processing by AppEngine for data sent through the Android app
from google.appengine.ext import webapp
from google.appengine.ext.webapp import util
class MainHandler(webapp.RequestHandler):
def post(self):
num1 = self.request.get('num1')
num2 = self.request.get('num2')
num3= int(num1)*int(num2)