Skip to content

Instantly share code, notes, and snippets.

@RogWilco
RogWilco / psd.sh
Last active September 17, 2020 19:27
Get the absolute path of the current script, even when sourced from another script.
##
# Gets the present source directory (PSD) for the current script. Works when
# the script is executed directly or when it is being sourced from another
# script.
#
# @switch -P display the physical present source directory (all symbolic links resolved)
# @switch -L display the logical present source directory
#
# @stdout the absolute path to the script invoking the function
#
@RogWilco
RogWilco / floatsign.sh
Created July 20, 2020 20:10 — forked from WeptunUser/floatsign.sh
Now fix when no entitlements are present.
# !/bin/bash
# Copyright (c) 2011 Float Mobile Learning
# http://www.floatlearning.com/
# Extension Copyright (c) 2013 Weptun Gmbh
# http://www.weptun.de
#
# Extended by Ronan O Ciosoig January 2012
#
# Extended by Patrick Blitz, April 2013
@RogWilco
RogWilco / docker_nuke.sh
Created October 10, 2019 23:50
Docker Nuke -> it's the only way to be sure!
#!/usr/bin/env bash
docker_nuke() {
local COLOR_RED="\033[0;31m"
local COLOR_GREEN="\033[0;32m"
local COLOR_CYAN="\033[0;36m"
local containers="$(docker ps -aq)"
local images="$(docker images -q)"
local success="$COLOR_GREEN✓"
{"$id":"https://github.com/proxyco/api-manage-models/blob/master/etc/Policy.document.schema.json","$schema":"http://json-schema.org/draft-07/schema#","title":"Proxy Authz Policy Document","description":"Defines the structure of the JSON document used to describe an access control policy.","required":["Version","Statement"],"type":"object","definitions":{"identifier":{"type":"string","description":"A Proxy entity identifier, namespaced by colons (i.e. device:4afe819b-31db-47f9-b84d-bee7d746ea23).","pattern":"^([A-Za-z]*:)+[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"},"RFC-5545":{"type":"string","description":"The Proxy-supported subset of RFC-5545 calendar scheduling syntax.","pattern":"^(DTSTART(;TZID=.*)?:[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?)(\\n(RRULE:(FREQ=(SECONDLY|MINUTELY|HOURLY|DAILY|WEEKLY|MONTHLY|YEARLY)|UNTIL=[0-9]{4}(1[0-2]|0[1-9])(3[0-1]|[0-2][1-9])T([01][0-9]|2[0-3])[0-5][0-9][0-5][0-9]Z?|COUNT=[0-9]|INTERVAL=[0-9]|BY
@RogWilco
RogWilco / 0deodex.md
Created June 19, 2018 02:42 — forked from dweinstein/0deodex.md
tools for deodex android--must download the .jar files separately (smali/baksmali: https://bitbucket.org/JesusFreke/smali/downloads | apktool: https://bitbucket.org/iBotPeaches/apktool/downloads)

A few utilities to help with de-odexing.

You'll need to download baksmali/smali/apktool jars and link/rename the jars as appropriate (e.g., apktool.jar, smali.jar, baksmali.jar) in the directory with these scripts.

You can grab the utilities (currently) from bitucket:

const board = [
 [7, 2, 6, 4, 9, 3, 8, 1, 5],
 [3, 1, 5, 7, 2, 8, 9, 4, 6],
 [4, 8, 9, 6, 5, 1, 2, 3, 7],
 [8, 5, 2, 1, 4, 7, 6, 9, 3],
 [6, 7, 3, 9, 8, 5, 1, 2, 4],
 [9, 4, 1, 3, 6, 2, 7, 5, 8],
 [1, 9, 4, 8, 3, 6, 5, 7, 2],
 [5, 6, 7, 2, 1, 4, 3, 8, 9],
 [2, 3, 8, 5, 7, 9, 4, 6, 1],
]
/**
* Checks if the list of values is a valud sudoku combination of numbers.
*
* Constraints:
* - 9 values total
* - Must be integers 1 - 9
@RogWilco
RogWilco / bash.darwin.wifi.channel.sh
Created November 4, 2014 19:41
Bash: Force WiFi Channel
#!/usr/bin/env bash
sudo /System/Library/PrivateFrameworks/Apple80211.framework/Resources/airport --channel=$1
@RogWilco
RogWilco / .bash_profile
Created August 22, 2013 17:48
This alias deletes the current working directory and moves to its immediate parent. This is particular handy for quickly deleting a scratch directory that is no longer needed.
alias fuckit="cd ..; rm -rf ~-"
@RogWilco
RogWilco / kextload.parallels.sh
Created June 21, 2013 18:41
Loads the required OS X kernel extensions for Parallels Desktop. This is specifically useful in the developer preview of OS X 10.9 Mavericks, which for some reason does not seem to automatically load these kernel extensions (which, consequently, will prevent most VMs from successfully booting). Use launchd to have this script run on boot to ensu…
#!/bin/bash
sudo kextload -r "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/" "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/prl_hypervisor.kext"
sudo kextload -r "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/" "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/prl_hid_hook.kext"
sudo kextload -r "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/" "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/prl_usb_connect.kext"
sudo kextload -r "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/" "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/prl_vnic.kext"
sudo kextload -r "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/" "/Applications/Parallels Desktop.app/Contents/Library/Extensions/10.6/prl_netbridge.kext"
@RogWilco
RogWilco / kextload.virtualbox.sh
Created June 21, 2013 18:39
Loads the required OS X kernel extensions for VirtualBox. This is specifically useful in the developer preview of OS X 10.9 Mavericks, which for some reason does not seem to automatically load these kernel extensions (which, consequently, will prevent most VMs from successfully booting). Use launchd to have this script run on boot to ensure they…
#!/bin/bash
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxDrv.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxNetFlt.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxNetAdp.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxUSB.kext"