Skip to content

Instantly share code, notes, and snippets.


Ambrose Chua serverwentdown

View GitHub Profile
View gist:256a93210d333648db004d389899437f

Some useful one-liners

Download tared binaries

# dust
wget -O - | tar -xz --strip-components 1 '*dust'

Comparing URL Query Parameter Parsers

Differences in parsers can result in security issues under certain circumstances. For example, cache poisoning.

Help me add to this list! Comment below

Source Key-value pair delimiters Issue
serverwentdown /
Last active May 4, 2020
IVARcluster, prices in SGD at time of commit.

To make it more interesting, this setup should include a variety of motherboards, SSDs, HDDs, memory and PSUs. I might start with one system, and build another one every 6 months. I forsee this list changing over time, but the base specifications are as follows:

  • CPU: >6 core, >4GHz
  • Storage: >256GB NVMe
  • Memory: >16GB, dual channel

Pricing Source:


serverwentdown /
Last active Mar 4, 2022
Some really useless script that generates IPv6 hops using netns for your traceroute pleasure.
import sys
import itertools
from netaddr import *
PREFIX = IPNetwork('fd00:0:3:1337::/64')
NAME = 'virtual0'
COUNT = 30
serverwentdown / cleanup
Created Sep 19, 2019
A bash script to normalise course documents.
View cleanup
for file in */*; do
if ! [[ -f $file ]]; then
updated="$(echo $file | sed -E 's~^(([^/]*/)*)(ICT(-CSC)?[0-9]{4})?([- _]*)([^/]+)$~\1\6~')"
updated="$(echo $updated | sed -E 's~Chpt ?~Lect~')"
updated="$(echo $updated | sed -E 's~L(ecture|ect|ec|0)[- _]*0*([0-9]+)[- _]+~Lec\2 - ~')"
updated="$(echo $updated | sed -E 's~Lab[- _]*0*([0-9]+)[- _]+~Lab\1 - ~')"
s = 'actgactgactggatc'
m = {
'a': 0,
'c': 1,
't': 2,
'g': 3
bytestring = []
serverwentdown / extra_tabs.tmpl
Last active Aug 2, 2019
A custom template for Gitea to embed pages into tabs with an iframe. Requires the proper X-Frame-Options and Content-Security-Policy on the linked resource. The example below is how I use it for Drone. Install into data/gitea/templates/custom/extra_tabs.tmpl as described on
View extra_tabs.tmpl
<a class="item" href="{{.RepoLink}}" data-iframe-tab="builds" title="Builds">
<i class="octicon octicon-gear"></i> <img src="{{.RepoLink}}/status.svg?ref=refs/heads/master" style="width: auto">
document.addEventListener('DOMContentLoaded', () => {
const openFrame = (tab) => {
const name = tab.dataset.iframeTab;
const page = tab.href;
import random
import math
import string
import sys
import click
# correct horse battery staple
def load_dictionary(d="/usr/share/dict/words"):
f = open(d, "r")
serverwentdown /
Last active Sep 15, 2018 — forked from shahril96/
USB HID PCAP parser for HITB GSEC .edu 2018 - VValueCiphered
from scapy.all import *
from argparse import ArgumentParser
from sys import argv
from collections import OrderedDict
# USB HID Keyboard scan codes
key_hid = {
0x00 : ['', ''], # no key pressed
0x04 : ['a', 'A'],