Skip to content

Instantly share code, notes, and snippets.

Avatar
⛩️
Zazen

James Cuzella trinitronx

⛩️
Zazen
View GitHub Profile
@trinitronx
trinitronx / LICENSE
Last active Jul 4, 2020
AX_FEATURE_FLAG M4 Macro for usage with Autoconf
View LICENSE
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
@trinitronx
trinitronx / iterm_open_with
Last active Jun 28, 2020 — forked from sos4nt/iterm_open_with
Semantic history command for iTerm2 and Sublime Text 3. Allows iTerm integration of Command+Click to open a file in default app (if non-text), or Sublime Text with optional line number and column. Detects relative paths based on PWD.
View iterm_open_with
#!/bin/sh
# iterm_open_with - open a URL, file from CWD, full path, or path with linenumber in default app or Sublime Text if text file
# For usage with iTerm2:
# In iTerm's Preferences > Profiles > Default > Advanced > Semantic History,
# choose "Run command..." and enter "/your/path/to/iterm_open_with \5 \1 \2".
# Usage: iterm_open_with $(pwd) filename [linenumber]
# $(pwd) = current working directory (either use `pwd` or $PWD)
# filename = filename to open
# lineno = line number
pwd=$1
@trinitronx
trinitronx / xcode-cli-tools.sh
Last active Jun 24, 2020
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
View xcode-cli-tools.sh
#!/bin/sh
OSX_VERS=$(sw_vers -productVersion | awk -F "." '{print $2}')
# Get Xcode CLI tools
# https://devimages.apple.com.edgekey.net/downloads/xcode/simulators/index-3905972D-B609-49CE-8D06-51ADC78E07BC.dvtdownloadableindex
# https://developer.apple.com/downloads/index.action
TOOLS=clitools.dmg
if [ ! -f "$TOOLS" ]; then
if [ "$OSX_VERS" -eq 7 ]; then
DMGURL=http://devimages.apple.com/downloads/xcode/command_line_tools_for_xcode_os_x_lion_april_2013.dmg
@trinitronx
trinitronx / keybase-verify-signing-key-sig.sh
Last active May 25, 2020
Script to Verify My Software Signing Key & Keybase Identity
View keybase-verify-signing-key-sig.sh
#!/bin/bash
KEYBASE_USERID=trinitronx
GPG_PUBKEY_URL="https://keybase.io/trinitronx/key.asc"
SIGCHAIN_LINK="271330c45423cd997dafdc3f355c9575c0e6213aeb464596a457995ba0ae89110f"
THIS_SCRIPT_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh"
THIS_SCRIPT_KEYBASE_SIGNATURE_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh.keybase.sig.asc"
THIS_SCRIPT_GPG_SIGNATURE_URL="https://gist.github.com/trinitronx/aee110cbdf55e67185dc44272784e694/raw/keybase-verify-signing-key-sig.sh.gpg.sig.asc"
echo "This script requires that curl, gpg2, and jq are installed"
@trinitronx
trinitronx / README.md
Last active Mar 31, 2020
A shell script to install latest Ansible via pip + dependencies
View README.md

omnibus-ansible

This script has moved to: neillturner/omnibus-ansible

This is the original version of the Ansible install script. If you want the latest, please see the above link!

Install latest Ansible via pip + dependencies via a shell script

This file is used to install ansible in test kitchen when you set in the kitchen.yaml file

@trinitronx
trinitronx / Makefile_include_exclude
Last active Nov 25, 2019 — forked from davidlu1001/Makefile_include_exclude
Makefile for Terraform to support include/exclude
View Makefile_include_exclude
# Plan exclude / include targets
# To use: export INCLUDE or EXCLUDE with Extended Grep pattern for targets to match
PLAN_OPTIONS ?=
APPLY_OPTIONS ?=
EXCLUDE ?=
INCLUDE ?=
TERRAFORM ?= terraform
PLAN_FILE ?= current.plan
REPO_NAME ?= terraform
@trinitronx
trinitronx / pip_list_available_package_versions.py
Created Feb 7, 2017
Pip list all versions of a package that are available
View pip_list_available_package_versions.py
import json
import urllib2
from distutils.version import StrictVersion
from distutils.version import LooseVersion
def versions(package_name):
url = "https://pypi.python.org/pypi/%s/json" % (package_name,)
data = json.load(urllib2.urlopen(urllib2.Request(url)))
versions = data["releases"].keys()
try:
@trinitronx
trinitronx / pkgutil --files com.apple.pkg.macOS_SDK_headers_for_macOS_10.14
Last active Sep 30, 2019
macOS Mojave 10.14.6 - Command Line Tools Header Files List
View pkgutil --files com.apple.pkg.macOS_SDK_headers_for_macOS_10.14
System
System/Library
System/Library/Frameworks
System/Library/Frameworks/AGL.framework
System/Library/Frameworks/AGL.framework/Headers
System/Library/Frameworks/AGL.framework/Versions
System/Library/Frameworks/AGL.framework/Versions/A
System/Library/Frameworks/AGL.framework/Versions/A/Headers
System/Library/Frameworks/AGL.framework/Versions/A/Headers/agl.h
System/Library/Frameworks/AGL.framework/Versions/A/Headers/aglContext.h
@trinitronx
trinitronx / start_x11vnc.sh
Last active May 15, 2019
A script to start x11vnc server and retry with magic cookie if a desktop session is not created. This allows one to SSH into a box with only a gdm or login screen but no existing desktop session and start x11vnc to login the first time.
View start_x11vnc.sh
#!/bin/bash
DEFAULT_DISPLAY=:0
X11VNC_DISPLAY="$DEFAULT_DISPLAY"
if [ -x /usr/bin/x11vnc ]; then
[ "$1" == '-nocache' ] && CACHE_FLAG='-noncache' || CACHE_FLAG='-noncache'
[ "$2" == '-guess' ] && GUESS_FLAG='-auth guess' || GUESS_FLAG=''
[ -f /root/.vnc/passwd ] && PASSWORD="/root/.vnc/passwd"
[ -f $HOME/.vnc/passwd ] && PASSWORD="$HOME/.vnc/passwd"
[ ! -z "$PASSWORD" ] && x11vnc -display $X11VNC_DISPLAY -xkb -rfbauth $PASSWORD -rfbport 5900 -shared -forever -nowf -norc -notruecolor -bg $GUESS_FLAG $CACHE_FLAG -noxdamage
@trinitronx
trinitronx / Install_XCode.applescript
Created Aug 15, 2013
Script to automate XCode installation. Tested on OSX 10.8.4 Mountain Lion. I feel like using the UI element hierarchy is quite disgusting, but it works for now...
View Install_XCode.applescript
-- Function to select a menu item
-- We will use this to trigger the search box for the App Store
on do_menu(app_name, menu_name, menu_item)
try
-- bring the target application to the front
tell application app_name
activate
end tell
tell application "System Events"
tell process app_name
You can’t perform that action at this time.