Skip to content

Instantly share code, notes, and snippets.

@maximevalette
maximevalette / call.pl
Created January 30, 2011 10:39
SIP Call in Perl
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long qw(:config posix_default bundling);
use Net::SIP;
#Usage
sub usage {
@maximevalette
maximevalette / gist:758937
Last active September 24, 2015 13:58
Slugify string
<?php
function urlcompliant($nompage) {
$a = array('À','Á','Â','Ã','Ä','Å','Æ','Ç','È','É','Ê','Ë','Ì','Í','Î','Ï','Ð','Ñ','Ò','Ó','Ô','Õ','Ö','Ø','Ù','Ú','Û','Ü','Ý','ß','à','á','â','ã','ä','å','æ','ç','è','é','ê','ë','ì','í','î','ï','ñ','ò','ó','ô','õ','ö','ø','ù','ú','û','ü','ý','ÿ','A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','Ð','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','','','J','j','K','k','L','l','L','l','L','l','','','L','l','N','n','N','n','N','n','','O','o','O','o','O','o','Œ','œ','R','r','R','r','R','r','S','s','S','s','S','s','Š','š','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','Ÿ','Z','z','Z','z','Ž','ž','','ƒ','O','o','U','u','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','','','','','','','€','@','Š','¡');
$b = array('A','A','A','A','A','A','AE','C','E','E','E','E','I','I','I','I','D','N','O','O','O','O','O','O','U','U','U
@maximevalette
maximevalette / gist:754421
Created December 24, 2010 17:49
Replace a string in multiple files at once
for i in `find . -name '*.txt'`; do vim -c "%s/toreplace/replaced/g | x" "$i"; done
@maximevalette
maximevalette / apache2.conf
Created December 12, 2010 12:06
My /etc/apache2/apache2.conf
### Section 1: Global Environment
ServerRoot "/etc/apache2"
LockFile /var/lock/apache2/accept.lock
PidFile /var/run/apache2.pid
Timeout 100
KeepAlive Off
MaxKeepAliveRequests 200
KeepAliveTimeout 4
ServerLimit 256