Skip to content

Instantly share code, notes, and snippets.

View ngerakines's full-sized avatar
🏠
Working from home

Nick Gerakines ngerakines

🏠
Working from home
View GitHub Profile
@ngerakines
ngerakines / keyping.go
Created February 7, 2019 16:47 — forked from zmanian/keyping.go
Key Pinning in #Golang
package main
import (
"bytes"
"crypto/sha256"
"crypto/tls"
"crypto/x509"
"log"
"net"
"net/http"

key pinning

  1. Use csplit to split the full chain.

    $ csplit -f cert- /etc/letsencrypt/live/path/to/fullchain.pem '/-----BEGIN CERTIFICATE-----/' '{*}'

  2. Get the hashes from the parts

    $ openssl x509 -noout -in cert-00 -pubkey | openssl rsa -pubin -outform der |openssl dgst -sha256 -binary | base64

#include <iostream>
struct Node
{
int data;
struct Node *next;
};
void Print(Node *head)
{
module.exports = function(sequelize, DataTypes) {
var Task = sequelize.define('Task', {
title: DataTypes.STRING
}, {
classMethods: {
associate: function(models) {
Task.belongsTo(models.User)
}
}
})
Red Hat Enterprise Linux 5 Adminstration
Hacking Roomba
Agile Project Management With Scrum
The Art of Capacity Planning
JavaScript for Web Developers
Begining Lua Programming
Hacking del.icio.us
Professional Ajax
The Next 100 Years
Mausi

Keybase proof

I hereby claim:

  • I am ngerakines on github.
  • I am ngerakines (https://keybase.io/ngerakines) on keybase.
  • I have a public key whose fingerprint is 9530 23D8 48C3 5059 A2E2 4888 33D4 3D85 4F96 B2E4

To claim this, I am signing this object:

public abstract class AbstractTemplate {
protected abstract String getTemplateFile();
public String run() {
return "rendered template from " + getTemplateFile();
}
}
#!/usr/bin/python2
import sys
import os
from os.path import join
import tarfile
import shutil
import popen2
from optparse import OptionParser
import logging
public interface CalcService extends RespondingService {
void add(final CallbackMessageController<CalcProto.Results> messageController, final CalcProto.Add add);
}
@ngerakines
ngerakines / gist:9002823
Created February 14, 2014 15:17
update-git.sh
#!/bin/sh
parent=${PWD##*/}
if [ -f 'repos' ]
then
echo "`repos` file exists."
for i in `cat repos`; do
if [ -d $i ]
then