Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am scumola on github.
* I am stevewebb (https://keybase.io/stevewebb) on keybase.
* I have a public key whose fingerprint is 678F DC02 31E1 BA84 0D07 07A9 8B5B ABA9 F4A8 203D
To claim this, I am signing this object:
#!/usr/bin/php
<?php
$link = mysql_connect('10.0.0.13', 'xxxxx', 'xxxxx');
if (!$link) {
die('Could not connect to DB: ' . mysql_error());
}
echo 'Connected to DB successfully';
$db_selected = mysql_select_db('tweets', $link);
if (!$db_selected) {
@scumola
scumola / perk.php
Last active August 29, 2015 14:10
perk points grabber - replace ACCESS_TOKEN AND USERID with your info
#!/usr/bin/php
<?php
$access_token = 'ACCESS_TOKEN';
$url = "https://api.perk.com/api/usercurrencyinformation?user_id=USERID&access_token=$access_token&device_type=web_browser";
$ch = curl_init();
$timeout = 5;
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
@scumola
scumola / squid.conf
Created December 1, 2014 21:34
squid.conf
acl snmppublic snmp_community public
acl manager proto cache_object
acl localhost src 127.0.0.1/32
acl to_localhost dst 127.0.0.0/8 0.0.0.0/32
acl localnet src 10.0.0.0/24
acl SSL_ports port 443
acl Safe_ports port 80
acl Safe_ports port 21
acl Safe_ports port 443
acl Safe_ports port 70
Terms and Conditions
Perk is aimed at providing the best rewards program on Earth. As such, it's worth noting a few major items:
By installing any app or creating a Perk account or Logging In, you acknowledge and agree to Perk collecting information on the apps installed on a your device. This information may be used to ensure that Perk is able to promote relevant apps and offers.
Members are not permitted to attempt "gaming" or "hacking" the Perk program in any way.
Members will not, under any circumstances, encourage other members to hack or game the Perk program including via online blogs, forums, groups, etc.
Members are permitted to create one account per household. Multiple accounts via the same IP will require you to provide Government Identification in order to verify other members in the same household
Members will not post referral links in an attempt to trick members through deceptive means, inaccurate descriptions, fake earning opportunities or other questionable methods as determined by the Per
@scumola
scumola / flickr_ripper.pl
Created March 20, 2011 05:03
Pulls the Original image url, title and description from a flickr description page. Doesn't download the page, but will take the html from the page on stdin.
#!/usr/bin/perl
$re1='.*?'; # Non-greedy match on filler
$re2='(?:\\/[\\w\\.\\-]+)+'; # Uninteresting: unixpath
$re3='.*?'; # Non-greedy match on filler
$re4='((?:\\/[\\w\\.\\-]+)+_o.jpg)'; # Unix Path 1
$re=$re1.$re2.$re3.$re4;
while (<STDIN>) {
@scumola
scumola / archive_a_site.pl
Created April 4, 2011 14:48
wget lines for mirroring sites
#!/usr/bin/perl
#Simple Perl script to save me from having to memorise the parameters.
#Archives a whole website.
die("Usage: archive.pl \"URL(s)\" [wait]\n") unless ($ARGV[0]);
my $waitTime = 1;
$waitTime = $ARGV[1] if ($ARGV[1]);
system("wget --mirror --page-requisites --continue --convert-links --user-agent=\"\" -e robots=off --wait $waitTime $ARGV[0]");
@scumola
scumola / crawlme.php
Created April 4, 2011 16:31
php code that will emulate a fake site to test a web crawler with. Can increase the size of the fake site using the depth=x variable
<?php
$depth=$_GET['depth'];
$numurls=$_GET['numurls'];
$code =$_GET['code'];
if (!isset($numurls)) {
$numurls=100;
}
if (!isset($depth)) {
$depth=2;
@scumola
scumola / launchec2.php
Created January 30, 2012 19:40
aws php sdk launch instance
#!/usr/bin/php
<?php
if (empty($argv[1])) {
print ("usage: $argv[0] <arg1> <arg2> ...\n");
print (" Args: machine_name AMI availability_zone instance_size key_pair machine_type_tag deployment_tag security_group\n");
print (" EXAMPLE: test-99 ami-a9559ec0 us-east-1a m1.small private-key webserver temp webserver\n");
print (" EXAMPLE: test-99 ami-bba4fbfe us-west-1a m1.small private-key worker temp internal\n");
print ("\n");
print (" NOTE: WORKS IN EAST AND WEST ONLY!!\n");
exit();
@scumola
scumola / goodbye letter
Created February 28, 2012 21:56
goodbye letter
Yes, it's true. I'm moving on. Thanks for all of the kind words, everyone! I feel that working at Gnip has
been the best place that I've ever worked and I'm sad to leave. I made a bunch of good friends during my stay
here and I'd love it if people keep in touch.
As for my new gig, I'm sure that everyone has heard me talk about my love for the sea. I've been accepted into
this season's episode of Whale Wars on Animal Planet. I'll be living and working on the "Bob Barker" in the
Arctic Circle and fighting the Japanese whaling fleet for a full summer. My plane leaves on midnight on March
9th. I hope that you all tune-in and keep your fingers crossed for me and those poor whales out there!
http://animal.discovery.com/tv/whale-wars/