Skip to content

Instantly share code, notes, and snippets.

View unabridgedxcrpt's full-sized avatar

Jonathan Bird unabridgedxcrpt

View GitHub Profile
@unabridgedxcrpt
unabridgedxcrpt / Uninstall-pkg.md
Created December 16, 2022 21:02 — forked from githubutilities/Uninstall-pkg.md
Uninstall pkg manually in OS X

Mac Uninstall pkg Manually

  • using pkgutil
# list all your installed packages
pkgutil --pkgs

# show your package info
pkgutil --pkg-info 
@unabridgedxcrpt
unabridgedxcrpt / ffmpeg.md
Last active January 12, 2021 00:20 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@unabridgedxcrpt
unabridgedxcrpt / Count the number of folders below
Created May 1, 2019 16:24
# In a list of files and folders with folders ending with /, count the number of folders below each 3-levels-deep subdirs. Helps determine where things are organized the most.
# find . -type d -exec ls -dF "{}" \; >>filefolderlist.txt
grep "/$" filefolderlist.txt | cut -d/ -f1-3 | sort | uniq -c
# https://twitter.com/climagic/status/1122941154222325766
@unabridgedxcrpt
unabridgedxcrpt / generate_personal_podcast.rb
Created March 1, 2019 17:58
automatically hosting a podcast in your Dropbox public folder
#!/usr/bin/env ruby -wKU
#
# by Kelan Champagne http://yeahrightkeller.com
# with edits by sjschultze
# and advanced metadata handling by lukf
#
# A script to generate a personal podcast feed, hosted on Dropbox
#
# Inspired by http://hints.macworld.com/article.php?story=20100421153627718
#
@unabridgedxcrpt
unabridgedxcrpt / ckroot.sh
Created January 24, 2019 22:32
Check if launched as root (or sudo)
#!/bin/bash
if ((${EUID:-0} || "$(id -u)")); then
echo You are not root.
else
echo Hello, root.
fi
#Also:
# function amIRoot() {
# ! ((${EUID:-0} || "$(id -u)"))
@unabridgedxcrpt
unabridgedxcrpt / jsonval.sh
Created September 14, 2018 22:57 — forked from cjus/jsonval.sh
Extract a JSON value from a BASH script
#!/bin/bash
function jsonval {
temp=`echo $json | sed 's/\\\\\//\//g' | sed 's/[{}]//g' | awk -v k="text" '{n=split($0,a,","); for (i=1; i<=n; i++) print a[i]}' | sed 's/\"\:\"/\|/g' | sed 's/[\,]/ /g' | sed 's/\"//g' | grep -w $prop`
echo ${temp##*|}
}
json=`curl -s -X GET http://twitter.com/users/show/$1.json`
prop='profile_image_url'
picurl=`jsonval`
#!/bin/bash
# ------------------------------------------------------------------
# [Author] Title
# Description
# ------------------------------------------------------------------
set -e
SUBJECT=some-unique-id
#!/bin/bash
# Author: Craig Russell
# Email: [email protected]
# Date: yyyy-mm-dd
# Usage: script.sh [-a|--alpha] [-b=val|--beta=val]
# Description:
#
#
#
<?php
$iter = 500000;
$start = microtime(true);
$n = 0;
for ($c=0; $c<7*$iter; $c++) {
$i = $c % 16;
if ($i===0) $n += 0;
@unabridgedxcrpt
unabridgedxcrpt / sample_get_canvas_grades.py
Created June 15, 2018 18:24 — forked from jbdammeier/sample_get_canvas_grades.py
This is a sample Python program demonstrating how to use the Canvas API to pull a list of active courses with total score information. Produces CSV with Percent & Letter Grade.
import requests, json
from pprint import pprint
from urllib.request import Request, urlopen
import csv
import os
import timeit
def getInput(file):
'''Opens the file, produces list of lines in the file, removes the header row, and returns the list'''
inFile = open(file)