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
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include <stdlib.h>
typedef struct {
char *first;
char *last;
int age;
} info_t;
@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
#!/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 / Makefile
Last active January 16, 2016 18:20
comp2402 run script and makefile
# _
# (_)____ _ _ __ ____ _
# / // __ `/| | / // __ `/
# / // /_/ / | |/ // /_/ /
# __/ / \__,_/ |___/ \__,_/
# /___/
# __ ____ _ __
# ____ ___ ____ _ / /__ ___ / __/(_)/ /___
# / __ `__ \ / __ `// //_// _ \ / /_ / // // _ \
# / / / / / // /_/ // ,< / __// __// // // __/
import java.util.ArrayList;
import java.util.List;
/*
* __ __ __ ____ ______ _ __
* / / / /__ ____ _____/ /____/ __ \____/_ __/___ _(_) /____
* / /_/ / _ \/ __ `/ __ / ___/ / / / ___// / / __ `/ / / ___/
* / __ / __/ /_/ / /_/ (__ ) /_/ / / / / / /_/ / / (__ )
* /_/ /_/\___/\__,_/\__,_/____/\____/_/ /_/ \__,_/_/_/____/
* https://github.com/guyhughes
*/
@guyhughes
guyhughes / more-ip-providers.json
Created December 11, 2015 01:12
ip providers
{
"ip": "curl ipinfo.io; echo '\\n'; curl icanhazip.com",
}
for file in *.json; do
if $(cat $file | json -n); then
printf "\r[OK] $file"
else
echo "[ERROR] $file FAILED"
fi
done
{
"query":{
"terms": {
"name": ["burger"]
}
}
}
@guyhughes
guyhughes / Makefile
Last active November 30, 2015 00:50
# _
# (_)____ _ _ __ ____ _
# / // __ `/| | / // __ `/
# / // /_/ / | |/ // /_/ /
# __/ / \__,_/ |___/ \__,_/
# /___/
# __ ____ _ __
# ____ ___ ____ _ / /__ ___ / __/(_)/ /___
# / __ `__ \ / __ `// //_// _ \ / /_ / // // _ \
# / / / / / // /_/ // ,< / __// __// // // __/
[Unit]
Description=Powertop Auto-Tune
[Service]
Type=oneshot
ExecStart=/usr/sbin/powertop --auto-tune
[Install]
WantedBy=multi-user.target