This file contains 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 | |
# pre-commit hook to syntax check puppet manifests and erb templates | |
# at checkin. | |
# Stig Sandbeck Mathisen <ssm@fnord.no> | |
# | |
# Modified to run with puppet < 2.7 as well, Cosimo 13/Dec/2011 | |
# | |
# Requirements: |
This file contains 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
perl6-lwp-simple $ ufo | |
No such method 'split' for invocant of type 'CompUnitRepo::Local::Installation' | |
in sub mkpath at /home/cosimo/.perl6/2014.05-118-ge88e462/bin/ufo:161 | |
in sub get_prefix at /home/cosimo/.perl6/2014.05-118-ge88e462/bin/ufo:148 | |
in sub MAIN at /home/cosimo/.perl6/2014.05-118-ge88e462/bin/ufo:69 | |
in block at /home/cosimo/.perl6/2014.05-118-ge88e462/bin/ufo:221 |
This file contains 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 | |
=head1 NAME | |
rtail - tail multiple files remotely | |
=head1 SYNOPSIS | |
./rtail --host h1 --host h2 --command 'tail -f /var/log/syslog' | |
./rtail --user someuser --host h1 --host h2 --command 'uname -a' |
This file contains 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
We're using graphite 0.9.12. | |
We have per-datacenter aggregates and total-across-datacenters | |
aggregates, constructed as follows (flush interval is 10s): | |
# Total | |
<project>.<env>.aggregates.total.recommender.api.suggestions.rate (10) = sum <project>.<env>.*.*.counters.recommender.api.suggestions.rate | |
# Per-datacenter | |
<project>.<env>.aggregates.dc.<datacenter>.recommender.api.suggestions.rate (10) = sum <project>.<env>.<datacenter>.*.counters.recommender.api.suggestions.rate |
This file contains 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
import math | |
class Shortener: | |
""" | |
Simple class to shorten URLs, or rather, numerical IDs. | |
Each URL must be saved to a database, with the data about source, | |
category, country, publisher, etc... The database will give back | |
a numerical ID. We're using that ID to convert it to a base 62 | |
number and using a symbol table, converting it to a sequence |
This file contains 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
cosimo@ubuntu:~/src/web$ export PERL6LIB=/home/cosimo/src/perl6-sqlite/lib:/home/cosimo/src/web/lib | |
cosimo@ubuntu:~/src/web$ perl6 t/squerl/01-sqlite-write.t | |
invoke() not implemented in class 'Undef' | |
in sub SQLite3::sqlite_open (/home/cosimo/src/perl6-sqlite/lib/SQLite3.pm:50) | |
called from method Squerl::Database::open (/home/cosimo/src/web/lib/Squerl.pm:334) | |
called from method Squerl::Database::create_table (/home/cosimo/src/web/lib/Squerl.pm:360) | |
called from Main (t/squerl/01-sqlite-write.t:12) |
This file contains 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 perl | |
# | |
# Convert Opera contacts file (.adr) into | |
# mutt aliases file format. | |
# | |
# Usage: | |
# perl opera-adr-to-mutt-aliases.pl < ~/.opera/contacts.adr >> ~/.mutt/aliases | |
# | |
# Cosimo, 31/Jan/2011 | |
# |
This file contains 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
/* Per Buer's code, "Re: Lots of configs" | |
* http://pastebin.com/a68y15hp | |
*/ | |
#include <stdio.h> | |
#include <string.h> | |
#include <pcre.h> | |
int main() { | |
const char *error; |
This file contains 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 | |
# | |
# Convert remote tags imported from SVN to real git tags | |
# | |
REMOTE_TAGS=$(git branch -r | grep 'tags/' | cut -f2 -d/) | |
GIT=$(which git) | |
for t in $REMOTE_TAGS | |
do |
This file contains 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
connect(3, {sa_family=AF_INET, sin_port=htons(11211), sin_addr=inet_addr("127.0.0.1")}, 16) = 0 | |
sendto(3, "get trololol\r\n", 14, 0, NULL, 0) = 14 | |
# ite(1, "# Sent 'get trololol\r# \n# '. Wai"..., 50# Sent 'get trololol | |
# '. Waiting a response...) = 50 | |
write(1, "\n", 1 | |
) = 1 | |
recvfrom(3, "END\r\n", 2048, 0, NULL, NULL) = 5 | |
recvfrom(3, <stuck-here> |
OlderNewer