Skip to content

Instantly share code, notes, and snippets.

View NZKoz's full-sized avatar

Michael Koziarski NZKoz

View GitHub Profile
@NZKoz
NZKoz / apologies.text
Last active February 22, 2022 16:01
Template password compromise documentation
Dear [First Name],
We're really sorry but our systems were compromised and the attackers managed to take a copy
of your passwords.
The passwords were stored as:
[ ] Bcrypt hashes with a cost factor of X
[ ] PBKDF2 hashes with an iteration count of X
[ ] scrypt because I am Colin Percival
POST /mobileapi/Something HTTP/1.1
Host: example.com
Authorization: Token token="fuckpiss"
Accept: application/json
Accept-Encoding: gzip, deflate
Accept-Language: en;q=1, fr;q=0.9, de;q=0.8, ja;q=0.7, nl;q=0.6, it;q=0.5
Content-Length: 0
Connection: keep-alive
User-Agent: My Shit/1.9.0 (iPhone Simulator; iOS 6.1; Scale/2.00)
@NZKoz
NZKoz / solar87
Created March 28, 2013 01:38
Riyadh Solar Time
# <pre>
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# So much for footnotes about Saudi Arabia.
# Apparent noon times below are for Riyadh; your mileage will vary.
# Times were computed using formulas in the U.S. Naval Observatory's
# Almanac for Computers 1987; the formulas "will give EqT to an accuracy of
# [plus or minus two] seconds during the current year."
#
include_recipe "apt"
apt_repository "brightbox" do
uri 'http://ppa.launchpad.net/brightbox/ruby-ng/ubuntu'
distribution node.lsb.codename
components ['main']
keyserver "keyserver.ubuntu.com"
key "C3173AA6"
action :add
end
@NZKoz
NZKoz / build.sh
Created October 30, 2012 22:32
Build thing we do
/usr/bin/sprockets -I path/to/Assets/ path/to/Assets/main.js path/to/Assets/main.css -o $TEMP_DIR/assets
/usr/bin/yuicompressor --type js $TEMP_DIR/assets/main*js > $SRCROOT/Assets/Generated/main.min.js
/usr/bin/yuicompressor --type css $TEMP_DIR/assets/main*css > $SRCROOT/Assets/Generated/main.min.css
cp -r $TEMP_DIR/assets/*png $SRCROOT/Assets/Generated/
(lldb) po NSStringFromCGRect(self.frame)
error: property 'frame' not found on object of type 'SLComposeCardView *'
error: 1 errors parsing expression
(lldb) po NSStringFromCGRect([self frame])
error: no known method '-frame'; cast the message send to the method's return type
error: 1 errors parsing expression
(lldb) po NSStringFromCGRect((CGRect)[self frame])
error: 'NSStringFromCGRect' has unknown return type; cast the call to its declared return type
error: 1 errors parsing expression
(lldb) po (NSString *)NSStringFromCGRect((CGRect)[self frame])

Hagar Cohen: Fairfax has been forced to defend its newspaper fortress on multiple fronts. There was Google, online car sales, real estate, Facebook and YouTube. In 2004, the board asked online media proprietor and former Fairfax editor, Eric Beecher, for advice. He was taken aback by the attitude of the board.

Eric Beecher: I outlined to the Fairfax board what I described as a catastrophe scenario, which involved losing a decent chunk of their classified advertising, predominantly in the Sydney Morning Heraldand TheAge. And I sketched out how I thought this might happen—I didn’t say it would happen, but I said if this was my company I would ascribe a probability to whether or not this kind of catastrophe scenario could occur and if the probability was 20 per cent, let alone 60 or 80 per cent, then in my view that required them to take immediate action to broaden the base of the company, to become attackers as well as defenders, to really press the alarm button, because the trends were so obvious. And

@NZKoz
NZKoz / go-fuck-yourself.text
Created August 9, 2012 01:07
LLDB is a huge piece of turd
(lldb) p newView.alpha
error: property 'alpha' not found on object of type 'UIView *'
error: 1 errors parsing expression
(lldb) p [newView alpha]
error: no known method '-alpha'; cast the message send to the method's return type
error: 1 errors parsing expression
(lldb) p (CGFloat)[newView alpha]
(CGFloat) $1 = 0
mysql> show create table schema_migrations \G
*************************** 1. row ***************************
Table: schema_migrations
Create Table: CREATE TABLE `schema_migrations` (
`version` varchar(255) NOT NULL,
UNIQUE KEY `unique_schema_migrations` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
@NZKoz
NZKoz / aa_instructions.md
Created May 2, 2012 03:07
Back Up All Your Gmail
  • Install getmail (aptitude install getmail4)
  • Set Up Your Imap Server (tl;dr)
  • getmail
  • ruby date_based_archive.rb ~/Maildir/.Archive