Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View atenni's full-sized avatar
🤷‍♂️

Andrew Tennikoff atenni

🤷‍♂️
  • Sydney, Australia
  • 00:49 (UTC +10:00)
View GitHub Profile
@atenni
atenni / README.md
Created September 11, 2023 05:15 — forked from robertpainsi/README.md
How to reopen a pull-request after a force-push?

How to reopen a pull-request after a force-push?

Precodinitions

  • You need the rights to reopen pull requests on the repository.
  • The pull request hasn't been merged, just closed.

Instructions

  1. Write down the current commit hash of your PR-branch git log --oneline -1 <PR-BRANCH>
  2. Write down the latest commit hash on github before the PR has been closed.
  3. git push -f origin :
@atenni
atenni / Feedback.md
Last active August 15, 2020 16:40
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 Updated-PythonPractice.py

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

FILENAME = ''
hasher = hashlib.sha256()

with open(FILENAME, "rb") as f:
 for byte_block in iter(lambda: f.read(4096),b""):
@atenni
atenni / Bootstrap_RaspberryPi_without_USB_keyboard_mouse.md
Last active February 23, 2023 10:56
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
atenni / Quickstart - PyCharm Docker.md
Last active July 25, 2018 05:31
Quickstart: Docker backed PyCharm project

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
atenni / s3_multipart_upload.py
Created May 27, 2018 11:51 — forked from teasherm/s3_multipart_upload.py
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
atenni / ffmpeg-options.txt
Created April 13, 2016 23:55
Reference: ffmpeg options (because I always forget)
$ 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
atenni / keybase.md
Created March 26, 2016 05:17
Keybase.io public auth

Keybase proof

I hereby claim:

  • I am atenni on github.
  • I am atenni (https://keybase.io/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
atenni / Postgres_SQL_Dump.md
Last active April 26, 2023 16:48
A quick reminder on how to perform a Postgres SQL dump.

Use pg_dump to create a dev copy of a DB

Steps

  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