Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gaetronik on github.
  • I am gaetronik (https://keybase.io/gaetronik) on keybase.
  • I have a public key ASCLMe9rZzKTfKsuiZgt1HNfdmTj1d0OaH04thj-lgRQfAo

To claim this, I am signing this object:

@gaetronik
gaetronik / gzip_append.lua
Created July 26, 2017 11:06
Append gzip data to gzip file in lua
require "io"
require "string"
lz = require "zlib"
compress = lz.deflate(lz.BEST_COMPRESSION, 15+16)
outgzfile = "/tmp/test.gz"
mycontent = "test\n"
fhwz = io.open(outgzfile, "a+b")
zcontent,_,_,_ = compress(mycontent,"sync")
@gaetronik
gaetronik / extractCert.awk
Last active October 5, 2015 15:53
Get public key of a server
# to be used with openssl s_client
# ex echo 'Q' | openssl s_client -servername example.com -connect example.com:443 | awk -f extractCert.awk
BEGIN { pr = 0;}
{
if ( $0 ~ /^[-]+BEGIN/ ) {
print $0
pr = 1
}