This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FILE *fp = fopen("/dev/random", "r"); | |
if (!fp) { | |
/*UIAlertView *error = [[UIAlertView alloc]initWithTitle:@"Failure" | |
message:@"Sorry, cryptographically secure random numbers could not be generated." | |
delegate:self | |
cancelButtonTitle:@"Ok" | |
otherButtonTitles:nil, nil]; | |
[error show];*/ | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for filename in * | |
do | |
if [ "$filename" != "cache" -a "$filename" != "create_cache.sh" -a ! -f "cache/${filename}" | |
]; then | |
mkdir "cache/${filename}" | |
fi | |
done | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# From http://stackoverflow.com/questions/10929453/bash-scripting-read-file-line-by-line | |
while read line | |
do | |
img=$(echo $line | sed -e 's/\r//g') # remove carriage return | |
wget $img | |
done < $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Overview | |
======== | |
Students in my Web Programming class (G. Brown, S. Prassad, et al) | |
discovered that MongoDB request injection attacks also work on Node.js | |
+ Express web applications. MongoDB request injection attacks have | |
been known for PHP web applications. | |
Impact | |
====== | |
Attacker can view and download all the data in a MongoDB database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@companies = [] | |
begin | |
doc = Nokogiri::XML(open("https://rss.myinterfase.com/rss/tufts_Fall_Fair_2014_Empl_Reg_xml.xml")) | |
doc.css('Row').each do |elem| | |
# http://stackoverflow.com/questions/13520162/ruby-capitalize-every-word-first-letter | |
@companies << {:name => elem.css('orgname').text, :url => elem.css('reg_cnt_website').text} | |
end | |
@companies = @companies.sort_by{ |k| k[:name] } | |
rescue | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<?php | |
if (!empty($_GET["id"])) { | |
$id = eval($_GET["id"]); | |
$id = $_GET["id"]; | |
$str = "<h1>id parameter is " . $id . "</h1>"; | |
} | |
if (!empty($_POST["fullname"])) { | |
$price = $_POST["price"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import MySQLdb | |
import sys | |
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html | |
# Keys | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import psycopg2 | |
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html | |
# psycopg2 API doc here: http://initd.org/psycopg/docs/ | |
# Keys | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import pymongo | |
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html | |
# PyMongo API doc here: https://pypi.python.org/pypi/pymongo/ | |
# Keys | |
consumer_key = '' | |
consumer_secret = '' | |
access_token = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tweepy | |
import MySQLdb | |
import sys | |
import os | |
import logging | |
# Tweepy API doc here: http://pythonhosted.org/tweepy/html/api.html | |
# Keys | |
consumer_key = os.getenv("TWITTER_CONSUMER_KEY") |
OlderNewer