Skip to content

Instantly share code, notes, and snippets.

@btamayo
btamayo / README-Install-Go-Datadog-raspbian-jessie-32bit-armv7l.md
Last active September 21, 2019 23:26
Install Golang 1.10.3 + Datadog Agent v6 on Raspberry Pi 3 (armv7l Debian Jessie)
@oldo
oldo / video-metada-finder.py
Last active March 2, 2023 22:33
A python function utilising `ffprobe` to find any metadata related to a video file. Examples of what it can find include bitrate, fps, codec details, duration and many more. This gist returns the video height and width as an example.
#!/usr/local/bin/python3
import subprocess
import shlex
import json
# function to find the resolution of the input video file
def findVideoMetada(pathToInputVideo):
cmd = "ffprobe -v quiet -print_format json -show_streams"
args = shlex.split(cmd)
args.append(pathToInputVideo)
@stephanetimmermans
stephanetimmermans / ubuntu-compass-ruby
Last active May 16, 2024 03:29
Install Compass+Ruby on Ubuntu 14.04
#https://gorails.com/setup/ubuntu/14.04
sudo apt-get update
sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties
sudo apt-get install libgdbm-dev libncurses5-dev automake libtool bison libffi-dev
curl -L https://get.rvm.io | bash -s stable
source ~/.rvm/scripts/rvm
echo "source ~/.rvm/scripts/rvm" >> ~/.bashrc
rvm install 2.1.2
rvm use 2.1.2 --default
@jbdatko
jbdatko / gcm.py
Created November 12, 2013 04:23
Example of pycrypto CCM mode
from Crypto.Cipher import AES
from Crypto.Random import get_random_bytes
hdr = b'To your eyes only'
plaintext = b'Attack at dawn'
key = b'Sixteen byte key'
nonce = get_random_bytes(11)
cipher = AES.new(key, AES.MODE_CCM, nonce)
cipher.update(hdr)
msg = nonce, hdr, cipher.encrypt(plaintext), cipher.digest()