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 / gist:6433872
Created Sep 4, 2013
Colorized manpages with less
View gist:6433872
export LESS_TERMCAP_mb=$'\E[01;31m'
export LESS_TERMCAP_md=$'\E[01;31m'
export LESS_TERMCAP_me=$'\E[0m'
export LESS_TERMCAP_se=$'\E[0m'
export LESS_TERMCAP_so=$'\E[01;44;33m'
export LESS_TERMCAP_ue=$'\E[0m'
export LESS_TERMCAP_us=$'\E[01;32m'
@falzm
falzm / ncsa_stats.awk
Created Jul 30, 2013
A poor man's NCSA log analyzer written in (G)AWK
View ncsa_stats.awk
# My first GAWK script
{
total_bytes += $10
}
$9 ~ /2[0-9]+/ {
n_sc_2xx++
}
You can’t perform that action at this time.