Skip to content

Instantly share code, notes, and snippets.


Andrew Tennikoff atenni

  • Malalta
  • Sydney, Australia
View GitHub Profile
atenni /
Last active Aug 15, 2020
Code review for colleague

Overall this is pretty impressive for someone just starting out - well done!

Here's a few overall design comments. I'll include technical feedback as comments directly in

DRY Principle - Don't Repeat Yourself.

When coding you don't want to write the same piece of functionality twice. In longer programs this type of duplication makes it hard to follow the flow of the


Recipe: calculate SHA256 hash of file in Python

import hashlib

hasher = hashlib.sha256()

with open(FILENAME, "rb") as f:
    for byte_block in iter(lambda:,b""):
atenni /
Last active Nov 1, 2019
Steps to bootstrap a Raspberry Pi (3) without a USB keyboard or mouse, and a WiFi connection only.

Bootstrap Raspberry Pi without a USB keyboard or mouse (2019)

Assumes you have a laptop, WiFi only (no LAN), and a HDMI monitor you can use with the Pi.

Credit: most of this info was found here.

Add OS image to SD card

  1. Download the latest image of Raspbian.
atenni / Quickstart - PyCharm
Last active Jul 25, 2018
Quickstart: Docker backed PyCharm project
View Quickstart - PyCharm

Docker backed Python project using PyCharm

This quickstart assumes OS X 10.13, PyCharm 2018.1, Docker 18.03, and Python 3.7.

  1. Start Docker and PyCharm
  2. Create new project - "Pure Python"
  3. Set project name and temporarily set the project interpreter to Existing interpreter > Python 3.x (local)
  4. Create Dockerfile and/or docker-compose.yml (see samples of each below),
atenni /
Created May 27, 2018 — forked from teasherm/
boto3 S3 Multipart Upload
import argparse
import os
import boto3
class S3MultipartUpload(object):
# AWS throws EntityTooSmall error for parts smaller than 5 MB
PART_MINIMUM = int(5e6)

How to convert raw Echo360 Personal Capture file with ffmpeg

When Echo360 Personal Capture is set to record video and display, the output file is a container containing both video streams (at least on Windows 7). If you want to edit this footage in third party software before uploading it into Echo you'll probably need to seperate these video streams. Using ffmpeg is one way to do this.

Quick start

ffmpeg -i audiovideodisplay.wmv \
atenni / ffmpeg-options.txt
Created Apr 13, 2016
Reference: ffmpeg options (because I always forget)
View ffmpeg-options.txt
$ ffmpeg --help
ffmpeg version N-78304-g37db3e8 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfi
g --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --
enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libm
p3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --en
able-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --ena
ble-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-lib
atenni /
Created Mar 26, 2016 public auth

Keybase proof

I hereby claim:

  • I am atenni on github.
  • I am atenni ( on keybase.
  • I have a public key whose fingerprint is 5354 0DBA 6CB6 0CFB 4BFD 21ED 2CC2 BDDA EA0E 29B8

To claim this, I am signing this object:

atenni /
Last active Nov 28, 2020
A quick reminder on how to perform a Postgres SQL dump.

Use pg_dump to create a dev copy of a DB


  1. Perform pg_dump -> gzip output -> save

    • pg_dump DB_NAME --username=DB_USER | gzip > /location/to/backup.gz
    • Note: if you get "FATAL: Ident authentication failed..." you'll need to look in pg_hba.conf. See below for more info.
  2. Unzip -> import into new database

atenni / GetResults.xml
Last active Mar 3, 2016
Anonymised example of Formsite's GetResults. Includes headers [fs_include_headings=true], limit to two responses [fs_limit=2]. Docs:
View GetResults.xml
<?xml version="1.0" encoding="UTF-8"?>
<fs_response status="success" timestamp="2016-01-30 13:03:29">
<heading for="result_status">Result Status</heading>
<heading for="login_username">Login Username</heading>
<heading for="login_email">Login Email</heading>
<heading for="date_start">Start Time</heading>
<heading for="date_finish">Finish Time</heading>
<heading for="date_update">Update Time</heading>
<heading for="user_ip">User's IP Address</heading>