Skip to content

Instantly share code, notes, and snippets.

View auscompgeek's full-sized avatar

David Vo auscompgeek

View GitHub Profile
[core]
# git default is 7
# kernel devs like 12
abbrev = 10
[alias]
lg = log --graph --pretty=format:'%C(auto)%h%d %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'
id = rev-parse --verify HEAD
@auscompgeek
auscompgeek / C-large-1.py
Last active December 16, 2015 06:49
Google Code Jam - Qualification Round 2013 - C. Fair and Square - large 1 input
#!/usr/bin/python3
import re
from math import ceil, sqrt
MAY_BE_PALINDROMIC_ROOT = re.compile(r'(?:[123]|[12][012]*[12])$')
palindromes = []
def is_palindrome(S):
#return S == S[::-1]
l = len(S)
@auscompgeek
auscompgeek / exam_statistics.pas
Last active December 19, 2015 13:58
prelim SDD assignment - turn exam scores into statistics (spot the non-standard pascal)
{
exam_statistics.pas - transform exam scores into statistical information
Copyright (c) 2013 David Vo
All rights reserved
(unless specified)
This program is designed to take class scores from an exam out of 10 (no full marks)
and display a horizontal histogram and the mean, median, and range of the scores.
}
@auscompgeek
auscompgeek / _scrape_bom_names.py
Last active December 24, 2015 21:29
scrape BoM for a station name to ID mapping in INI format
#!/usr/bin/env python3
import re
import requests
states = [
("nsw", 'N'),
("vic", 'V'),
("qld", 'Q'),
("wa", 'W'),
@auscompgeek
auscompgeek / README.md
Last active January 8, 2016 11:14
NyanFlip - An extension of BackFlip by Peter Ward (@flowblok). An example program is attached.

NyanFlip

An extension by Peter Ward (@flowblok) of the [BackFlip][1] esoteric programming language.

Here follows the original description by @flowblok from the NCSS 2014 Programming Competition:

Nyan Cat is stuck in an arcade game! You have the feeling that she's trying to get a message to you, but the game is running so slowly it will take days until she completes her message. The game is played on a 2D grid. Nyan Cat enters at the top-left corner, and starts by moving one tile to the right every turn. Some tiles have things displayed on them:

  • Arrows (<, >, ^ and V): When Nyan Cat steps on one of these, it changes her direction so she is now moving in the direction the arrow pointed in. However, that arrow then changes direction to point back the way she came from.
@auscompgeek
auscompgeek / 1.eml
Last active December 24, 2016 06:35
"hi Am Anita" spam received on a truncated version of my public github email
Delivered-To: gh@vovo.id.au
Received-SPF: Pass (zoho.com: domain of anitakim2015@hotmail.com designates 65.54.190.187 as permitted sender ) client-ip: 65.54.190.187
Received-SPF: pass (zoho.com: domain of hotmail.com designates 65.54.190.139 as permitted sender) client-ip=65.54.190.139; envelope-from=anitakim2015@hotmail.com; helo=BAY004-OMC3S1.hotmail.com;
Authentication-Results: mx.zoho.com;
spf=pass (zoho.com: domain of hotmail.com designates 65.54.190.139 as permitted sender) smtp.mailfrom=anitakim2015@hotmail.com;
Received: from BAY004-OMC3S1.hotmail.com (bay004-omc3s1.hotmail.com [65.54.190.139]) by mx.zohomail.com
with SMTPS id 147922693688124.64277573519496; Tue, 15 Nov 2016 08:22:16 -0800 (PST)
Received: from EUR01-VE1-obe.outbound.protection.outlook.com ([65.54.190.187]) by BAY004-OMC3S1.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008);
Tue, 15 Nov 2016 08:22:15 -0800
Received: from VE1EUR01FT016.eop-EUR01.prod.protection.outlook.com
@auscompgeek
auscompgeek / gist:a4390fb82a31ce69256b
Last active March 20, 2017 13:27
9447 CTF - future - Hypnotoad's (edited) transcript
# nmap -v -6 -n -Pn 2400:6180:0000:00d0::0264:7001 -sO
Starting Nmap 6.47 ( http://nmap.org ) at 2014-12-01 12:21 AEDT
Initiating IPProto Scan at 12:21
Scanning 2400:6180:0:d0::264:7001 [256 ports]
[...snip...]
Discovered open port 132/ip on 2400:6180:0:d0::264:7001
[...snip...]
Completed IPProto Scan at 12:25, 231.97s elapsed (256 total ports)
Nmap scan report for 2400:6180:0:d0::264:7001
#!/usr/bin/env python3
digits = '0123456789'
decrement_map = dict(zip(digits[1:], digits))
def solve(N: str):
m = N[0]
for i, x in enumerate(N):
if m <= x:
@auscompgeek
auscompgeek / cysca-2017-ast.md
Created May 24, 2017 02:49
CySCA 2017: Python: Abstract Syntax Treat writeup

Python: Abstract Syntax Treat

Writeup by @auscompgeek.

Disclaimer: I did not participate in CySCA 2017. I simply saw this challenge (and a number of people struggling over it) and found it interesting. As such, I do not have the full description of the challenge.

Competitors were provided with a file tree.py. I have attached it for prosperity.

Before attempting to solve this challenge, it should be noted (from the shebang line) that this is a Python 2 program.

@auscompgeek
auscompgeek / pause-button
Last active July 25, 2017 01:36
Universal Pause Button for X11
#!/bin/sh
# Universal Pause Button for X11
# by auscompgeek
# licensed under MIT/X11
# requires xdotool
me=pause-button
die() {
echo "$me: $*" >&2