Skip to content

Instantly share code, notes, and snippets.

derwentx derwentx

Block or report user

Report or block derwentx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@derwentx
derwentx / snippet-index-decoded.php
Last active Nov 13, 2018
Snippets from my analysis of the wp gdpr compliance hack
View snippet-index-decoded.php
/home/[redacted]/public_html/wp-content/plugins/shortcoder/.94a90d7a.ico
View Debian Stretch on my Mid-2014 Macbook Pro 11,3 Retina.md
@derwentx
derwentx / pprint_pyperclip.py
Created Dec 7, 2017
My "one-liner" macro for pformatting and inserting it into the clipboard for analysis. I'd suggest using a snippet manager which supports cursor insertion (like Dash) to avoid having to scroll backwards to replace the @cursor placeholder. I have this mapped to ;ppc
View pprint_pyperclip.py
import pyperclip, pprint; pyperclip.copy( pprint.pformat( @cursor ) )
@derwentx
derwentx / pprint_color.py
Last active Dec 7, 2017 — forked from EdwardBetts/pprint_color.py
My "one-liner" macro for pformatting an object with colour. I'd suggest using a snippet manager which supports cursor insertion (like Dash) to avoid having to scroll backwards to replace the @cursor placeholder. I have this mapped to ;cpp
View pprint_color.py
from pygments import highlight; from pygments.lexers import PythonLexer; from pygments.formatters import Terminal256Formatter; from pprint import pformat; print(highlight(pformat( @cursor ), PythonLexer(), Terminal256Formatter()))
View uarm-5.py
#!/usr/bin/env python
from __future__ import print_function
import sys
import time
import re
# import pyuarm
import yaml
from pprint import pformat
@derwentx
derwentx / instructions.md
Last active Oct 12, 2017
Safely dual boot macOS Sierra with Filevault2 and Debian Stretch with rEFInd and cross-mounting
View instructions.md

Dual Boot encrypted macOS Sierra and Debian Stretch

Rationale

I wanted a safe, encrypted Debian install, parallel to my existing macOS install that I could nuke trivially at a moment's notice and would leave very little evidence behind. In my setup, if I zero'd partitions sda4->sda7 (can be done trivially from macOS or Debian), the next time I rebooted, it would revert to the original EFI System Partition, and I would be greeted by an unblemished factory macOS bootloader. Even if I was asked to decrypt my OS at customs, there would be no evidence of a previous debian install.

Warning

Do not attempt this guide if you are not familiar with linux. YOU WILL NUKE YOUR COMPUTER AND EVERYONE YOU LOVE WILL DIE. Please first read through the whole guide and make sure you are familiar with the utilities we will be using.

@derwentx
derwentx / .zshrc
Last active May 9, 2019
My macOS setup. Run commands from setup.sh
View .zshrc
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
# ZSH customization
ZSH_THEME="powerlevel9k/powerlevel9k"
COMPLETION_WAITING_DOTS="true"
HIST_STAMPS="yyyy-mm-dd"
plugins=(git, zsh-autosuggestions, zsh-syntx-highlighting, brew, npm, z, colorize, autopep8, cabal, dirhistory, lein, macports, osx, perl, pep8, python, pip, sublime, taskwarrior, wd, vi-mode, zsh_reload)
bindkey -v
source $ZSH/oh-my-zsh.sh
@derwentx
derwentx / 1_notmnist_derwent.ipynb
Created Jun 22, 2017
My solutions to the Udacity Tensor Flow Assignment 1
View 1_notmnist_derwent.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@derwentx
derwentx / .htaccess
Last active Jun 27, 2017
Here's how to fix 404s caused by disabling qTranslatex plugin. Change en|fr to a list of | separated language codes.
View .htaccess
# BEGIN Derwent qTranslatex mods
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^(en|fr)(/.*|)$ $2 [L,NC,R=301]
</IfModule>
# END Derwent qTranslatex mods
@derwentx
derwentx / 0_reuse_code.js
Last active Jun 1, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
You can’t perform that action at this time.