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
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/">
# 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
@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
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)
#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) { \
@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

@guyhughes
guyhughes / virtualenvwrapper.md
Created December 22, 2016 19:27
virtualenvwrapper quickstart

virtualenvwrapper has broken dependencies right now on macOS, so install like this:

sudo pip install pbr
sudo pip install --no-deps stevedore
sudo pip install --no-deps virtualenvwrapper

So that the commands mkvirtualenv and workon stay in your shell, you're going to want to do this (if you use zsh or another shell, change the filename here):

#!/bin/sh
OPTS=''
X="+ */\n"
while [ $# -gt 0 ]; do
case "$1" in
-*)
OPTS+="$OPTS $1"
;;
*)
X+="+ **/$1\n"
@guyhughes
guyhughes / apt-metapackage.md
Created October 1, 2016 05:16
APT Build metapackage
  1. You need equivs
apt-get install equivs
  1. use it
mkdir my-metapackage
cd my-metapackage/
equivs-control ns-control
equivs-build ns-control

Aptly

aka how to make a stupid mirror

  1. get aptly (https://aur.archlinux.org/aptly.git)

  2. get the ubuntu-archive-keyring. can use any ssl mirror.

curl -OJL https://gpl.savoirfairelinux.net/pub/mirrors/ubuntu/project/ubuntu-archive-keyring.gpg.sig