Skip to content

Instantly share code, notes, and snippets.

View guyhughes's full-sized avatar

guy hughes guyhughes

  • /boot/efi/vmlinuz+0x0
View GitHub Profile
@guyhughes
guyhughes / encrypted-git-repo.md
Created March 7, 2017 20:31
Transparent Git Encryption

Transparent Git Encryption

This document has been modified from its [original format][m1], which was written by Ning Shang (geek@cerias.net). It has been updated and reformatted into a [Markdown][m2] document by [Woody Gilk][m3] and [republished][m4].

Description

When working with a remote git repository which is hosted on a third-party storage server, data confidentiality sometimes becomes

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <sys/errno.h>
#include <sys/time.h>
#define die(errnum) { errno = errnum; perror(""); exit(1); }
#define xor(rounds) { \
In [42]: def f(n):
...: compl= (sympy.functions.combinatorial.factorials.factorial(n) * sympy.functions.combinatorial.factorials.binomial(SIZE, n) / mp.power(SIZE, n) )
...: p = 1 - compl
...: return p
...:
...:
In [43]: for i in range(10,SIZE*10, 50):
...: p = f(i)
...: print(i, p)
@guyhughes
guyhughes / local.mk
Last active August 23, 2017 20:22
NEOVIM MAKEFILE with gcc-7 (but default CC * CXX for deps)
# vim: set noet tabstop=5:
CC := gcc-7
CXX := g++-7
CPPFLAGS := -D_FORTIFY_SOURCE=2
LOCALMK_CMAKE_FLAGS = -DMIN_LOG_LEVEL=0 -DCMAKE_INSTALL_PREFIX=/usr/local
all:
setenv
.PHONY: gxgrel
gxgrel: CFLAGS := -O2 -fstack-protector-strong -pie -fPIE
# Brave bookmarks extraction is currently broken so this is how to dump them
# into a stream of json objects, then rewrite that into markdown. You can transform the
# markdown into html with pandoc or whatever.
# requires jq and sed
<session-store-1 jq ' .sites | to_entries[] | select(((.value.tags | length > 0) and ([.value.tags[] == "bookmark"] | any ) ) ) | { (.value.title): .value.location } ' > ~/brave-bookmarks.json
sed -r -e '/^[{}]$/d' -e 's/\s*"([^"]*)":\s*"([^"]*)"/[\1](\2)/' ~/brave-bookmarks.json > ~/brave-bookmarks.md
POST http://zombies.somerandomctf.com/zombies/soapServer.php HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://zombies.somerandomctf.com/zombies/soapServer.php/troopsUpdate"
Content-Length: 579
Host: zombies.somerandomctf.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">