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
my $requests = 0; | |
my %status; | |
my %type; | |
my %method; | |
my %kind; | |
while (<>) { | |
next if (/request: /); | |
next if (/\[(info|warn)\]/); |
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/perl -w | |
# | |
sub dec2ip ($) { | |
join '.', unpack 'C4', pack 'N', shift; # copied from the hive mind | |
} | |
open (LOCS, '<GeoLiteCity-Location.csv'); | |
my %es_locs; |
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/perl | |
my $group = shift; | |
my @users = (); | |
my $gam_call = "python gam.py"; | |
die "please specify a group" unless $group; | |
while (<>) { |
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
require 'json' | |
require 'rest-client' | |
participacion_url = 'http://resultados-elecciones.rtve.es/andalucia/multimedia/json/2015/participacion/andalucia/2015-participacion-andalucia.json' | |
partidos_url = 'http://resultados-elecciones.rtve.es/andalucia/multimedia/json/2015/resultados/andalucia/2015-resultados-andalucia.json' | |
partidos = JSON.parse(RestClient.get(partidos_url)) | |
participacion = JSON.parse(RestClient.get(participacion_url)) | |
%w(escrutado_porcentaje en_blanco_porcentaje abstencion_porcentaje nulos_porcentaje).each do |data| |
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
[3] pry(main)> on roles(["all"]) do | h | | |
[3] pry(main)* puts h | |
[3] pry(main)* end | |
=> [] | |
[4] pry(main)> on roles(["web"]) do | h | | |
[4] pry(main)* puts h | |
[4] pry(main)* end | |
192.168.10.185 | |
=> [#<Thread:0x007f718ce572c0@/home/carlos/.rbenv/versions/2.2.0/gemsets/capistrano/gems/sshkit-1.7.1/lib/sshkit/runners/parallel.rb:11 dead>] |
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
require 'gmail' | |
require 'rfc2047' | |
to_remove = [] | |
gmail = Gmail.connect(username,password) | |
rmine = gmail.inbox.find(:from => redmine_address) | |
puts "processing #{rmine.count} messages" |
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
url = ARGV.shift | |
redirect = true | |
while redirect do | |
redirect = false | |
status = "" | |
location = "<none>" | |
curl = `curl -s -I #{url}|dos2unix` |
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/perl -w | |
# | |
use strict; | |
use Net::DBus; | |
eval { | |
my $bus = Net::DBus->find; | |
my $hamster = $bus->get_service("org.gnome.Hamster"); | |
my $hamster_manager = $hamster->get_object("/org/gnome/Hamster","org.gnome.Hamster"); |
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
require 'fb_graph' | |
ids = File.new('data').readlines; | |
for id in ids do | |
tm = id.split(';') | |
user = tm[2] | |
begin | |
fbu = FbGraph::User.new(user) | |
fbu.fetch() |
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 'yaml' | |
require 'rubygems' | |
require 'fog' | |
require 'thor' | |
require 'colorize' | |
class Main < Thor |
OlderNewer