Skip to content

Instantly share code, notes, and snippets.

@eldondev
eldondev / index.html
Created October 22, 2010 05:07
A super-simple example of using the jsonp callback functionality of twitter search to slap tweets in a div.
<html>
<head>
<script type="text/javascript">
function showTweets(tweets) {
var newhtml = "";
for(var a = 0; a < tweets.results.length; a++) {
tweet = tweets.results[a];
newhtml += "<img src='" + tweet.profile_image_url +"'>" + tweet.text + "<br>";
}
@eldondev
eldondev / check-dns.py
Last active December 19, 2015 05:09
A little script that uses dnspython to verify a dns migration. The first server must allow dns axfr.
import sys, difflib, pprint
import dns.resolver
my_resolver = dns.resolver.Resolver()
# 8.8.8.8 is Google's openDNS server
my_resolver.nameservers = [sys.argv[2]]
import dns.query
import dns.zone
differ = difflib.Differ()
for domain in sys.argv[3:]:
@eldondev
eldondev / gist:5980868
Created July 12, 2013 01:58
How to decrypt wpa2 packets and use tshark to display cookies. You need to replace wlan1 with whichever wireless adapter you want to use, the bssid, the channel, and the wpa password.
airmon-ng start wlan1
airodump-ng mon0 --bssid 00:16:B6:DA:XX:XX --channel 6
tshark -i mon0 -o wlan.enable_decryption:TRUE -o wlan.wep_key1:wpa-pwd:<the_wpa_password> -R "http.cookie" -T fields -e http.cookie
@eldondev
eldondev / tp-link.sh
Last active December 20, 2015 01:39
TP-LINK WR-703N extroot setup script, ripped savagely from https://forum.openwrt.org/viewtopic.php?id=42259
@eldondev
eldondev / main.cf
Last active December 20, 2015 21:59
smtpd_banner = $myhostname ESMTP $mail_name
biff = no
append_dot_mydomain = no
readme_directory = no
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtpd_use_tls=yes
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
myhostname = cryptomail
<html>
<head>
<style>
.classDate {
margin: 0;
margin-top: 5px;
font-weight: bold;
color: #B70000!important;
font: Verdana, Helvetica, Arial, sans-serif;
}
import math
number = 2000
accumulator = []
for a in range(2,number):
prime = True
for b in range(2,int(math.sqrt(a))):
if a % b == 0:
prime = False
if prime:
accumulator.append(a)
@eldondev
eldondev / server.py
Last active December 23, 2015 18:59
Tornado static file index.html
application = tornado.web.Application([
(r"/()$", tornado.web.StaticFileHandler, {'path':'static/index.html'}),
(r"/(.*)", tornado.web.StaticFileHandler, {'path':'static/'}),
])
@eldondev
eldondev / bf.py
Created October 16, 2013 14:16
morning pre-coffee kata
registers = {
'pointer' : 0,
'ip' : 0,
}
space = [0]*30000
program =[]
import sys
def inc_p():
registers['pointer'] += 1
{
"bool": {
"must": [
{
"range": {
"@timestamp": {
"from": "1384813641058",
"to": "1384816485502"
}
}