This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| """ | |
| $ rsync -avz -e ssh USER@'HOST:/var/vsftpd/trife/*201209{14,15,16,17,18}*gz' logs/ | |
| $ zcat portal*201209{14,15,16,17,18}*gz | waf-summary.py '2012/09/14 00:00' '2012/09/18 00:00' > portal-14-17_final.csv | |
| """ | |
| import re | |
| import sys | |
| from datetime import datetime, date, timedelta | |
| from dateutil import tz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # headers | |
| # URL,Ok Volume (MB),Error Volume (MB),Ok Hits,0xx,200,206,2xx,302,304,3xx,404,4xx,Offloaded Hits,Origin Hits,Origin OK Volume (MB) ,Origin Error Volume (MB) | |
| def parse_file(file): | |
| lines = [l.split(',') for l in open(file) if not l.startswith('#')] | |
| return lines | |
| def is_cached(line): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'rest_client' | |
| require 'json' | |
| require 'cgi' | |
| def bye | |
| abort("Usage: #{$0} [view_url]\nExample: #{$0} http://admin:secret@127.0.0.1:5984/db/_design/ddoc/_view/recent-posts") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /*************************************************************************************************** | |
| USAGE | |
| <?php | |
| include 'flickrapi.php'; | |
| $apiKey = 'XXXXXXXXXXXXXXXXXXXXXXXX'; | |
| $userId = 'XXXXXX@XXX'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| # | |
| # This file should be one directory above. | |
| # | |
| # Example: | |
| # | |
| # $ pwd | |
| # /Users/ernesto/Code/Menta/enlatele <-- This is the vagrant project |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # count duplicate entries in application log files | |
| TMPDIR="/tmp/duplicates/" | |
| APPDIR="/usr/local/sitios/" | |
| cd $APPDIR | |
| FILES=$(find ./ -path '*logs/2012*log' | sort -t '/' -k 5 | tail -n 1000); | |
| rm -r $TMPDIR | |
| mkdir $TMPDIR |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FINDPATH="/Users/ernesto/Desktop/te/logs/"; | |
| FINDSEARCH="www_171150.esclf_waf*"; | |
| DB="test" | |
| TABLE="te_logs_www"; | |
| TMPFILE="/tmp/uwslog_www.txt" | |
| LOGFILE="/tmp/parsed_www.log" | |
| for file in $(find $FINDPATH -name $FINDSEARCH ! -size 0); do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # depends on `brew install rename` | |
| cd ~/Pictures/pics | |
| find . | rename 's/\ /_/g' | |
| find . -iname '*.jpeg' | rename 's/jpeg$/jpg/g' | |
| find . -iname '*.jpg' -exec file -F '' --mime {} \; \ | |
| | grep -i 'image/gif' | awk '{print $1}' \ | |
| | while read file; do bn=`basename -s .jpg $file`; mv $bn.jpg $bn.gif; done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo ln -s /usr/lib/x86_64-linux-gnu/libfreetype.so /usr/lib/ | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/libz.so /usr/lib/ | |
| sudo ln -s /usr/lib/x86_64-linux-gnu/libjpeg.so /usr/lib/ | |
| sudo apt-get remove libjpeg-dev -y | |
| sudo rm -rf /usr/local/lib/python2.7/dist-packages/PIL | |
| sudo rm -rf /usr/local/lib/python2.7/dist-packages/PIL.pth | |
| sudo apt-get install libjpeg-dev -y | |
| sudo pip install PIL |