Skip to content

Instantly share code, notes, and snippets.

🌞
DO YOU EVEN ADHERE BRO

Naftuli Kay naftulikay

🌞
DO YOU EVEN ADHERE BRO
View GitHub Profile
@naftulikay
naftulikay / pom.xml
Created Nov 30, 2011
Maven + FlexMojos Starter POM
View pom.xml
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.tkassembled.flexmojos</groupId>
<artifactId>flexmojos-starter</artifactId>
<version>0.0.1-SNAPSHOT</version>
@naftulikay
naftulikay / ManualVideoCompile.java
Created Jun 27, 2012
Generate a video from scratch with Xuggler
View ManualVideoCompile.java
package org.tkassembled.xuggle;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.io.File;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@naftulikay
naftulikay / pulseaudio-switch.py
Created May 10, 2013
A quick and dirty script to transfer all PulseAudio streams between two sinks.
View pulseaudio-switch.py
#!/usr/bin/env python
from argparse import ArgumentParser
import json, os, re, subprocess
def main():
parser = ArgumentParser()
args = parser.parse_args()
@naftulikay
naftulikay / gottasignemall.sh
Last active Aug 29, 2015
Create Signatures and Checksums for Multiple Files at Once
View gottasignemall.sh
#!/bin/bash
# needs: apt-get install gnupg parallel
# for mybackup.tar.gz.aa, mybackup.tar.gz.ab, etc.
find . -maxdepth 1 -type f -iname "mybackup.tar.gz.??" | parallel --gnu \
-j 8 --workdir "$PWD" '
gpg --armor --detach-sig "{}" ;
echo -n "$(shasum "{}" | cut -b 1-40)" > "{}.sha" ;
echo -n "$(md5sum "{}" | cut -b 1-32)" > "{}.md5" ;
@naftulikay
naftulikay / makeqrs.py
Created Apr 30, 2014
Create QR Codes from a Google Authenticator SQLite Database
View makeqrs.py
#!/usr/bin/env python2.7
import argparse
import os
import qrcode
import qrcode.image.pil
import sqlite3
import sys
import urllib
@naftulikay
naftulikay / bitly_shortener.py
Created May 13, 2014
AutoKey Bit.ly Link Shortener
View bitly_shortener.py
# Bit.ly URL Shortener for AutoKey
#
# On Ubuntu, you must run:
#
# sudo apt-get install xclip python-pip
#
# and
#
# sudo pip install requests
@naftulikay
naftulikay / generate_jira_label.sh
Created May 13, 2014
Generate JIRA Ticket Labels
View generate_jira_label.sh
#!/bin/bash
function generate-jira-label() {
# Generates a 256 square label, given a JIRA name matching the following pattern:
# (\w+)-(\d+)
# ie: AA-1234, JV-511
if [ -z "$1" ]; then
echo "Please provide a JIRA number like AA-1234 as the first argument." >&2
exit 1
@naftulikay
naftulikay / genkeys.sh
Created Jun 3, 2014
PKCS#8 Private Key Encryption Demo
View genkeys.sh
#!/bin/bash
# Generates 2048 and 4096 bit SSH private keys, then encrypts them in the following
# variations:
#
# Ciphers:
# * aes-192-cbc
# * aes-256-cbc
#
# PBKDF2 Iterations:
@naftulikay
naftulikay / img-clean
Last active Aug 29, 2015
Image Metadata Cleaner
View img-clean
#!/bin/bash
# img-clean: remove ALL metadata from images
# requires ImageMagick
# A POSIX variable
OPTIND=1 # is reset in case getopts was already run
verbose=0
backup=0
@naftulikay
naftulikay / multiline-variables.sh
Last active Aug 29, 2015
Multiline Embedded Bash Variables
View multiline-variables.sh
#!/bin/bash
# This is terribly annoying to remember, but here's how you do multiline
# variables in Bash.
read -d '' suchvariable <<EOF
usage: do this thing
preserves linebreak
wow such things
You can’t perform that action at this time.