Skip to content

Instantly share code, notes, and snippets.

@Piasy
Piasy / install_ffmpeg.sh
Last active August 11, 2024 13:09
brew install ffmpeg with all options
brew options ffmpeg
brew install ffmpeg \
--with-chromaprint \
--with-fdk-aac \
--with-fontconfig \
--with-freetype \
--with-frei0r \
--with-game-music-emu \
--with-libass \
#!/bin/bash -e
# Setup a Root CA in vault
# Generate and sign an Intermediate cert
#
# Requires:
# * A running vault server already initialzed and unsealed
# * Environment variable VAULT_TOKEN is set
# * vault cli (https://www.vaultproject.io)
# * httpie (https://github.com/jkbrzt/httpie)
@teppeis
teppeis / private.xml
Last active December 8, 2016 12:49
Karabiner settings for Microsoft Remote Desktop
<?xml version="1.0"?>
<root>
<appdef>
<appname>MicrosoftRDC</appname>
<equal>com.microsoft.rdc.mac</equal>
</appdef>
<symbol_map type="KeyCode" name="RDC_VK_HOME" value="0x73"/>
<symbol_map type="KeyCode" name="RDC_VK_END" value="0x77"/>
<item>
<name>Microsoft Remote Desktop App v8.0.14+</name>
@JasonGhent
JasonGhent / pi_qemu.sh
Last active March 24, 2024 14:36
OSX raspberry pi emulation via QEMU. v2 attempt @ https://gist.github.com/JasonGhent/922f38f57c8cb77b10f3
# pulled from http://xecdesign.com/qemu-emulating-raspberry-pi-the-easy-way/
# expanded via http://superuser.com/questions/690060/how-to-enable-network-with-a-raspberry-pi-emulated-on-qemu
# tested with 2015-02-16-raspbian-wheezy.zip on OSX Mavericks
# OSX terminal
brew install qemu
# kernel-qemu is a linux kernel compiled with ARM1176 support.
# learn more here: http://xecdesign.com/compiling-a-kernel/
curl -OL http://xecdesign.com/downloads/linux-qemu/kernel-qemu
curl -o raspbian_latest.zip -L http://downloads.raspberrypi.org/raspbian_latest
#!/bin/sh
# mass deskew scanned files via command line
# - requires: ImageMagick and Deskew Tool
# - see http://galfar.vevb.net/wp/tag/deskew
for d in "$@"; do
file=`basename "$d" .pdf`
cd "`dirname "$d"`"
@pkuczynski
pkuczynski / parse_yaml.sh
Last active September 23, 2024 01:42
Read YAML file from Bash script
#!/bin/sh
parse_yaml() {
local prefix=$2
local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034')
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 |
awk -F$fs '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
### pip install pycrypto
import base64
from Crypto.Cipher import AES
from Crypto import Random
import datetime
import hashlib
import hmac
import json
import os
@Zen-CODE
Zen-CODE / gist:7303176
Created November 4, 2013 14:23
Errors running sudo pip install pyobjc
Camys-MacBook-Pro:clipboard camy$ sudo pip install pyobjc
Downloading/unpacking pyobjc
Running setup.py egg_info for package pyobjc
Downloading/unpacking pyobjc-core==2.5.1 (from pyobjc)
Running setup.py egg_info for package pyobjc-core
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
@onjin
onjin / randomrun.py
Last active December 15, 2015 22:59
Find files recursively using given file extensions and run given command on random 'n' files
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Find files recursively using given file extensions and run given command on random 'n' files:
* python randomrun.py -e mkv,avi,ogm -r vlc -c 4 /some/dir/ # run 4 random moves using vlc
* python randomrun.py -e txt,dat -r cat -c 3 -p /some/dir/ # run cat on 3 random files parallelly
"""
import argparse
import os
import time
import boto
import boto.manage.cmdshell
def launch_instance(ami='ami-7341831a',
instance_type='t1.micro',
key_name='paws',
key_extension='.pem',
key_dir='~/.ssh',