Skip to content

Instantly share code, notes, and snippets.

View maxrp's full-sized avatar

Max P maxrp

View GitHub Profile
@maxrp
maxrp / CheckArch.java
Created October 9, 2012 19:11
The simplest possible way to determine the JVM architecture, AFAIK
class CheckArch {
public static void main(String[] args) {
String arch = System.getProperty("os.arch");
System.out.println("Architecture: " + arch);
}
}
@maxrp
maxrp / README.mkd
Created October 5, 2012 20:50
CSV to SQLlite tutorial
  1. Start up the sqlite3 commandline on a new datafile: sqlite3 myFooData.db

  2. You should see a prompt something like this:

SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> 
@maxrp
maxrp / caslogin.py
Created August 22, 2012 22:34
Example of automated log in to CAS (Central Authentication Service)
#!/usr/bin/env python
from bs4 import BeautifulSoup as soupy
import requests
def login_elements(tag):
"""A filter to find cas login form elements"""
return tag.has_key('name') and tag.has_key('value')
def login(username, password, url):