Skip to content

Instantly share code, notes, and snippets.

View mbierman's full-sized avatar

Michael Bierman mbierman

View GitHub Profile
@mbierman
mbierman / clearnotes.sh
Created May 31, 2018 17:22
Clear Notes
#!/usr/bin/env bash
ERROR=$(automator "$HOME/Library/Services/Notifications.workflow" 3>&1 1>&2 2>&3 | tee /dev/stderr)
if [[ $ERROR = *"Cache location entry for /System/Library/CoreServices/Applications/System"* ]]; then
echo "Fixing cache.."
rm "/Users/bierman/Library/Caches/com.apple.automator.actionCache-bundleLocations.plist"
fi
@mbierman
mbierman / arris.sh
Last active December 3, 2018 20:21
#!/usr/bin/env bash
# Configure/Initialize
APIKEY="$(cat ~/Documents/Applications/bin/arrisdata.txt | grep API | cut -f2 -d "=" )"
USER="$(cat ~/Documents/Applications/bin/arrisdata.txt | grep USER | cut -f2 -d "=" )"
PASS="$(cat ~/Documents/Applications/bin/arrisdata.txt | grep PASS | cut -f2 -d "=" )"
tries=1
SECONDS=0
run="null"
@mbierman
mbierman / ArrisReboot.js
Last active October 19, 2020 05:09
A puppeteer script to reboot an Arris modem
/*
* @name Reboot Arris modem.
*
* @desc Puppeteer script for rebooting an Arris modem.
* since the specific navigation for your modem will vary, this
* is more of an example and isn't guaranteed to work for your particular
* modem.
* Many thanks to https://stackoverflow.com/users/6870228/keith for his help!
*
*/
@mbierman
mbierman / DirectoryClean.gs
Last active March 19, 2018 16:46
This looks at an arbitrary directory, looks for any folders inside that directory, and recursively looks for files older than 'Days'. I use this to clean out a directory of security camera video.
/*
Version 1.0.1
Updated 03/19/2018
This looks at an arbitrary directory, looks for any folders inside that directory, and recursively looks for files older than 'Days'.
I use this to clean out a directory of security camera video.
To configure, set the folderID and the Days.
Michael Bierman
@mbierman
mbierman / Find and Replace.scpt
Last active August 11, 2018 16:30
Ever want a 'Find and Replace' for Evernote? Here's an Aplescript for doing that on a Mac
(*
Find and replace based on
Evernote Note Folder
Version 1.02
2018/03/15
SCRIPT INFORMATION
Retrieves the note's Mac folder from the database
my closeNotif()
on closeNotif()
global activeApp
tell application "System Events"
set activeApp to name of first application process whose frontmost is true
-- set theDialogText to "The curent app is " & (activeApp)
-- display dialog theDialogText
@mbierman
mbierman / Send to Evernote.workflow
Created February 28, 2018 20:18
Auto upload to Evernote
on run {input, parameters}
tell application "/Applications/Evernote.app" to run
repeat with this_item in the input
set the item_info to info for this_item
tell application id "com.evernote.evernote"
activate
create note from file this_item
end tell
@mbierman
mbierman / Archive Google Voice Voicemail.scpt
Created November 15, 2017 20:12
Archive Google Voice voicemail
tell application "Safari"
activate
tell window 1
set current tab to (make new tab with properties {URL:"https://voice.google.com/voicemail"})
delay 2
repeat with n from 0 to 99
repeat with n from 0 to 10
tell application "System Events"
@mbierman
mbierman / UpdateChangeIP.sh
Last active April 7, 2020 01:46
Updates IP for changeip.com's DDNS service
#!/bin/bash
###############################################################
## ChangeIP.com bash update script
###############################################################
## Written 3/18/09 by Tom Rinker, released to the Public Domain
## Re-write 09/15/2017 by Michael Bierman
## I replaced wget with curl so it can work on all macs.
###############################################################
## This is a simple bash script to preform a dDNS update with
@mbierman
mbierman / Fade iTunes.workflow
Last active October 14, 2016 18:51
AppleScript to fade audio , pause music, and restore volume
set input to text returned of (display dialog "How many minutes should I play music for?" default answer "90")
delay input * 60
--- fade volume
tell application "iTunes"
set currentvolume to the sound volume
repeat with i from currentvolume to 0 by -2
set the sound volume to i
delay 0.5
end repeat