Skip to content

Instantly share code, notes, and snippets.

View sente's full-sized avatar

Stuart Powers sente

View GitHub Profile
#!/bin/sh
dir=$1
find $dir -type f -name "*.zip" -printf "%TY-%Tm-%Td\t%h/%f\n" | sort | while read line; do
echo "unzip -jod $line"; done
@sente
sente / logger.js
Last active November 23, 2015 05:38 — forked from varemenos/logger.js
logger
var spacing = (function (size) {
var result = '';
for (var i = 0; i < size; i++) {
result += '&nbsp;';
}
return result;
})(4);
import requests
import os
try:
os.makedirs('final')
except:
pass
for i in range(20):
@sente
sente / bitekite.txt
Created May 6, 2015 06:11
bitekite
stu@redmac ~ $ curl -L --insecure -I https://bitekite.com/~bitekite/terms
HTTP/1.1 301 Bounce
Date: Wed, 06 May 2015 06:10:44 GMT
Server: Apache
Location: /~bitekite/~bitekite/terms
Vary: Accept-Encoding
Content-Type: text/html
HTTP/1.1 301 Bounce
Date: Wed, 06 May 2015 06:10:44 GMT
osascript -e 'quit app "Google Chrome"'
sqlite3 ~/Library/Application\ Support/Google/Chrome/Default/History "delete from urls where url like '%url_to_nuke%';"
# Sort+Unique IP Addresses
cat IP-List.txt|sort -n -u -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
# Grep IP Addresses in File
egrep '[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}' Filename.txt
# Dig A Record to CSV (Format: Hostname,IP Address)
for i in `cat Host-List.txt`;do dig +short ${i} a|awk '!/[a-z]/'|sed "s/^/${i},/g";done
# Remove Password from PDF
@sente
sente / sli.py
Created March 18, 2015 01:30
sli.py
import math
import nltk
import numpy as np
import pandas as pd
import scipy
from nltk.corpus import stopwords
from scipy import linalg
stopwords = stopwords.words('english')
@sente
sente / gist:32ad7813e6e1ed0b77cb
Created March 31, 2015 23:32
tell me which rows you dont care about? we'll just delete them from the original CSV
id
kickstarter_id
name
slug
blurb
creator
main_category
sub_category
launched_at
deadline
@sente
sente / README.md
Last active November 23, 2015 05:38 — forked from syntagmatic/README.md

A visualization of files in the src directory of the d3 repository, based on Reingold-Tilford Tree.

Data Collection

Use git to clone a repository, then du to create a tsv with the directory contents.

git clone git://github.com/mbostock/d3.git
(echo -n 'size\tfile\n'; du -a d3) > d3.tsv

Burrow - recursive nesting

@sente
sente / HTTPartyDebug.rb
Created October 17, 2014 19:29
HTTPartyDebug.rb
# HTTParty
require 'httparty'
class HTTPartyDebug
@@capture = StringIO.new
include HTTParty
debug_output @@capture
default_timeout 5
def method_missing(m)