Skip to content

Instantly share code, notes, and snippets.

@furio
furio / build-haproxy.sh
Created August 16, 2022 09:30 — forked from whiler/build-haproxy.sh
build haproxy from source
#!/bin/bash
LUAVER=5.4.0
LIBSLZVER=ff537154e7f5f2fffdbef1cd8c52b564c1b00067
PCRE2VER=10.35
OPENSSLVER=1.1.1g
HAPROXYVER=2.2.2
PREFIX=/tmp/opt
CURDIR=${PWD}
@furio
furio / update-security-group
Created November 13, 2019 07:37
A bash function to update my IP in a sg on AWS
function __updateBastionHost {
AWSCOMMONARGS="--profile trans-prod --region eu-central-1"
AWSGROUPID=sg-0b304a3377f768295
MYIP=$(curl -s v4.ifconfig.co)
MYIP=$(echo ${MYIP} | awk '{ print $0 "/32"}')
AWSSIP=$(aws ec2 describe-security-groups --group-ids $AWSGROUPID $AWSCOMMONARGS | jq -r '.[] | .[0] | .IpPermissions[] | select(.FromPort==22) | .IpRanges[] | select(.Description=="FurioThai") | .CidrIp')
aws ec2 revoke-security-group-ingress --group-id $AWSGROUPID $AWSCOMMONARGS --ip-permissions "[{"IpProtocol": "tcp", "FromPort": 22, "ToPort": 22, "IpRanges": [{"CidrIp": "'$AWSSIP'", "Description": "FurioThai"}]}]'
aws ec2 authorize-security-group-ingress --group-id $AWSGROUPID $AWSCOMMONARGS --ip-permissions IpProtocol=tcp,FromPort=22,ToPort=22,IpRanges="[{Description=\"FurioThai\",CidrIp=$MYIP}]"
}
@furio
furio / Bibliography_test.adoc
Created February 24, 2018 11:01 — forked from valefranz/Bibliography_test.adoc
Neo4j Example of a bibliographic network based on DBLP data
@furio
furio / cl_functions.clj
Created February 11, 2018 16:41
Clojure functions exercises
;; https://clojure.org/guides/learn/functions#_test_your_knowledge
; defn
(defn greet [] (println "Hello"))
; def fn
(def greet (fn [] (println "Hello")))
; def with #
(def greet #(println "Hello"))
@furio
furio / Jenkinsfile
Created November 2, 2017 06:00 — forked from jonico/Jenkinsfile
Example for a full blown Jenkins pipeline script with multiple stages, input steps, injected credentials, heroku deploy, sonarqube and artifactory integration, multiple Git commit statuses, PR merge vs branch build detection, REST API calls to GitHub deployment API, stage timeouts, stage concurrency constraints, ...
#!groovy
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
/*
Please make sure to add the following environment variables:
HEROKU_PREVIEW=<your heroku preview app>
HEROKU_PREPRODUCTION=<your heroku pre-production app>
HEROKU_PRODUCTION=<your heroku production app>
@furio
furio / keybase.md
Last active April 13, 2018 20:09
Keybase proof

Keybase proof

I hereby claim:

  • I am furio on github.
  • I am ilfurio (https://keybase.io/ilfurio) on keybase.
  • I have a public key whose fingerprint is E068 A14A FD23 825E 3D31 F363 A639 8257 BDC2 A709

To claim this, I am signing this object:

/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/
/*
Polyfill for the Object.watch/Object.unwatch functions available in Mozilla browsers
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/Object/watch
you have a test here:
http://www.telecable.es/personales/covam1/deployToNenyures/SourceCode/Object.watch.test.js
and can read more here:
http://deploytonenyures.blogspot.com.es/2013/02/objectwatch-polyfill.html
*/