Skip to content

Instantly share code, notes, and snippets.

View n7st's full-sized avatar
🌶️
Working from home

Mike Jones n7st

🌶️
Working from home
View GitHub Profile
#!/usr/bin/env perl
use strict;
use warnings;
my @pre = qw(
Gloom
Gray
Dire
Black
@n7st
n7st / user_data.sh
Last active August 29, 2019 09:03
Virtual machine configuration for running CrystalM2 Server
export DEBIAN_FRONTEND=noninteractive
# Update all system packages
apt-get update && apt-get -y upgrade
# Install X Windows and a basic window manager
apt-get install -q -y \
debconf \ # Bundles dpkg-reconfigure
xorg openbox obmenu \ # Openbox and friends
xauth x11-apps x11-xserver-utils \ # Xorg and friends

Keybase proof

I hereby claim:

  • I am n7st on github.
  • I am netsplit (https://keybase.io/netsplit) on keybase.
  • I have a public key ASAg-OJ5O3BvsOJ7p9ng_9iw1zHR4VEnZm1_Yd4ruK_7mwo

To claim this, I am signing this object:

@n7st
n7st / greeter.pl
Last active January 9, 2019 20:04
WebService::Mattermost - example greeting bot for Mattermost (Perl)
#!/usr/bin/env perl
use strict;
use warnings;
use WebService::Mattermost::V4::Client;
my $bot = WebService::Mattermost::V4::Client->new({
username => 'MATTERMOST USERNAME HERE',
password => 'MATTERMOST PASSWORD HERE',
@n7st
n7st / SlowAPI
Last active April 20, 2018 14:05
Asynchronous Mojolicious web application which sleeps for n seconds (GET / ?delay=5 sleeps for 5 seconds)
#!/usr/bin/env perl
use Mojolicious::Lite;
use Mojo::IOLoop;
get '/' => sub {
my $c = shift;
my $seconds = $c->param('delay');
# Shadow
shadow = true; # Enabled client-side shadows on windows.
no-dock-shadow = false; # Avoid drawing shadows on dock/panel windows.
no-dnd-shadow = true; # Don't draw shadows on DND windows.
clear-shadow = true; # Zero the part of the shadow's mask behind the window (experimental).
shadow-radius = 12; # The blur radius for shadows. (default 12)
shadow-offset-x = -15; # The left offset for shadows. (default -15)
shadow-offset-y = -15; # The top offset for shadows. (default -15)
#shadow-red = 0.0; # Red color value of shadow. (0.0 - 1.0, defaults to 0)
#shadow-green = 0.0; # Green color value of shadow. (0.0 - 1.0, defaults to 0)
class AddressMatcher
require 'yaml'
def initialize(addresses)
@addresses = addresses
@postcodes = {}
@matches = []
end
def sanitize
@n7st
n7st / client.pl
Last active November 23, 2016 15:08
InfluxDB AnyEvent Server and Example Client
#!/usr/bin/env perl
use strict;
use warnings;
use AnyEvent;
use AnyEvent::Handle;
use AnyEvent::Impl::EV;
use AnyEvent::Socket qw/tcp_connect/;
use InfluxDB::LineProtocol qw/data2line/;
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
my $url;
Getopt::Long::GetOptions('u|url=s' => \$url);
@n7st
n7st / DateMath.pl
Last active September 22, 2016 18:45
DateMath.pl
#!/usr/bin/env perl
use strict;
use warnings;
use DateTime;
use Data::Printer;
my $start = DateTime->new(month => 02, year => 16);
my $end = DateTime->new(month => 10, year => 16);