Skip to content

Instantly share code, notes, and snippets.

💭
¯\_(ツ)_/¯

Marc Falzon falzm

💭
¯\_(ツ)_/¯
Block or report user

Report or block falzm

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View tcpping.go
package main
import (
"log"
"net"
"os"
"time"
)
var (
@falzm
falzm / untag.go
Created May 18, 2019
Strip all ID3 tags from an MP3 file
View untag.go
package main
import (
"os"
"github.com/bogem/id3v2"
)
func main() {
tag, err := id3v2.Open(os.Args[1], id3v2.Options{Parse: true})
@falzm
falzm / tf_targeted_destroy_bug.tf
Created May 7, 2019
Terraform sample configuration illustrating a bug with targeted "destroy" command
View tf_targeted_destroy_bug.tf
# This example uses the Exoscale provider:
# https://github.com/exoscale/terraform-provider-exoscale/
locals {
zone = "ch-gva-2"
key_pair = "default"
hostnames = [
"ch2771-test1",
"ch2771-test2",
View keybase.md

Keybase proof

I hereby claim:

  • I am falzm on github.
  • I am falzm (https://keybase.io/falzm) on keybase.
  • I have a public key ASDuhM0ikKuLH23Oc2gADrFXYUpOzEiuUSfRAFg636NCMQo

To claim this, I am signing this object:

@falzm
falzm / .json
Last active Aug 1, 2018
Top 10 longest album durations (fixed)
View .json
{
"took" : 22,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8392,
@falzm
falzm / .json
Created Oct 3, 2015
10 Most played tracks
View .json
{
"took" : 16,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"failed" : 0
},
"hits" : {
"total" : 8486,
@falzm
falzm / commonlog2iso8601.go
Created Nov 2, 2014
Convert Nginx' "time_local" to "time_iso8601" date formats
View commonlog2iso8601.go
package main
import "fmt"
import "time"
func main() {
commonlogDateFormat := "2/Jan/2006:15:04:05 -0700"
iso8601DateFormat := "2006-01-02T15:04:05-07:00"
parsedDate, err := time.Parse(commonlogDateFormat, "18/Oct/2014:08:53:14 +0200")
@falzm
falzm / collectd_mariadb_tablestats.py
Last active Apr 13, 2017
collectd-python module for reading MariaDB user statistics
View collectd_mariadb_tablestats.py
#!/usr/bin/python
# -*- coding: utf-8 -*-
# collectd-python module for reading MariaDB user statistics
# Author: Marc Falzon
#
# Requirements:
# * MariaDB >= 5.2.0 with user statistics enabled
# (see https://mariadb.com/kb/en/mariadb/user-statistics/)
# * collectd compiled with Python module
@falzm
falzm / sorted_json.rb
Last active Nov 22, 2016 — forked from halkeye/sorted_json.rb
Puppet parser function for outputting JSON-formatted objects, in a sorted consistent way.
View sorted_json.rb
require 'json'
def sorted_json(obj)
case obj
when String, Fixnum, Float, TrueClass, FalseClass, NilClass
return obj.to_json
when Array
arrayRet = []
obj.each do |a|
arrayRet.push(sorted_json(a))
View amqp_consumer.go
package main
import (
"github.com/streadway/amqp"
"log"
"os"
"os/signal"
"runtime"
"syscall"
"time"
You can’t perform that action at this time.