Skip to content

Instantly share code, notes, and snippets.

@rmanly
rmanly / ip_change_repo.sh
Created January 5, 2019 21:53
change repo for building
#!/bin/bash
# for a munki-discuss thread 2019-01-05
b1() {
echo "Building 1"
/usr/bin/defaults write /l/p/mi sru "http://b1.munki.repo"
}
b2() {
echo "Building 2"
@rmanly
rmanly / get_macOS_primary_IP.bash
Created July 25, 2018 15:50
Prints the first IP address encountered based on network service order
#!/bin/bash
devices=($(networksetup -listnetworkserviceorder | awk -F': ' '/Port/{ gsub(/\)$/,""); print $3 }'))
for iface in "${devices[@]}"; do
if ! ipconfig getifaddr "$iface"; then
continue
else
exit 0
fi
@ECHO OFF
ECHO ----------------------------------------------------------
ECHO Google Drive FS - Silent Change Mountpoint Utility v0.0001
ECHO ----------------------------------------------------------
REM Scripted: Marc Vandael - 25/01/2018
REM Change the var _mountpoint to whatever driveletter you would like.
REM If the letter is in use, the next free one will be used.
REM This attempts to write to HKLM & HKCU so admin rights are needed for this to work.
@rmanly
rmanly / Makefile_Fonts
Created September 14, 2016 16:00
Makefile for grabbing font files-does not handle spaces-but apparently make doesn't do that well in general
USE_PKGBUILD=1
include /usr/local/share/luggage/luggage.make
TITLE=missing_fonts
PACKAGE_VERSION=0.1
REVERSE_DOMAIN=org.glenbrook225.NA142
fonts=$(wildcard *tf)
PAYLOAD=$(foreach font,$(fonts),pack-Library-Fonts-$(font))
@rmanly
rmanly / civ_crack_with_virus.txt
Created April 8, 2016 15:13
osxcollector related files filter output
vagrant@osxcollector:~/osxcollector_output_filters$ python -m osxcollector.output_filters.related_files -i ../osxcollect-2016_04_05-15_13_25/osxcollect-2016_04_05-15_13_25.json -f '/Users/XXXXXXX/Downloads/Sid.Meiers.Civilization.V.Brav.dmg' | jq 'select(has("osxcollector_related")) | select(.osxcollector_related | keys[] | contains("files"))'
{
"sha2": "8b83c8167cfcd88aad8512935bac48fdb5d2b4f75b50b7815b11507af17cf1cf",
"sha1": "b8d83b3c30edaf80b1d4e13d76aca617c666d6c1",
"extra_data_check": "",
"ctime": "2016-03-23 10:03:18",
"xattr-quarantines": [
"0001;56f2b036;Google Chrome;A68AB9B8-5686-419A-A967-AA163B538AEA"
],
"osxcollector_section": "downloads",
@rmanly
rmanly / Vagrantfile
Created April 8, 2016 14:16
Vagrantfile for working with osxcollector_output_filters in Wily
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/wily64"
config.vm.hostname = "osxcollector"
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
@rmanly
rmanly / livestreammonitor.py
Last active February 18, 2016 18:11 — forked from sinkers/livestreammonitor.py
Script for live video streaming monitoring with notifications
#!/usr/bin/python
'''
Script to monitor live streams and send an Amazon SNS if the stream is down (and possibly take restorative action)
Future:
Black detect: ffmpeg -i out.mp4 -vf blackdetect -f null -
Note the following doesn't seem to fully work without looking at the debug logs
On live ffmpeg -y -i rtmp://cp30129.live.edgefcs.net/live/videoops-videoops@50541 -vf blackdetect -t 10 -loglevel debug -f null -
'''
@rmanly
rmanly / convert_icon.py
Created February 8, 2016 17:15
convert icons using munkilib
#!/usr/bin/python
import os
import sys
sys.path.append('/usr/local/munki/munkilib')
from iconutils import convertIconToPNG
icon_in = sys.argv[1]
@rmanly
rmanly / git_init_dirs.bash
Last active September 24, 2015 16:02
inits a bunch of directories as new git repos
while read -r -d $'\0' dir; do
builtin cd "$dir"
git init
builtin cd $HOME/src/my
done< <(find . -type d -depth 1 -print0)
@rmanly
rmanly / loginhook_jostens.bash
Created September 24, 2015 15:05
Jostens plugins permissions loginhook - deprecated
#!/bin/bash
/bin/chmod go+w "/Applications/Adobe InDesign CS6/Plug-Ins"
/bin/chmod go+w "/Applications/Adobe InDesign CS6/Scripts"
/bin/chmod go+w /Applications/Jostens/YearTech
/bin/chmod go+w "/Applications/Adobe InDesign CS6/Presets/Swatch Libraries"
/bin/chmod 1777 /Library/Fonts
/usr/sbin/chown -R "$1" "/Applications/Adobe InDesign CS6/Plug-Ins/Jostens"
/usr/sbin/chown -R "$1" /Applications/Jostens