Skip to content

Instantly share code, notes, and snippets.

View mattdees's full-sized avatar

matt dees mattdees

View GitHub Profile
#!/usr/bin/env python3
import subprocess
# https://www.thingiverse.com/thing:3867358
SCAD_SCRIPT = "LEGOTextBrick-v2p0.scad"
SCAD_BINARY = "openscad"
bricks = [
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
sub _load_targets {
my @targets;
Smokeping::load_cfg($config_file, 1);
# get each server's info.
foreach my $group ( keys %{ $Smokeping::cfg->{'Targets'} } ) {
unless ( ref $Smokeping::cfg->{'Targets'}->{$group} ) {
# Unless the entry in the smokeping hash is a reference to another datastructure
next;
}
#!/usr/bin/env perl
use strict;
use warnings;
use Smokeping;
#
# CONFIG VARS, CHANGE THESE TO YOUR SETUP.
#
my $config_file = '/etc/smokeping/config';
@mattdees
mattdees / gist:5500102
Created May 2, 2013 04:11
Gitlab init script for 5.1.0
#!/bin/bash
#
# GitLab
# Maintainer: @elvanja, @troyanov, @eiyaya, @foyo23
# App Version: 5.1.0
# chkconfig: 2345 82 55
# processname: puma
# processname: sidekiq
# description: Runs puma and sidekiq for nginx integration.
@mattdees
mattdees / gist:5406040
Created April 17, 2013 17:08
HTTP::Tiny test results on CentOS 5.9
-------
HTTP::Tiny: master
OS Version: CentOS release 5.9 (Final)
OpenSSL: OpenSSL 0.9.8e-fips-rhel5 01 Jul 2008
IO::Socket::SSL: 1.86
'reason' key from get https://google.com: Internal Exception
-------
@mattdees
mattdees / gist:5406024
Created April 17, 2013 17:05
Quick check script for IO::Socket::SSL support
#!/usr/bin/env perl
use strict;
use warnings;
use lib 'lib';
use IO::Socket::SSL;
use HTTP::Tiny;
use Data::Dumper;
@mattdees
mattdees / gist:5123411
Created March 9, 2013 08:03
Query a random command from commandlinefu.com
#!/usr/bin/perl
use HTTP::Tiny;
use JSON;
my $command ='random';
#my $command = 'browse/last-week/sort-by-votes';
my $url = "http://www.commandlinefu.com/commands/${command}/json/";
#print Dumper $res;
<?php
error_reporting(E_ERROR | E_PARSE );
require_once('test-more-php/Test-More.php');
require_once('tests.php');
plan(3);
pass('http');
sub api_request {
my ($auth, $command, $args ) = @_;
my $authstr;
my $port;
$args ||= {};
my $server = $auth->{'server'};
my $access_hash = $auth->{'hash'};
my $user = $auth->{'user'};