Skip to content

Instantly share code, notes, and snippets.

@pcolazurdo
pcolazurdo / sunspot-solr.monit
Last active August 4, 2017 05:57
Sample sunspot-solr.monit file
check process sunspot-solr
with pidfile "/var/www/ot/shared/pids/sunspot-solr.pid"
group sunspot-solr
start program = "/bin/su - deploy -c 'cd /var/www/ot/current && bundle exec sunspot-solr start --port=9072 --bind-address=localhost --data-directory=/var/www/ot/shared/sunspot/data --solr-home=/var/www/ot/shared/sunspot --pid-dir=/var/www/ot/shared/pids --log-level=WARNING --log-file=/var/www/ot/shared/log/sunspot.log'"
stop program = "/bin/su - deploy -c 'cd /var/www/ot/current && bundle exec sunspot-solr stop --port=9072 --bind-address=localhost --data-directory=/var/www/ot/shared/sunspot/data --solr-home=/var/www/ot/shared/sunspot --pid-dir=/var/www/ot/shared/pids --log-level=WARNING --log-file=/var/www/ot/shared/log/sunspot.log'"
@pcolazurdo
pcolazurdo / Execute logstash
Last active December 2, 2016 09:20
LogStash configuration Sample
java -cp . logstash.runner agent -f logstash.conf -- web --backend elasticsearch:///?local
@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

Keybase proof

I hereby claim:

  • I am pcolazurdo on github.
  • I am pcolazurdo (https://keybase.io/pcolazurdo) on keybase.
  • I have a public key whose fingerprint is B6A7 22E2 23BA A055 6C91 AE3E C50B A788 0AF5 7728

To claim this, I am signing this object:

@pcolazurdo
pcolazurdo / Docker+scipy
Last active January 8, 2017 00:50
Running a SCIPY docker box in Windows
To run docker on windows to run a new image, let's say mingfang/docker-ipython:
install boot2docker from docker site
Once installed you have to run a cmd as administrator and then:
: boot2docker start
: boot2docker ssh
Once there you can pull a repo, like: