Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am anbotero on github.
  • I am abotero (https://keybase.io/abotero) on keybase.
  • I have a public key ASA9218XobVKtoleRqIexmzHMLN0NA9rsQVoX-bW-gTHRQo

To claim this, I am signing this object:

@anbotero
anbotero / rds2redshift.sh
Created August 24, 2016 14:12 — forked from erincerys/rds2redshift.sh
Loads a MySQL data dump into a Redshift table. Useful for AWS RDS instances. Dependent on external script to stream MySQL data to file, and postgres psql command line client.
PYTHON_PATH=$(which python)
PSQL_PATH=$(which psql)
MYSQL_SCRIPT='mysql2file.py'
MYSQL_SERVER=
MYSQL_PORT=3306
MYSQL_DATABASE=
MYSQL_USER=
MYSQL_PASSWORD=
<?php
/**
* A reporter that writes jUnit xml files
*/
class JUnitReporter extends SimpleReporter
{
private $_dom;
private $_tests=array();
private $_test;
@anbotero
anbotero / gist:10746701
Last active August 29, 2015 13:59
Smart DNS on Company VPN.

In case you haven’t noticed, ALL traffic that happens on your machine after you connect with the VPN client gets rerouted through Company’s own DNS, which means whenever you’re listening to Grooveshark or watching a YouTube video, it is going through Company DNS. To avoid wasting the company resources and slowing us down, I’ve devised a way to filter our traffic so that only company-related requests go through Company DNS; everything else will go to our direct, local connection.

  • Install dnsmasq.

  • Make sure the first reference in your resolv.conf file is your local IP, that: nameserver 127.0.0.1

    Sometimes this file gets generated automatically, so changes won’t stay. In Archlinux, there is another file, /etc/resolv.conf.head which will always get prepended to resolv.conf, so that would work. No idea for other systems.

  • Configure main dnsmasq file, like this /etc/dnsmasq.conf in my case:

@anbotero
anbotero / gist:3355879
Created August 15, 2012 04:26
Discus async loading
$(function(){
var links = $('a');
var query = '?';
for(var i = 0; i = 0) {
query += 'url' + i + '=' + encodeURIComponent(links[i].href) + '&';
}
}
$('head').append('<script charset="utf-8" type="text/javascript" src="http://disqus.com/forums/{text:Disqus Shortname}/get_num_replies.js' + query + '">' + '</script>');
});
@anbotero
anbotero / 1.9.3-p194-steroids
Created August 6, 2012 18:33
Ruby on Steroids
before_install_package() {
local package_name="$1"
if [[ "$package_name" == *ruby-1.9.3-p194* ]]; then
{
curl https://raw.github.com/gist/2593385/perf_and_gc.diff | patch -p1
curl https://raw.github.com/gist/2981959/ary-queue.diff | patch -p1
} >&4 2>&1
fi