Skip to content

Instantly share code, notes, and snippets.

View eXeC64's full-sized avatar

Harry Jeffery eXeC64

View GitHub Profile
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
Capslock::Esc
@eXeC64
eXeC64 / main.c
Last active November 3, 2022 13:35
Simple IPv4 TCP server in C
#include <stdio.h>
/* atoi() */
#include <stdlib.h>
/* close() */
#include <unistd.h>
/* sockaddr_in */
#include <arpa/inet.h>

Keybase proof

I hereby claim:

  • I am exec64 on github.
  • I am exec64 (https://keybase.io/exec64) on keybase.
  • I have a public key whose fingerprint is B98F 9EB5 502E 3595 E4CE 441E 7BE4 075E 24AB 8942

To claim this, I am signing this object:

@eXeC64
eXeC64 / reverse.c
Created July 25, 2015 21:23
Quick dirty tool to reverse a file - for a CTF
#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv)
{
char* buf = malloc(0x10000000);
int size = 0;
int v;
while((v = getchar()) != EOF) {
@eXeC64
eXeC64 / depng.c
Created July 25, 2015 21:22
Quick tool to list and dump data chunks from a PNG file
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <endian.h>
int main(int argc, char** argv)
{
if(argc < 2)
return 1;
@eXeC64
eXeC64 / block-countries.sh
Created April 23, 2015 14:50
block-countries.sh
#!/bin/bash
set -e
chain_name="filter_countries"
blacklist="af bd cn hk"
#-------------------------------------------------------------------------------
#Clear out the rules
iptables -F $chain_name
@eXeC64
eXeC64 / coverity_pretty_print.py
Created February 24, 2015 13:22
Pretty printer for coverity issue CSV files
#!/usr/bin/env python
import argparse, csv
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="pretty print a coverity issues csv file")
parser.add_argument("file",
type=str,
help="The csv file to parse")
parser.add_argument("-c",
dest="colors",
# vim:set ts=8 sts=2 sw=2 et:
pkgname=linux-zenbook
pkgrel=1
pkgdesc="Custom linux kernel"
arch=('x86_64')
url="http://www.kernel.org/"
license=('GPL2')
pkgver=3.19.r9526.ga135c71
@eXeC64
eXeC64 / gist:be831c7b4cc785ba09aa
Last active August 29, 2015 14:11
CSV x,y -> y,count(y)
import qualified Data.Map.Strict as Map
import Data.Maybe (mapMaybe)
import Text.CSV (parseCSV)
import Text.Printf (printf)
parseFilm (t:y:[]) = Just (t,y)
parseFilm _ = Nothing
countYears :: [(String,String)] -> [(String,Int)]
countYears films = Map.toList $ foldl (\m (_,y) -> Map.insertWith (+) y 1 m) Map.empty films
@eXeC64
eXeC64 / prepare-commit-msg
Created October 16, 2014 12:54
git prepare-commit-msg hook for Mantid
#!/bin/sh
#Don't do anything on merge commits
[ "$2" = "merge" ] && exit 0
#If there's already a message, do nothing
[ "$2" = "message" ] && exit 0
[ "$2" = "template" ] && exit 0
#For squash messages do nothing