Skip to content

Instantly share code, notes, and snippets.

View MacsInSpace's full-sized avatar

Craig Hair MacsInSpace

  • Department of Education
  • Melbourne
  • 12:08 (UTC +10:00)
View GitHub Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadContent</key>
<array>
<dict>
<key>FullScreen</key>
<true/>
<key>Icon</key>
@MacsInSpace
MacsInSpace / detectOS.cmd
Last active December 5, 2023 08:51
Detect OS and Architecture cross platform testing
#!/usr/bin/env bash
@echo off
goto(){
function checkOS() {
unameOut="$(uname -s)"
case "${unameOut}" in
*Microsoft*) OS="WSL";; #must be first since Windows subsystem for linux will have Linux in the name too
*microsoft*) OS="WSL2";;
@MacsInSpace
MacsInSpace / install-homebrew-osx.sh
Created October 22, 2021 00:52 — forked from abn/install-homebrew-osx.sh
Install homebrew from behind a proxy on Mac OS X.
#!/usr/bin/env bash
# Based on: http://godlessheathenmemoirs.blogspot.com.au/2015/03/homebrew-aka-brew-on-mac-os-x-behind.html
function usage() {
echo 2>&1 ""
echo 2>&1 "usage: $(basename $0) PROXY_HOST PROXY_PORT"
exit 1
}
PROXY_HOST=${PROXY_HOST:-$1}
@MacsInSpace
MacsInSpace / playwme.sh
Last active July 20, 2021 01:02
Monitors Last.fm and plays last.fm "now playing" track on spotify-tui spt with spotifyd
#!/usr/bin/env zsh
# now playing
# requires the last.fm API key
export API_KEY="fghjfghfghfghfghjfghjfjgh"
# requires LastFM user to follow
USER="hairball1975"
URL="http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks"
URL+="&user=$USER&api_key=$API_KEY&format=json&limit=1&nowplaying=true"
@MacsInSpace
MacsInSpace / xcode-cli-tools.sh
Last active June 17, 2020 05:27 — forked from trinitronx/xcode-cli-tools.sh
Script to download & install XCode Command Line tools on OSX 10.7 or 10.8. Lifted from jedi4ever/veewee template.
#!/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
@MacsInSpace
MacsInSpace / install-xcode-cli-tools.sh
Last active June 29, 2023 04:59 — forked from mokagio/install-xcode-cli-tools.sh
Install Xcode CLI Tools without GUI
#!/bin/bash
# See http://apple.stackexchange.com/questions/107307/how-can-i-install-the-command-line-tools-completely-from-the-command-line
echo "Checking Xcode CLI tools"
# Only run if the tools are not installed yet
# To check that try to print the SDK path
xcode-select -p &> /dev/null
if [ $? -ne 0 ]; then
echo "Xcode CLI tools not found. Installing them..."
import tweepy
from tweepy import API
auth = tweepy.OAuthHandler("CONSUMER_KEY", "CONSUMER_SECRET")
auth.set_access_token("ACCESS_TOKEN", "ACCESS_TOKEN_SECRET")
api = tweepy.API(auth, wait_on_rate_limit=True, wait_on_rate_limit_notify=True, compression=True)
path = '/location/for/list/file_with_name_list.txt'
with open(path, 'r') as f:
@MacsInSpace
MacsInSpace / Gist
Last active April 28, 2019 23:39 — forked from jbnunn/Gist
Install Google Chrome from Powershell
$LocalTempDir = $env:TEMP; $ChromeInstaller = "ChromeInstaller.exe"; (new-object System.Net.WebClient).DownloadFile('http://dl.google.com/chrome/install/375.126/chrome_installer.exe', "$LocalTempDir\$ChromeInstaller"); & "$LocalTempDir\$ChromeInstaller" /silent /install; $Process2Monitor = "ChromeInstaller"; Do { $ProcessesFound = Get-Process | ?{$Process2Monitor -contains $_.Name} | Select-Object -ExpandProperty Name; If ($ProcessesFound) { "Still running: $($ProcessesFound -join ', ')" | Write-Host; Start-Sleep -Seconds 2 } else { rm "$LocalTempDir\$ChromeInstaller" -ErrorAction SilentlyContinue -Verbose } } Until (!$ProcessesFound)