Skip to content

Instantly share code, notes, and snippets.

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 / 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
@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);
#!/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) {
### 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:
@scumola
scumola / puppet.log
Last active December 21, 2015 02:29
/var/log/messages after puppet 2.7.22 upgrade trying to get mysql module working properly
Aug 14 20:46:50 swebb-test27 puppet-agent[15561]: Caught TERM; calling stopAug 14 20:46:51 swebb-test27 puppet-agent[15829]: Reopening log files
Aug 14 20:46:51 swebb-test27 puppet-agent[15829]: Starting Puppet client version 2.7.22
Aug 14 20:46:57 swebb-test27 puppet-agent[15829]: (/Stage[main]/Mysql::Server/Package[mysql-server]/ensure) change from absent to present failed: Execution of '/usr/bin/yum -d 0 -e 0 -y install mysql-server' returned 1:
Aug 14 20:46:57 swebb-test27 Rpmdb checksum is invalid: pkg checksums: puppet-0:2.6.18-3.el6.noarch
Aug 14 20:46:58 swebb-test27 puppet-agent[15829]: (/Stage[main]/Mysql::Server/Service[mysqld]) Dependency Package[mysql-server] has failures: true
Aug 14 20:46:58 swebb-test27 puppet-agent[15829]: (/Stage[main]/Mysql::Server/Service[mysqld]) Skipping because of failed dependencies
Aug 14 20:47:02 swebb-test27 puppet-agent[15829]: (/Stage[main]/Mysql/Package[mysql_client]/ensure) created
Aug 14 20:47:02 swebb-test27 puppet-agent[15829]: (/Stage[main]/Mysql::Server::M
@scumola
scumola / dashboardactivity.java
Created June 5, 2013 20:06
ListView not updating
package com.badcheese.androidhive;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Random;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.json.JSONArray;
@scumola
scumola / col1.historgram
Last active December 15, 2015 06:29
histograms of the url shortener domain frequency found in the twitter spritzer stream. col1.histogram is the histogram for the first column of the twitter spritzer unwound urls, col2.histogram is the same for column 2 (the destination urls).
153857092 t.co
15257155 bit.ly
10429984 instagr.am
10097130 fb.me
6199242 tmblr.co
6163588 www.tumblr.com
3368499 youtu.be
2921467 dlvr.it
2635976 4sq.com
2421346 amzn.to
[root@images hbc]# mvn exec:java -pl hbc-example
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Hosebird Client Examples 1.2.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] >>> exec-maven-plugin:1.2.1:java (default-cli) @ hbc-example >>>
[INFO]
[INFO] <<< exec-maven-plugin:1.2.1:java (default-cli) @ hbc-example <<<
@scumola
scumola / ingress_codes.py
Created February 4, 2013 21:57
Script to poll the ingress codes page for new codes on OSX - original here: http://pastebin.com/SCbwdgRa
#!/opt/local/bin/python
checkevery=120 # google doesn't seem to get too upset about every 2 minutes...
import urllib,time,os
def clipboard(text):
command = 'echo ' + text.strip() + '| clip'
os.system(command)
latestpasscode = ""