Skip to content

Instantly share code, notes, and snippets.

View unabridgedxcrpt's full-sized avatar

Jonathan Bird unabridgedxcrpt

View GitHub Profile
@unabridgedxcrpt
unabridgedxcrpt / macOS-in-virtualbox.md
Created May 15, 2018 19:27 — forked from mcandre/macOS-in-virtualbox.md
Notes on getting macOS Sierra running in Virtualbox on a Windows 10 host

On Mac

Download, but don't run, the Sierra installer from the Mac App Store. This places the installer at /Applications/Install\ macOS\ Sierra.app/.

Now run the following commands to build a suitable VM image from the installer:

git clone https://github.com/jonanh/osx-vm-templates
cd osx-vm-templates/packer

sudo ../prepare_iso/prepare_vdi.sh -D DISABLE_REMOTE_MANAGEMENT -o macOS_10.12.vdi /Applications/Install\ macOS\ Sierra.app/ .

#This is my .inputrc file for bash (so far only used on MacOS X systems).
set completion-ignore-case On
set expand-tilde on
set show-all-if-ambiguous on
set visible-stats on
set bell-style visible
Stored for reference. Base64 encoding of images.
https://stackoverflow.com/questions/16918602/how-to-base64-encode-image-in-linux-bash-shell/16918665
Mac OS terminal modification: base64 -i <in-file>
Usage: base64 [-hvD] [-b num] [-i in_file] [-o out_file]
-h, --help display this message
-D, --decode decodes input
-b, --break break encoded string into num character lines
-i, --input input file (default: "-" for stdin)
-o, --output output file (default: "-" for stdout)
@unabridgedxcrpt
unabridgedxcrpt / urlsafari
Last active January 26, 2018 00:48 — forked from kshiteesh/urlsafari
This AppleScript saves all the tabs open in all Safari windows to a Markdown file.
(*
Export All Safari Tabs in All Open Windows to a Markdown File
2018-01-25
// SCRIPT PAGE
https://gist.github.com/unabridgedxcrpt/3f35aa5aec81289368858e2ba6009451
// ORIGINAL SCRIPT PAGE
http://hegde.me/urlsafari KSHITEESH ON GIST.GITHUB.COM
@unabridgedxcrpt
unabridgedxcrpt / sed cheatsheet
Last active December 9, 2017 06:11 — forked from un33k/sed cheatsheet
magic of sed -- find and replace "text" in a string or a file
FILE SPACING:
# double space a file
sed G
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
sed '/^$/d;G'
@unabridgedxcrpt
unabridgedxcrpt / BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
Last active June 28, 2019 21:27 — forked from ccstone/BBEdit-TextWrangler_RegEx_Cheat_Sheet.txt
BBEdit-TextWrangler Regular Expression Cheat-Sheet
————————————————————————————————————————————————————————————————————————————————————————————————————
BBEdit / BBEdit-Lite / TextWrangler Regular Expression Guide Modified: 2018/08/10 01:19
————————————————————————————————————————————————————————————————————————————————————————————————————
NOTES:
The PCRE engine (Perl Compatible Regular Expressions) is what BBEdit and TextWrangler use.
Items I'm unsure of are marked '# PCRE?'. The list while fairly comprehensive is not complete.
@unabridgedxcrpt
unabridgedxcrpt / xfer-wowza-logs.sh
Last active February 1, 2018 19:21 — forked from tingletech/gist:3995384
calculate transfer out from wowza logs
# To calculate the bandwidth usage per session, subtract sc-bytes in the “connect” event by sc-bytes in the “disconnect” event
connect=`grep $'\tconnect' wowzastreamingengine_access.log.????-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
disconnect=`grep $'\tdisconnect' wowzastreamingengine_access.log.????-??-?? | cut -f22 | awk '{total = total + $1}END{print total}' `
SESSION=`expr $connect - $disconnect`
echo -e "Bandwidth usage per session, subtract sc-bytes in the *connect* event by sc-bytes in the *disconnect* event\n"
echo -e " $SESSION bytes"
# To calculate the bandwidth usage per stream, subtract sc-stream-bytes in the “play” event from sc-stream-bytes in the “stop” event.
play=`grep $'\tplay' wowzastreamingengine_access.log.????-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
stops=`grep $'\tstop' wowzastreamingengine_access.log.????-??-?? | cut -f27 | awk '{total = total + $1}END{print total}' `
#!/bin/bash
# Written by Alexis Bezverkhyy <alexis@grapsus.net> in 2011
# This is free and unencumbered software released into the public domain.
# For more information, please refer to <http://unlicense.org/>
#
# Found at: http://grapsus.net/blog/post/A-script-for-splitting-videos-using-ffmpeg
# Here is a small bash script for automatically cutting a video file into smaller chunks of fixed length. ffmpeg cannot output multiple files, but it has start offset and duration parameters which my script uses to actually split the file.
# For example, if we have a video called 'video.mpeg' which is 3000 seconds long and we run
@unabridgedxcrpt
unabridgedxcrpt / Batch conversion script
Last active February 11, 2016 20:54 — forked from steventrux/Chromecast batch conversion script
A bash script to batch convert video files for chromecast compatibility
#! /bin/bash
# Batch Convert Script by StevenTrux
# The Purpose of this Script is to batch convert any video file to mp4 or mkv format for chromecast compatibility
# this script only convert necessary tracks if the video is already
# in H.264 format it won't convert it saving your time!
# Put all video files need to be converted in a folder!
# the name of files must not have " " Space!
# Rename the File if contain space
@unabridgedxcrpt
unabridgedxcrpt / WP from Dev to Prod
Last active January 25, 2016 17:53 — forked from matiasmasca/WP de desarrollo a producción
Move WordPress site from Development to Production
-- Script to migrate WordPress database from development to production. Thanks Sergio A. Moreyra.
UPDATE wp_options
SET option_value = replace(option_value,'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com')
WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts
SET guid = REPLACE (guid, 'http://www.TuSitio.com/desarrollo', 'http://www.TuSitio.com/');
UPDATE wp_posts