Skip to content

Instantly share code, notes, and snippets.

Avatar
🦄

Alfred Gamulo alfredgamulo

🦄
View GitHub Profile
View test_unwrap_template.c
//$ test_unwrap_templat --pin <PIN> --library </usr/local/Cellar/softhsm/2.5.0/lib/softhsm/libsofthsm2.so>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "cryptoki.h"
#include "dlfcn.h"
View ec2.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@alfredgamulo
alfredgamulo / salactus.md
Created Mar 8, 2018 — forked from kapilt/salactus.md
salactus doc improvements
View salactus.md

Use Cases

Sometimes you really want to scan all objects, or in the words of gary oldman from the professional, "bring me EVERYONE" :-) There are a couple of different reasons for that from an org perspective, given current feature sets, most of it involves catching up on s3 security from both an acl and encryption perspective after the fact.

Salactus provides for scale out scanning of every s3 object with configurable object visitors. It also supports s3 inventory as a

@alfredgamulo
alfredgamulo / reinvent-2017-youtube.md
Last active Dec 11, 2017 — forked from stevenringo/reinvent-2017-youtube.md
Links to YouTube recordings of AWS re:Invent 2017 sessions
View reinvent-2017-youtube.md

| Title | Description

@alfredgamulo
alfredgamulo / lua with C
Last active Feb 22, 2016
Use C nanosleep inside lua code
View lua with C
local ffi = require "ffi"
local C = ffi.C
local math = math
math.randomseed( os.time() )
ffi.cdef[[
typedef struct timespec {long tv_sec; long tv_nsec;};
int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
]]
View keybase.md

Keybase proof

I hereby claim:

  • I am alfredgamulo on github.
  • I am alfred (https://keybase.io/alfred) on keybase.
  • I have a public key whose fingerprint is 6563 28F9 8C70 9310 2876 B603 C43A 8AFF 4CD6 694A

To claim this, I am signing this object:

@alfredgamulo
alfredgamulo / gauth.py
Last active Aug 29, 2015
Time-based One-Time Pad Algorithm
View gauth.py
#!/usr/bin/env python3
# gauth.py
import doctest
import time
import base64
import struct
import hmac
import hashlib
@alfredgamulo
alfredgamulo / Java CodeJam
Last active Aug 29, 2015
Java template for Google CodeJam
View Java CodeJam
import java.util.*;
import java.io.PrintStream;
import java.util.Scanner;
public class A {
Scanner sc = new Scanner(getClass().getResourceAsStream(FILENAME));
static final String FILENAME = "file.in";
PrintStream out = System.out;
@alfredgamulo
alfredgamulo / chef installer
Created May 15, 2014
Single line dynamic chef cookbook installer
View chef installer
#!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
APPLICATION="${0##*/}"
USAGE="Cookbook installer
usage: $APPLICATION -c cookbooks
Ensures chef as a dependency and installs cookbooks specified with -c.
THIS MUST BE RUN AS ROOT. This script only works with Redhat Enterprise Linux 5 or Mac OSX.
View Mumford
#!/usr/bin/ruby
def x2s(x)
ret = ""
if x.length > 2
while x.length >= 2
ret += x[0..1].hex.chr.to_s
x = x[2..-1]
end
ret += x[0..1].hex.chr.to_s