Skip to content

Instantly share code, notes, and snippets.

View dex4er's full-sized avatar

Piotr Roszatycki dex4er

  • Berlin, Germany
View GitHub Profile
@dex4er
dex4er / geo-coder-google-form.html
Last active December 17, 2015 06:28
Geolocalization via Google (web form example)
#!/usr/bin/perl
use Mojolicious::Lite;
get '/' => 'main';
app->start;
__DATA__
@@ main.html.ep
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
@dex4er
dex4er / calculator-json2soap-proxy.psgi
Created May 24, 2013 15:31
JSON to SOAP proxy server
#!/usr/bin/env perl
use strict;
use warnings;
use Log::Report 'json2xml', syntax => 'SHORT';
use XML::LibXML;
use XML::Compile::WSDL11;
@dex4er
dex4er / server-pre-fork.pl
Created June 9, 2013 17:49
Perl server fork vs threads
#!/usr/bin/perl
use strict;
use IO::Socket;
sub process_connection {
my ($sock, $addr) = @_;
while (my $line = <$sock>) {
$line =~ s/\015?\012$//;
@dex4er
dex4er / exifilter.pl
Last active December 27, 2015 06:09
exifilter - Pass-through filter which scans mail for viruses
#!/usr/bin/perl
## exifilter
##
## (c) 2003-2004 Piotr Roszatycki <dexter@debian.org>, GPL
##
## $Id: exifilter.pl 161 2004-09-01 11:04:11Z dexter $
=head1 NAME
@dex4er
dex4er / glibc-2.17-elf-rtld-argv0.patch
Last active December 27, 2015 11:39
argv0 option for glibc dynamic linker
--- eglibc-2.17.orig/elf/rtld.c 2012-10-10 17:35:46.000000000 +0200
+++ eglibc-2.17/elf/rtld.c 2013-11-05 17:08:42.066912334 +0100
@@ -932,6 +932,7 @@
if (*user_entry == (ElfW(Addr)) ENTRY_POINT)
{
+ char *forced_argv0 = NULL;
/* Ho ho. We are not the program interpreter! We are the program
itself! This means someone ran ld.so as a command. Well, that
might be convenient to do sometimes. We support it by
@dex4er
dex4er / perl-Configure-android.sh
Last active January 2, 2016 18:19
Perl on Android
bash Configure -Uafs -Ud_csh -Duseshrplib -Dusethreads -Ui_db -Ui_gdbm -Ui_ndbm -Ui_dbm -Ui_sdbm -Duseopcode -Dman1dir=none -Dman3dir=none -Dsiteman1=none -Dsiteman3=none -Dvendorman1=none -Dvendorman3=none -des -Uinstallusrbinperl -Ud_getservent_r -Ud_getpwnam_r -Ud_getpwuid_r -Ud_getpwent -Dlibs='-ldl -lm -lc' -Dlibc=/system/lib/libc.so -Dlibpth='/system/lib /data/data/com.pdaxrom.cctools/root/cctools/lib' -Dusrinc=/data/data/com.pdaxrom.cctools/root/cctools/arm-linux-androideabi/include -Dprefix=/data/perl -Dperladmin=dexter@cpan.org
---
Author: ''
CONFIG: 'true'
Date: $Date
Header: ''
Id: $Id
Locker: ''
Log: $Log
PATCHLEVEL: '20'
PERL_API_REVISION: '5'
#!/usr/bin/env perl
#
# You want to install cpanminus? Run the following command and it will
# install itself for you. You might want to run it as a root with sudo
# if you want to install to places like /usr/local/bin.
#
# % curl -L http://cpanmin.us | perl - App::cpanminus
#
# If you don't have curl but wget, replace `curl -L` with `wget -O -`.
#
@dex4er
dex4er / fs.js
Created January 20, 2014 21:10
emscripten pre-js
var Module = {};
Module.preRun = function() {
FS.mkdir('root');
FS.mount(NODEFS, { root: '/' }, 'root');
FS.chdir('root/' + process.cwd());
}
@dex4er
dex4er / Configure.sh
Last active January 4, 2016 00:39
perl with clang
Configure \
-de \
-Dusedevel \
-Dcc=clang \
-Dld=clang \
-Doptimize=-O3 \
-Dusedevel \
-Ud_malloc_good_size \
-Ud_malloc_size \
-Ud_setrgid \