Skip to content

Instantly share code, notes, and snippets.

View benmezger's full-sized avatar
:octocat:
hacking

Ben Mezger benmezger

:octocat:
hacking
View GitHub Profile
@benmezger
benmezger / prompt_lamda_setup.zsh
Created May 7, 2016 02:37
prompt_lambda_setup - zprezto's theme.
# my custom zprezto's prompt theme.
############ BEGIN SORIN #############
# https://github.com/sorin-ionescu/prezto/blob/master/modules/prompt/functions/prompt_sorin_setup
function prompt_unix_pwd {
local pwd="${PWD/#$HOME/~}"
if [[ "$pwd" == (#m)[/~] ]]; then
_prompt_unix_pwd="$MATCH"
@benmezger
benmezger / gist:44b0ed405d834683b862ab4800fc69be
Created May 8, 2016 14:27 — forked from rygorous/gist:e0f055bfb74e3d5f0af20690759de5a7
A bit of background on compilers exploiting signed overflow
Why do compilers even bother with exploiting undefinedness signed overflow? And what are those
mysterious cases where it helps?
A lot of people (myself included) are against transforms that aggressively exploit undefined behavior, but
I think it's useful to know what compiler writers are accomplishing by this.
TL;DR: C doesn't work very well if int!=register width, but (for backwards compat) int is 32-bit on all
major 64-bit targets, and this causes quite hairy problems for code generation and optimization in some
fairly common cases. The signed overflow UB exploitation is an attempt to work around this.
@benmezger
benmezger / Cliref.md
Created June 6, 2016 19:32 — forked from yunga/Cliref.md
CLIRef.md
_________ _____ _______________       _____
\_   ___ \\    \\___________   \____ / ____\     ~/.bash/cliref.md
/    \  \/|    | |   ||       _/ __ \  __\    copy/paste from whatisdb
\     \___|__  |_|_  ||    |   \  __/|_ |   http://pastebin.com/yGmGiDQX
 \________  /_____ \_||____|_  /____  /_|     yunga.palatino@gmail.com
 20160515 \/ 1527 \/         \/     \/

alias CLIRef.txt='curl -s "http://pastebin.com/raw/yGmGiDQX" | less -i'

@benmezger
benmezger / start-tor-browser.desktop
Created September 4, 2016 19:19
Exec from /opt/
#!/usr/bin/env ./Browser/execdesktop
#
# This file is a self-modifying .desktop file that can be run from the shell.
# It preserves arguments and environment for the start-tor-browser script.
#
# Run './start-tor-browser.desktop --help' to display the full set of options.
#
# When invoked from the shell, this file must always be in a Tor Browser root
# directory. When run from the file manager or desktop GUI, it is relocatable.
#
#!/usr/bin/perl -w
# ***************************************************************************
# * _ _ ____ _
# * Project ___| | | | _ \| |
# * / __| | | | |_) | |
# * | (__| |_| | _ <| |___
# * \___|\___/|_| \_\_____|
# *
# * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
# *
@benmezger
benmezger / prompt_unix_setup
Created September 4, 2016 19:26
My Custom zprezto prompt theme
############ BEGIN SORIN #############
# https://github.com/sorin-ionescu/prezto/blob/master/modules/prompt/functions/prompt_sorin_setup
function prompt_unix_pwd {
local pwd="${PWD/#$HOME/~}"
if [[ "$pwd" == (#m)[/~] ]]; then
_prompt_unix_pwd="$MATCH"
unset MATCH
else
#!/usr/bin/env python
fg = '\033[38;5;'
bg = '\033[48;5;'
for i in range( 0, 256):
n = str(i)
fgstr = fg + n + 'm' + n
bgstr = bg + n + 'm' 'XXXXX'
print fgstr, bgstr, '\033[0m'

Keybase proof

I hereby claim:

  • I am benmezger on github.
  • I am benmezger (https://keybase.io/benmezger) on keybase.
  • I have a public key ASCWyqQXOzciLhYpPebK35dIKq3iCk8gn7n9XUJriXQLVgo

To claim this, I am signing this object:

#
# dotzsh : https://github.com/dotphiles/dotzsh
#
# Defines environment variables.
#
# Authors:
# Ben O'Hara <bohara@gmail.com>
#
# Paths
@benmezger
benmezger / dircolors
Created November 16, 2016 22:01
dircolors-monokai
# Monokai color theme for the color GNU ls utility.
# Designed for dircolors (GNU coreutils) 5.97
#
# This file was largely inspired by seebi/dircolors-solarized on github.
#
# How the colors were selected:
# - Terminal emulators often have an option typically enabled by default that makes
# bold a different color. It is important to leave this option enabled so that
# you can access the entire 16-color palette, and not just 8 colors.
# - We favor universality over a greater number of colors. So we limit the number