Skip to content

Instantly share code, notes, and snippets.

View ionutvilie's full-sized avatar

Ionut Ilie ionutvilie

  • Bucharest
  • 12:25 (UTC +03:00)
View GitHub Profile

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

$ go run main.go
Now listening on: http://localhost:9090
Application started. Press CMD+C to shut down.
[INFO] 2018/04/18 23:17 /authorize?fooo=bar&bar=foo
[INFO] 2018/04/18 23:17 200 732.308µs ::1 GET /authorize
[INFO] 2018/04/18 23:17 /authorize?fooo=bar&bar=foo
[INFO] 2018/04/18 23:17 200 51.315µs ::1 GET /authorize
[ERRO] 2018/04/18 23:17 /authorize/sre?fooo=bar&bar=foo
[ERRO] 2018/04/18 23:17 /authorize/sre?fooo=bar&bar=foo
@ionutvilie
ionutvilie / cassandra-tweet.sql
Last active January 12, 2018 11:06
cassandra-golang-play
--datasource1
CREATE KEYSPACE datasource1 with replication = { 'class' : 'SimpleStrategy', 'replication_factor' : 1 };
CREATE TABLE datasource1.tweet (
id uuid,
event_time timestamp,
description text,
summary text,
PRIMARY KEY (id, event_time)
) WITH CLUSTERING ORDER BY (EventTime DESC);
@ionutvilie
ionutvilie / prometheus-converter.go
Created June 8, 2017 18:39
prometheus.io converter / receive json , parse and set to metrics
package main
// prometheus receive json and transform to prometheus metrics
// https://groups.google.com/forum/#!topic/prometheus-users/a1ft04aYKNc
import (
"fmt"
"net/http"
"flag"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"strconv"
@ionutvilie
ionutvilie / alert-rules.go
Created May 9, 2017 14:42
automate prometheus alerts
package main
import (
"os"
"text/template"
)
type Template struct {
Text, Lang string
}
@ionutvilie
ionutvilie / windows-subsytem-golang-install
Last active April 1, 2017 09:30
windows linux subsytem ubuntu install golang
# i did not checket on pure ubuntu but it should work
#Download and unpack golang go
curl https://storage.googleapis.com/golang/go1.8.linux-amd64.tar.gz -o go1.8.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.8.linux-amd64.tar.gz
#update and set alternatives from windows ubuntu subsystem
#update-alternatives: --install needs <link> <name> <path> <priority>
sudo update-alternatives --install "/usr/bin/go" "go" "/usr/local/go/bin/go" 1
sudo update-alternatives --set "go" "/usr/local/go/bin/go"
@ionutvilie
ionutvilie / main.py
Last active April 5, 2017 17:42
kodi tv show library builder
#!/usr/bin/env python2.7
"""
if everything is stored in a Download folder
the script uses regex to filter tv shows based on 'S00E00' pattern
and create a compatible kodi tv shows structure using symlinks
"""
import os
import re
downloads = "/home/ionut/Downloads/"