Skip to content

Instantly share code, notes, and snippets.

@Piasy
Piasy / install_ffmpeg.sh
Last active March 16, 2025 19:14
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 \
@codekoala
codekoala / vault_intermediate_ca_setup.sh
Last active January 22, 2025 02:14 — forked from bhouse/vault_intermediate_ca_setup.sh
Setting Up Hashicorp Vault with an intermediate CA based on https://gist.github.com/jefferai/092d2cd728ff66089f17
#!/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 / LICENSE
Last active March 14, 2025 14:12
Read YAML file from Bash script
MIT License
Copyright (c) 2014 Piotr Kuczynski
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWAR
### 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',