Skip to content

Instantly share code, notes, and snippets.

View stefb69's full-sized avatar

Stéphane Benoit stefb69

View GitHub Profile
@pamolloy
pamolloy / README.md
Last active April 17, 2025 07:37
Mesh network using VXLAN over Wireguard
@dvinciguerra
dvinciguerra / mojo-jwt.pl
Created August 1, 2017 15:04
Mojolicious REST API example using JWT for authentication
use utf8;
use Mojolicious::Lite;
use Mojo::JWT;
use 5.20.0;
use experimental 'signatures';
my $payload = {id => 1, api_key => '1a2b3c4d5e6f7a8b9c'};
@stefb69
stefb69 / postfwd.cf
Last active August 19, 2016 13:34
GeoIP postfwd2 plugin
#Example usage
id=SASL_003
HIT_dnsbls >= 2
sasl_username =~ /^(.+)$/
client_country_code !~ /^(FR|IL|US|UK|CA|BE|CH|IT)$/
action = rcpt(sasl_username/3/86400/REJECT your is ip listed as trojaned, only 3 recipient per DAY for $$sasl_username)
@stefb69
stefb69 / LDAPAuth.pm
Last active February 28, 2017 15:57
Simple and per location customizable LDAP Authentication for nginx, using embedded perl and ngx_http_auth_request_module
#!/usr/bin/perl
package LDAPAuth;
use nginx;
use Authen::Simple::LDAP;
use MIME::Base64;
sub handler {
my $r = shift;
cpanm -l local https://github.com/<user_name>/<repo_name>/tarball/<branch_name>
e.g.
cpanm -l local https://github.com/issm/p5-Amon2-Plugin-Model/tarball/master
@eqhmcow
eqhmcow / apache-logtop-README
Last active July 29, 2019 14:54
Real-time top-like requests-per-second average for httpd request logs - similar to apachetop
DESCRIPTION
logstat.pl and logtop.pl
These scripts show current and average request-per-second counts based on
apache access logs in real-time.
You can see the total requests-per-second as well as a breakdown by:
* vhost
* URL
@sharifulin
sharifulin / gist:658382
Created November 1, 2010 15:41
Uploadify and Mojolicious app
#!/usr/bin/env perl
BEGIN { $ENV{MOJO_MAX_MESSAGE_SIZE} = 50 * 1024 * 1024; }
use Mojolicious::Lite;
my $conf = { path => 'data/uploads/', ext => qr/\.(?i:mp3|wav|wma|ogg)$/ };
post '/uploadify/check' => sub {
my $self = shift;
my $param = $self->req->params->to_hash;