Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
pcolazurdo / netlog4.js
Created July 5, 2015 11:46
PhantomJS script for detecting Content-Encoding of JS resources (for httpd diagnosis)
var page = require('webpage').create(),
system = require('system'),
address;
if (system.args.length === 1) {
console.log('Usage: netlog4.js <some URL>');
phantom.exit(1);
} else {
address = system.args[1];
@pcolazurdo
pcolazurdo / FillOutForm.js
Last active December 11, 2015 07:38
The following Javascript piece allows to write to browser console a sample CURL instruction for filling out a specific form -- thanks to fcingolani
console.log('curl -vv --data "' + $('input').map(function (){ return this.name + '=' + this.value }).toArray().join('&') + '" ' + document.location.href)
@pcolazurdo
pcolazurdo / InstallGraphite
Last active December 11, 2015 10:48
Installing & Configuring Distributed LogStash + Kibana + Redis + Graphite + Statsd on a RedHat Fedora 18
### Based on: https://gist.github.com/1191574
### Based on: http://graphite.wikidot.com/installation
### for Django 1.4 review: https://bugs.launchpad.net/graphite/+bug/963684
### Statsd: http://geek.michaelgrace.org/2011/09/installing-statsd-on-ubuntu-server-10-04/
####################################
# BASIC REQUIREMENTS
# http://graphite.wikidot.com/installation
# http://geek.michaelgrace.org/2011/09/how-to-install-graphite-on-ubuntu/
# Last tested & updated 10/13/2011
@pcolazurdo
pcolazurdo / countflowplayer.sh
Created March 1, 2013 17:29
Check Flowplayer calls in telefe.com
zcat *20130228.gz |grep "GET /wp-content/plugins/fc-velocix-video/flowplayer/flowplayer.commercial-3.2.7-6.swf" | grep -v '"http://www.telefe.com/"' | wc -l
zcat blogs.telefe.com.access.log-20130226.gz | cut -d" " -f5,11 | grep 500 |cut -d: -f 2 | uniq -c
@pcolazurdo
pcolazurdo / favorites.sh
Created March 22, 2013 18:23
Send the favorites twitter using T by sferik by email
NOW=`date +(%Y-%M-%d)` ; t favorites > /tmp/favorites.twit; cat /tmp/favorites.twit | mail -s "Favorites Twitter @ $NOW" $MAIL
@pcolazurdo
pcolazurdo / RPMShortcuts
Created May 10, 2013 12:20
Some useful RPM/yum shortcuts
#Installed packages sorted by date
rpm -qa --qf '%{INSTALLTIME} (%{INSTALLTIME:date}): %{NAME}-%{VERSION}-%{RELEASE}.%{ARCH}\n' | sort -n >/tmp/installed.rpm
#List the content of a package
repoquery --list *package*
#Which Repository a Package was installed from
repoquery -i package
#What package a file belongs to
@pcolazurdo
pcolazurdo / codecommit-cleanup.sh
Last active April 6, 2016 16:10
Codecommit trick on Macosx
git config --global credential.helper '!security delete-internet-password -l "git-codecommit.us-east-1.amazonaws.com"; aws --profile default codecommit credential-helper $@'
@pcolazurdo
pcolazurdo / jenkins.sh
Created April 27, 2016 17:20
Runing Jenkins with Docker - quick setup
#If you want the config to be kept between restarts you need to create a docker volume to save it.
docker create -v /var/jenkins_home --name jenkins_datastore jenkinsci/jenkins
docker run -d -p 80:8080 -p 50000:50000 --volumes-from jenkins_datastore jenkinsci/jenkins
@pcolazurdo
pcolazurdo / upgrade-awscli.sh
Created October 9, 2016 09:38
Upgrading AWSCLI in MacOSX
sudo pip install --upgrade awscli --ignore-installed six