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 / more-ip-providers.json
Created December 11, 2015 01:12
ip providers
{
"ip": "curl ipinfo.io; echo '\\n'; curl icanhazip.com",
}
import java.util.ArrayList;
import java.util.List;
/*
* __ __ __ ____ ______ _ __
* / / / /__ ____ _____/ /____/ __ \____/_ __/___ _(_) /____
* / /_/ / _ \/ __ `/ __ / ___/ / / / ___// / / __ `/ / / ___/
* / __ / __/ /_/ / /_/ (__ ) /_/ / / / / / /_/ / / (__ )
* /_/ /_/\___/\__,_/\__,_/____/\____/_/ /_/ \__,_/_/_/____/
* https://github.com/guyhughes
*/
@guyhughes
guyhughes / Makefile
Last active January 16, 2016 18:20
comp2402 run script and makefile
# _
# (_)____ _ _ __ ____ _
# / // __ `/| | / // __ `/
# / // /_/ / | |/ // /_/ /
# __/ / \__,_/ |___/ \__,_/
# /___/
# __ ____ _ __
# ____ ___ ____ _ / /__ ___ / __/(_)/ /___
# / __ `__ \ / __ `// //_// _ \ / /_ / // // _ \
# / / / / / // /_/ // ,< / __// __// // // __/
#!/bin/sh
set -e
export SCRIPTNAME="$0"
while [ $# -gt 0 ]; do
case "$1" in
-s|--start)
if [ "$(ssh-add -l 2>/dev/null | wc -l)" -lt 1 ]; then
echo "fatal: ssh-agent must be available with identities loaded"
exit 1
fi
@guyhughes
guyhughes / cheatsheet-for-grml.md
Last active April 20, 2016 14:15
Cheatsheet for GRML luks lvm resize

luks and lvm

lsblk
cryptsetup luksOpen /dev/sde³ vg
vgscan
vgchange -ay
vgscan
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
char *first;
char *last;
int age;
} info_t;
#include <assert.h>
#include <stdio.h>
#include <time.h>
#include <sys/time.h>
#define ITERATIONS 10000000
// This is the result of me mocking other students in a class who insisted on
// printing out the bits of a byte using a for loop. The requirement was to
// print the byte as '0000 0000' with a space. I insisted that a for loop is
#!/bin/bash
# ______ __ __ __
# / ____/_ ____ __ / / / /_ ______ _/ /_ ___ _____
# / / __/ / / / / / / / /_/ / / / / __ `/ __ \/ _ \/ ___/
# / /_/ / /_/ / /_/ / / __ / /_/ / /_/ / / / / __(__ )
# \____/\__,_/\__, / /_/ /_/\__,_/\__, /_/ /_/\___/____/
# /____/ /____/
A="$1"
@guyhughes
guyhughes / i915.conf
Created February 10, 2016 15:42
thinkpad
options i915 enable_rc6=1 enable_fbc=1 semaphores=1
@guyhughes
guyhughes / AStack.java
Last active February 18, 2016 21:12
ITI1121 exam question from 2013/2014, implemented
class AStack implements Stack {
public static final int MAX_ITEMS = 1000;
public static final int ITERATIONS = 9;
private int items[] = new int[MAX_ITEMS];
private int i = 0;
public void push(int item) {
if (i < MAX_ITEMS) {