Skip to content

Instantly share code, notes, and snippets.

View cosimo's full-sized avatar
🇳🇴

Cosimo Streppone cosimo

🇳🇴
View GitHub Profile
=pod
Get the game.png from http://i.imgur.com/FxgMM.png
Get link.png from http://imgur.com/P7JhS
=head1 INSTALL
For windows get strawberry perl
Then do:
.mouse, #preview{
position: absolute;
background-repeat: no-repeat;
height: 22px;
min-width: 15px;
z-index: 100;
}
.mouse{
background-image: url('../images/cursor.png');
@gimler
gimler / memcached
Created October 6, 2010 07:39 — forked from jonhiggs/memcached
#! /bin/bash
### BEGIN INIT INFO
# Provides: memcached
# Required-Start: $syslog
# Required-Stop: $syslog
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: memcached - Memory caching daemon
@cosimo
cosimo / gist:803454
Created January 31, 2011 00:07
Opera contacts to Mutt aliases converter
#!/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
#
@avar
avar / moose-vs-pure-perl.pl
Created March 7, 2011 10:59
Comparing the speed of Moose v.s. Moose immutable v.s. the pure-Perl equivalent for object construction and retrieval
#!/usr/bin/env perl
# The way you usually do it with Moose
package Moosy {
use Moose;
has number => (
is => 'ro',
isa => 'Int',
);
@cosimo
cosimo / gist:884307
Created March 24, 2011 00:05
Convert svn tags to git tags
#!/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
@cosimo
cosimo / purge-cache.sh
Created March 28, 2011 09:51
Script to purge varnish cache by URL, by regexp or all of it (for Debian)
#!/bin/sh
# purge-cache: Script to purge varnish cache. Defaults are defined in
# /etc/default/varnish.
#
# Cosimo <cosimo@cpan.org>
# Based on reload-vcl, by Stig Sandbeck Mathisen <ssm at debian dot org>
# Settings
defaults=/etc/default/varnish
Cpu(s): 10.0%us, 7.0%sy, 0.0%ni, 80.6%id, 0.0%wa, 0.0%hi, 2.4%si, 0.0%st
Mem: 1058730500k total, 22323100k used, 1036407400k free, 103608k buffers
Swap: 11558908k total, 0k used, 11558908k free, 2564672k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
132101 nobody 20 0 2239m 904m 748m S 2117 0.1 53:26.55 varnishd
132977 test 20 0 23952 1728 1260 R 100 0.0 0:56.71 httperf
132978 test 20 0 23952 1728 1260 R 100 0.0 0:54.73 httperf
132980 test 20 0 23952 1732 1260 R 100 0.0 0:43.50 httperf
132981 test 20 0 23952 1728 1260 R 100 0.0 0:34.78 httperf
@cosimo
cosimo / time-response.pl
Created July 23, 2011 14:39
Simple tool to detect TCP retransmit timeouts through HTTP requests
#!/usr/bin/env perl
#
# Fires HTTP request batches at the specified hostname
# and analyzes the response times.
#
# If you have suspicious frequency of 3.00x, 9.00x, 21.00x
# seconds, then most probably you have a problem of packet loss
# in your network.
#
# cosimo@opera.com, sometime in 2011
@cosimo
cosimo / check-debian-version.sh
Created November 23, 2011 16:59
Quickly tells the Debian version running on a given host. Requires ssh server enabled.
#!/bin/sh
#
# Tells the Debian version reading the OpenSSH banner
# Requires OpenSSH to be running and ssh port to be open.
#
# Usage: $0 <hostname>
#
# Cosimo, 23/11/2011
HOST=$1