Skip to content

Instantly share code, notes, and snippets.

View lantrix's full-sized avatar
:octocat:
always coding and merging

Ted B lantrix

:octocat:
always coding and merging
View GitHub Profile
@lantrix
lantrix / refresh-music-selection.scpt
Created July 3, 2023 12:00 — forked from Kautenja/refresh-music-selection.scpt
An applescript to refresh the metadata of a selection in the Apple Music application (with progress bar)
tell application "Music"
-- get the selection
set theSongs to selection
end tell
-- setup the progress bar
set theSongCount to length of theSongs
set progress total steps to theSongCount
set progress completed steps to 0
set progress description to "Refreshing Songs..."
@lantrix
lantrix / New-ErrorRecord.ps1
Created June 21, 2019 05:48 — forked from wpsmith/New-ErrorRecord.ps1
PowerShell: Creates an custom ErrorRecord that can be used to report a terminating or non-terminating error.
<#
.Synopsis
Creates an custom ErrorRecord that can be used to report a terminating or non-terminating error.
.Description
Creates an custom ErrorRecord that can be used to report a terminating or non-terminating error.
.Parameter Exception
The Exception that will be associated with the ErrorRecord.
@lantrix
lantrix / dnsupdate.sh
Last active March 1, 2022 18:39 — forked from TonyFNZ/dnsupdate.sh
Script to update Route53 with the current public IP of an instance
#!/bin/bash
hosted_zone_id='Z57Q212345678'
domain_name='server.example.com'
# Abort script on any errors
set -e
# Get new IP address
ip_address=$(curl -s http://169.254.169.254/latest/meta-data/public-ipv4)
function Test-ADCredential {
<#
.SYNOPSIS
This PowerShell function takes a user name and a password as input and will verify if the combination is correct.
The function returns a boolean based on the result.
.PARAMETER Credential
PS Credential Object.
.EXAMPLE
@lantrix
lantrix / Route 53 Updater
Created August 27, 2018 04:39 — forked from hsiboy/Route 53 Updater
BASH Script to keep Route53 updated with your current external IP address
Roll your own dynamic DNS service using Route53
@lantrix
lantrix / Microsoft.PowerShellISE_profile.ps1
Last active August 17, 2017 02:38 — forked from juntalis/Fix-Indentation.ps1
Cheap workaround to allow using tabs for indentation in ISE.
$psISE.Options.ShowOutlining = $true
$psISE.Options.ShowDefaultSnippets = $true
$psISE.Options.ShowIntellisenseInScriptPane = $true
$psISE.Options.ShowIntellisenseInConsolePane = $true
#
Set-Variable -Option AllScope -Name OptionSetter -Value (&{
$ClassName = 'IndentFixer'
$Namespace = 'ISEHijack'
@lantrix
lantrix / setup_winrm.txt
Created August 7, 2017 01:44 — forked from mitchellh/setup_winrm.txt
Packer 0.8 Windows Example on AWS
<powershell>
winrm quickconfig -q
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="300"}'
winrm set winrm/config '@{MaxTimeoutms="1800000"}'
winrm set winrm/config/service '@{AllowUnencrypted="true"}'
winrm set winrm/config/service/auth '@{Basic="true"}'
netsh advfirewall firewall add rule name="WinRM 5985" protocol=TCP dir=in localport=5985 action=allow
netsh advfirewall firewall add rule name="WinRM 5986" protocol=TCP dir=in localport=5986 action=allow
@lantrix
lantrix / purge.sh
Last active September 20, 2016 02:34 — forked from adrienbrault/purge.sh
Script to reduce VM size before packaging for vagrant
#!/bin/bash
# Credits to:
# - http://vstone.eu/reducing-vagrant-box-size/
# - https://github.com/mitchellh/vagrant/issues/343
aptitude -y purge ri
aptitude -y purge installation-report landscape-common wireless-tools wpasupplicant ubuntu-serverguide
aptitude -y purge python-dbus libnl1 python-smartpm python-twisted-core libiw30
aptitude -y purge python-twisted-bin libdbus-glib-1-2 python-pexpect python-pycurl python-serial python-gobject python-pam python-openssl libffi5
@lantrix
lantrix / Makefile
Created June 14, 2016 09:41 — forked from wolfeidau/Makefile
Standard NodeJS make file.
REPORTER = spec
all: jshint test
test:
@NODE_ENV=test ./node_modules/.bin/mocha --recursive --reporter $(REPORTER) --timeout 3000
jshint:
jshint lib examples test index.js