Hacking is really just the act of finding a clever and counterintuitive solution to a problem.
The hacks found in program exploits usually use the rules of the computer to bypass security in ways never intended. Programming hacks are similar in that they also use the rules of the computer in new and inventive ways, but the final goal is efficiency or smaller source code, not necessarily a security compromise. There are actually an infinite number of programs that can be written to accomplish any given task, but most of these solutions are unnecessarily large, complex, and sloppy. The few solutions that remain are small, efficient, and neat. Programs that have these qualities are said to have elegance, and the clever and inventive solutions that tend to lead to this efficiency are called hacks. Hackers on both sides of programming appreciate both the beauty of elegant code and the ingenuity of clever hacks.
In the business world, more importance is placed on churning out functional code than on
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you change this file, run 'update-grub' afterwards to update | |
# /boot/grub/grub.cfg. | |
# For full documentation of the options in this file, see: | |
# info -f grub -n 'Simple configuration' | |
GRUB_DEFAULT=0 | |
GRUB_HIDDEN_TIMEOUT=0 | |
GRUB_TIMEOUT=5 | |
GRUB_TIMEOUT_STYLE=menu | |
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
shopt -s expand_aliases | |
export EDITOR=vim | |
export VISUAL=vim | |
mkdir -p $HOME/log # TODO: GCP logging shit | |
STARTTIME=`date --iso-8601=minutes --utc` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# TODO check we are on macOS | |
# TODO https://google.github.io/styleguide/shell.xml | |
INSTANCE_NAME=$INSTANCE_NAME | |
gcloud compute instances start $INSTANCE_NAME | |
IPADDRESS=`gcloud compute instances describe $INSTANCE_NAME | grep natIP | grep -oE '((1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])\.){3}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])'` | |
printf "%s is at %s\n" $INSTANCE_NAME $IPADDRESS | |
# TODO check Microsoft RDP is installed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
mt940toOFX.py - Dieses Progrtamm liesst MT940 SWIFT Kontostände und konvertiert sie in OFX. | |
OFX wurde mit xero.com getestet. | |
Created by Maximillian Dornseif on 2010-06-05. | |
Copyright (c) 2010, 2013, 2014 HUDORA. All rights reserved. | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install CUDA Toolkit v9.0 | |
# Instructions from https://developer.nvidia.com/cuda-downloads (linux -> x86_64 -> Ubuntu -> 16.04 -> deb (network)) | |
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub | |
CUDA_REPO_PKG="cuda-repo-ubuntu1604_9.0.176-1_amd64.deb" | |
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/${CUDA_REPO_PKG} | |
sudo dpkg -i ${CUDA_REPO_PKG} | |
sudo apt-get update | |
sudo apt-get -y install cuda-9-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """ | |
import numpy as np | |
import cPickle as pickle | |
import gym | |
from chainer import cuda | |
import cupy as cp | |
import time, threading | |
#backend |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# slow down crazy fast gaming mouse on X | |
if [[ `uname` == 'Darwin' ]]; then | |
echo "Exiting: I don't know what this does on macOS even with XQuartz." | |
exit 1; | |
fi | |
FASTMOUSE=$(xinput --list --short|grep -i sabre|cut -f 2 |sed 's/id=//g') | |
for id in ${FASTMOUSE[@]}; do | |
xinput --set-prop $id "Device Accel Constant Deceleration" 10 | |
xinput --set-prop $id "Device Accel Velocity Scaling" 10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# known issues: | |
# plenty, but | |
# GitHub can't render it properly: see the raw version which is `perltidy` | |
# hardcodes image size and only looks for gifs | |
# has an iterator that goes over 9000 regardless of whether it's still | |
# getting images or not | |
# it was written for a particular Tumblr, so may need tweaking for others | |
# | |
# try: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Don't call directly, called by `subtitles.sh` | |
"""Given an srt file, clean it up as much as possible to look like prose.""" | |
import re | |
import sys | |
bad_words = ['-->', 'WEBVTT', 'Language: en', 'Kind: captions'] |