Skip to content

Instantly share code, notes, and snippets.

@mudler
mudler / prime.pl
Created Jun 6, 2014
prime numbers with vec in perl
View prime.pl
#!/usr/bin/perl
use strict;
use warnings;
use constant MAX => 100;
my $sieve = '';
vec($sieve, MAX, 1) = 0;
$sieve = ~$sieve;
@mudler
mudler / register_rpc
Created Aug 19, 2014
Symbol table inquiry for registering rpc calls
View register_rpc
sub register_rpc {
my $symbol = { eval( '%' . caller . "::" ) };
my @RPC_PUBLIC;
foreach my $entry ( keys %{$symbol} ) {
no strict 'refs';
if ( defined &{ caller . "::$entry" } ) {
push( @RPC_PUBLIC, $entry ) if $entry =~ /^\_/;
}
}
View gist:91ee7736faaaf1217dde
Searching Mojolicious::Plugin::JQuery on cpanmetadb ...
--> Working on Mojolicious::Plugin::JQuery
Fetching http://www.cpan.org/authors/id/F/FE/FERRO/Mojolicious-Plugin-JQuery-2.11001.tar.gz
-> OK
Unpacking Mojolicious-Plugin-JQuery-2.11001.tar.gz
Entering Mojolicious-Plugin-JQuery-2.11001
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.66)
Configuring Mojolicious-Plugin-JQuery-2.11001
Running Makefile.PL
@mudler
mudler / observium_agent_setup.sh
Last active May 28, 2018 — forked from d-a-n/observium_agent_setup.sh
Observium Agent Setup Guide
View observium_agent_setup.sh
# CONFIG
SNMP_COMMUNITY=public
SYSCONTACT=dan
SYSLOCATION=Berlin
ALLOW_IP=default
# get packages
apt-get install snmpd xinetd vim
mkdir -p /opt/observium && cd /opt
View keybase.md

Keybase proof

I hereby claim:

  • I am mudler on github.
  • I am mudler (https://keybase.io/mudler) on keybase.
  • I have a public key ASAZfSmMTm-xtaPVYRVaUup5ND5EALknum5lldJttO9qaQo

To claim this, I am signing this object:

@mudler
mudler / corecd.py
Created Sep 2, 2016
with fixed network
View corecd.py
#
# corecd.py
#
# Copyright (C) 2014 Fabio Erculiani
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
@mudler
mudler / audoload.pl
Last active Dec 15, 2016
Autoload and hash search
View audoload.pl
my $a = MyClass->new;
use Data::Dumper;
print "Test, searching for 'data': " . $a->test->big->data() . "\n";
print "Test, searching for 'inner': " . $a->big->data() . "\n";
print "Test, searching for 'innest': " . $a->innest() . "\n";
print Dumper( $a->innest );
package MyClass;
use Storable qw(dclone);
View generate-md.pl
#!/usr/bin/perl
# PODNAME: generate-md
use lib './lib';
use Mojo::Util qw(spurt);
use Pod::POM;
use Pod::POM::View::Pod;
use Pod::Markdown::Github;
use File::Find;
use constant SUBMODULE_DIR => "../docs/";