Skip to content

Instantly share code, notes, and snippets.

View adamcrosby's full-sized avatar
💭
alert();

Adam Crosby adamcrosby

💭
alert();
View GitHub Profile
body {
counter-reset: h1section;
}
section h1:before{
content: counter(h1section) ". ";
counter-increment: h1section;
}
section h1 {
counter-reset: h2section;
@adamcrosby
adamcrosby / imgz.js
Created April 27, 2011 20:56
reddit expand-inline js bookmarklet
javascript:%20var%20x=%20$(".content").find("a").each(function(){var%20href=$(this).attr("href");if((!$(this).hasClass("drowsapMorphed"))%20&&%20($(this).next(".drowsapMorphed").length==0)%20&&%20href%20&&%20(href.indexOf('imgur')>=0%20||%20href.indexOf('jpeg')>=0%20||%20href.indexOf('jpg')>=0%20%20||%20href.indexOf('png')>=0)){var%20ext%20=(href.indexOf('imgur')>=0%20&&%20href.indexOf('jpg')<0%20&&%20href.indexOf('png')<0)%20?%20'.jpg'%20:'';%20var%20img%20=%20$("<a%20class='drowsapMorphed'%20href='"+href+"'%20target='blank'%20style='display:block'><img%20style='display:block;max-width:780px;'%20src='"+href+%20ext+"'%20/></a>");$(this).after(img);}});
@adamcrosby
adamcrosby / rib-condense.py
Created November 30, 2011 00:32
RIB Condenser
#!/usr/bin/env python
#With RIB size of 452M this takes forever to run:
#real 5923m20.767s
#user 5889m16.408s
#sys 33m48.739s
## DO NOT USE
with open("rib.dat") as RIB:
routes = {}
for line in RIB:
entry = line.strip().split('\t')
@adamcrosby
adamcrosby / ipinnet.py
Created December 9, 2011 05:36
Testing if a given IP is in a given network
def ip2int(ip):
(f,s,t,l)=ip.split('.')
return (int(f)*16777216)+(int(s)*65536)+(int(t)*256)+int(l)
def ipInNet(ip, network, masklength):
mask = 0xFFFFFFFF << (32 - int(masklength))
if (ip2int(ip) & mask) == (ip2int(network) & mask):
return True
else:
return False
@adamcrosby
adamcrosby / tgs.xml
Created December 9, 2011 06:43
k5 tgs result
Log Name: Security
Source: Microsoft-Windows-Security-Auditing
Date: 12/9/2011 1:40:12 AM
Event ID: 4769
Task Category: Kerberos Service Ticket Operations
Level: Information
Keywords: Audit Success
User: N/A
Computer: WIN-4HVNH532NHD.k5test.local
Description:
@adamcrosby
adamcrosby / lulz.txt
Created December 10, 2011 06:56
lulz
1 US arin LVLT-1 - Level 3 Communications, Inc.
50 US arin ORNL-MSRNET - Oak Ridge National Laboratory
174 US arin COGENT Cogent/PSI
209 US arin ASN-QWEST - Qwest Communications Company, LLC
268 US arin USUHSNET-AS - Uniformed Services University of the Health Sciences
291 US arin ESNET-EAST - ESnet
292 US arin ESNET-WEST - ESnet
701 US arin UUNET - MCI Communications Services, Inc. d/b/a Verizon Business
800 CA arin CABLEATLANTIC - Rogers Cable Communications Inc.
1239 US arin SPRINTLINK - Sprint
@adamcrosby
adamcrosby / dnswat
Created August 28, 2012 02:43
dnswat
SourceIP Denied Query # of Denies
208.69.32.21 54.101.90.66.in-addr.arpa 17172
66.90.68.26 54.101.90.66.in-addr.arpa 15093
66.90.68.25 54.101.90.66.in-addr.arpa 12158
66.90.103.118 54.101.90.66.in-addr.arpa 9354
208.69.32.17 54.101.90.66.in-addr.arpa 6233
66.90.68.15 54.101.90.66.in-addr.arpa 5716
66.90.73.88 54.101.90.66.in-addr.arpa 2854
192.221.138.74 54.101.90.66.in-addr.arpa 1304
208.69.32.19 54.101.90.66.in-addr.arpa 1109
@adamcrosby
adamcrosby / S&P 500 Dividends
Created July 23, 2013 04:52
S&P 500 Dividends data file (based on a slightly outdated list of tickers)
Symbol, Name, Dividend/Share, Earning/Share, Dividend Yield
"MMM","3M Company Common",2.45,6.34,2.11
"ABT","Abbott Laboratori",0.6641,2.507,1.85
"ANF","Abercrombie & Fit",0.75,3.077,1.52
"ACE","Ace Limited Commo",2.47,7.825,2.61
"ADBE","Adobe Systems Inc",0.00,1.125,N/A
"AMD","Advanced Micro De",0.00,-1.137,N/A
"AES","The AES Corporati",0.12,-1.567,0.94
"AET","Aetna Inc. Common",0.775,4.841,1.20
"ACS","ACS",N/A,N/A,N/A
digraph nhhc {
overlap=prism;
node [image="instance.png", shape=none, fontsize=10.0];
"DISP-A" [label="DISP-A\n10.0.0.1"];
"DISP-A_2"[label="DISP-A_2\n10.0.0.2"];
"DISP-P"[label="DISP-P\n10.0.0.3"];
"DISP-P_2"[label="DISP-P_2\n10.0.0.4"];
"RDG_az1"[label="RDG_az1\n10.0.0.5"];
"RDG_az2"[label="RDG_az2\n10.0.0.6"];
"RWP_az1"[label="RWP_az1\n10.0.0.7"];
GroupPolicy("AssumeRole_CustomerAdmins", """{“Version”:”2012-10-17”, “Statement”:[{“Effect”o}]}"""
#or, even better:
GroupPolicy("AssumeRole_CustomerAdmins",
"""
{
"Version":"2012-10-17",
"Statement":[
{
"Effect":"Deny",