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 / 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
TAGS := .tags
OUT := out
DEBUG_CFLAGS:=-Wextra -Wall -Wshadow -Wno-strict-aliasing -Woverflow -Wno-unused-parameter -Wno-unused-variable -g -pipe -march=native
CFLAGS:= -pipe -O2 -march=native
.PHONY: default debug tags out_run
out_run: run
./$(OUT)
out:
$(CC) $(CFLAGS) *.c -o $(OUT)
debug:
@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
@scy
scy / README.md
Last active July 7, 2023 09:27
My OSX PF config for #30C3.

My OS X “VPN only” Setup For #30C3

You should never let passwords or private data be transmitted over an untrusted network (your neighbor’s, the one at Starbucks or the company) anyway, but on a hacker congress like the #30C3, this rule is almost vital.

Hackers get bored easily, and when they’re bored, they’re starting to look for things to play with. And a network with several thousand connected users is certainly an interesting thing to play with. Some of them might start intercepting the data on the network or do other nasty things with the packets that they can get.

If these packets are encrypted, messing with them is much harder (but not impossible! – see the end of this article). So you want your packets to be always encrypted. And the best way to do that is by using a VPN.

Target audience

[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@bdd
bdd / reset-auth.zsh
Last active July 28, 2022 15:32
Reset SSH agent socket and Kerberos credentials cache environment variables.
# -*- mode: shell-script -*-
#
# reset-auth.zsh
#
# When reattaching to a tmux (or screen session) authentication forwarding and
# delegation environment variables needs to be reset.
#
# Shell functions below can reset forwarded SSH Agent socket and Kerberos
# credentials cache environment variables by discovering and testing validity
# (ssh-agent only) on the remote machine.
@mattratleph
mattratleph / vimdiff.md
Last active July 18, 2024 15:03 — forked from roothybrid7/vimdiff_cheet.md
vimdiff cheat sheet

vimdiff cheat sheet

##git mergetool

In the middle file (future merged file), you can navigate between conflicts with ]c and [c.

Choose which version you want to keep with :diffget //2 or :diffget //3 (the //2 and //3 are unique identifiers for the target/master copy and the merge/branch copy file names).

:diffupdate (to remove leftover spacing issues)

:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 31, 2024 13:08
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

server {
listen 80;
server_name openvbx.local;
root /u/apps/openvbx;
access_log /var/log/nginx/openvbx.local.access.log;
error_log /var/log/nginx/openvbx.local.error.log;
index index.php;
if ($request_filename !~ (js|css|jpg|png|gif|robots\.txt|index\.php.*) ) {
rewrite ^(.*)$ /index.php?vbxsite=$1 last;