Skip to content

Instantly share code, notes, and snippets.

View thcipriani's full-sized avatar

Tyler Cipriani thcipriani

View GitHub Profile
@thcipriani
thcipriani / archive-org-m3u.py
Created March 28, 2016 18:20
Create m3u files from Archive.org search results
#!/usr/bin/env python2
# coding: utf-8
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@thcipriani
thcipriani / git-object-parser.py
Last active March 23, 2016 04:04
A Dumb Git Object Parser.
#!/usr/bin/env python
#
# git-obj-parser.py
# ~~~~~~~~~~~~~~~~~
# Run from a git work dir, creates a list of all objects with their
# contents in a format like:
#
# > BLOB 1b9f426a8407ffee551ad2993c5d7d3780296353
# -----------------------------------------------
# > TREE 098e6de29daf4e55f83406b49f5768df9bc7d624
@thcipriani
thcipriani / umask.py
Created March 15, 2016 16:06
Dumb umask calculator
"""
umask.py - a dumb script that demonstrates how umask(2) works
"""
def umask(default, mask):
"""A umask is the bitwise conjunction of default permissions
<default> and the bitwise negation of file-creation mode mask <mask>"""
new = []
for d, m in zip(default, mask):
new.append(str(int(d) & ~int(m)))
@thcipriani
thcipriani / sycthing-on-synology-ds215j.org
Last active July 1, 2021 17:45
Syncthing on Synology DS215j

Syncthing on Synology DS215j

Grab Syncthing Binary and upload to DS215j

Follow instructions on the Syncthing Security Page to download and verify release

  1. Get the latest Syncthing release from their Releases Page
curl -sLO https://github.com/syncthing/syncthing/releases/download/v0.12.19/sha256sum.txt.asc
curl -sLO https://github.com/syncthing/syncthing/releases/download/v0.12.19/syncthing-linux-arm-v0.12.19.tar.gz
@thcipriani
thcipriani / gifify-focal-length.sh
Created February 20, 2016 19:06
Create a gif of jpg images, annotated with their focal length
#!/usr/bin/env bash
#
# Gifify Focal Length
# ----
# 1. Grab focal length info
# 2. Convert input files to 1280 width jpg
# 3. Annotate jpg with focal length info
# 4. Compile jpg images into gif
# 5. Cleanup jpg images
#
@thcipriani
thcipriani / beaglebone.org
Last active October 24, 2015 16:46
Beaglebone Setup

Beaglebone Black Setup from a Debian 8 laptop

Grab the debian image from http://beagleboard.org

  1. Download Debian image [whatever].img.xz to your laptop
  2. unxz bone-debian-7.8-lxde-4gb-armhf-2015-03-01-4gb.img.xz
  3. Insert microSD card and make sure that it is unmounted
@thcipriani
thcipriani / BangOpen.vim
Created October 1, 2015 19:22
Open the output of a command as a file in a new tab: i.e. :BangOpen which git-new-workdir
" BangOpen ------------------------------------------------------------ {{{
function! BangOpen(arg)
execute 'tabe ' . system(a:arg)
endfunction
command! -nargs=1 BangOpen :call BangOpen(<f-args>)
" }}}
@thcipriani
thcipriani / 1.1.py
Created January 13, 2015 00:20
the matasano crypto challenges
#!/usr/bin/env python
def hex_to_base64(thing):
return thing.decode('hex').encode('base64')
print hex_to_base64('49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d')
@thcipriani
thcipriani / keybase.md
Created January 8, 2015 23:35
keybase.md

Keybase proof

I hereby claim:

  • I am thcipriani on github.
  • I am thcipriani (https://keybase.io/thcipriani) on keybase.
  • I have a public key whose fingerprint is 6237 D8D3 ECC1 AE91 8729 296F F6DA D285 018F AC02

To claim this, I am signing this object: