Skip to content

Instantly share code, notes, and snippets.

@AlJohri
AlJohri / nu email regex
Created August 25, 2013 06:58
How do I split an NU email address into first name and last name?
use a case sensitive regular expression
find: (([A-Z]\w+)([A-Z]\w+)((\d+).)?201\d@u.northwestern.edu$)
replace: $2 $3 $5 $1
@AlJohri
AlJohri / scrape facebook group
Created August 25, 2013 07:08
Scrape closed facebook group
#!/usr/bin/env ruby
require 'mechanize'
require 'json'
@agent = Mechanize.new{|a| a.user_agent = 'Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)'}
@agent.get 'https://m.facebook.com/'
# 'Log In'
form = @agent.page.form_with(:method => 'POST')
➜ ~ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/mxcl/homebrew
HEAD: 7bc56cf5e44f98569841828b6e3b89abcf3b0e91
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit haswell
OS X: 10.8.5-x86_64
Xcode: 5.0
CLT: 5.0.0.0.1.1377666378
➜ ~ brew install -v tbb
==> Downloading https://www.threadingbuildingblocks.org/sites/default/files/software_releases/source/tbb42_20130725oss_src.tgz
Already downloaded: /Library/Caches/Homebrew/tbb-4.2.tgz
tar xf /Library/Caches/Homebrew/tbb-4.2.tgz
==> make tbb_build_prefix=BUILDPREFIX compiler=clang arch=intel64
make tbb_build_prefix=BUILDPREFIX compiler=clang arch=intel64
Created ./build/BUILDPREFIX_release and ..._debug directories
/usr/bin/make -C "./build/BUILDPREFIX_debug" -r -f ../../build/Makefile.tbb cfg=debug
../../build/Makefile.tbb:39: CONFIG: cfg=debug arch=intel64 compiler=clang os=macos runtime=cc4.2.1_os10.8.5
clang++ -o concurrent_hash_map.o -c -MMD -g -O0 -DTBB_USE_DEBUG -DUSE_PTHREAD -m64 -fPIC -D__TBB_BUILD=1 -Wall -Wno-non-virtual-dtor -I../../src -I../../src/rml/include -I../../include ../../src/tbb/concurrent_hash_map.cpp
<fields>
<field name="slug" type="string" indexed="true" stored="true" required="true" />
<field name="congress" type="string" indexed="true" stored="true" required="true" />
<field name="session" type="string" indexed="true" stored="true" required="true" />
<field name="bill" type="string" indexed="true" stored="true" required="false" multiValued="true" />
<field name="year" type="string" indexed="true" stored="true" required="true" />
<field name="month" type="string" indexed="true" stored="true" required="true" />
<field name="day" type="string" indexed="true" stored="true" required="true" />
Breaking and Fixing Origin-Based Access Control in Hybrid Web/Mobile Application Frameworks
--------------------------------------------------------------------------------------------
Github: https://github.com/georgiev-martin/NoFrak
"The following email was sent to Apache Cordova/PhoneGap on 12/13/2013, and again on 1/17/2014.
As there has been no response, we are re-posting it here to alert the general public
of the inherent vulnerabilities in Apache Cordova/PhoneGap.
...
"
{
"result": {
"root": {
"nodeId": 183,
"nodeType": 9,
"nodeName": "#document",
"localName": "",
"nodeValue": "",
"documentURL": "http://forecast.io/#/f/42.0586,-87.6845",
"baseURL": "http://forecast.io/",
<!DOCTYPE html>
<html manifest="cache.mobile.manifest">
<head>
<meta charset="utf-8">
<title>Forecast</title>
<meta name="description" content="Full-featured, global weather service, complete with 7-day forecasts that cover world, beautiful weather visualizations, and a time machine for exploring the weather in the past and far future.">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
from __future__ import division
from app.models import *
from app.models import db
from sqlalchemy import func
# for user in db.session.query(FacebookUser.username, func.count(FacebookUser.username)).group_by(FacebookUser.username):
# if user[1] == 1: continue
# dupes = FacebookUser.query.filter_by(username=user[0]).all()
# scores = []
# for dupe in dupes:
(alpaca)➜ clustertools git:(master) python check_ssh.py
tlab-01.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-02.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-03.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-04.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-05.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-06.eecs.northwestern.edu timed out
tlab-07.eecs.northwestern.edu okay /home/asj936/bin/python 2.7.6 /home/asj936/bin/pip 1.5.6
tlab-08.eecs.northwestern.edu timed