Skip to content

Instantly share code, notes, and snippets.

View mikfreedman's full-sized avatar

Michael Freedman mikfreedman

View GitHub Profile
{
"createdBy": "Redirector v3.5.3",
"createdAt": "2020-05-26T13:11:01.431Z",
"redirects": [
{
"description": "Gcal to o365",
"exampleUrl": "https://calendar.google.com/calendar/r",
"exampleResult": "https://outlook.office.com/calendar/view/workweek",
"error": null,
"includePattern": "http*://calendar.google.com/*",
@mikfreedman
mikfreedman / Zoom Buttons Macros.kmmacros
Last active August 14, 2020 14:17
Keyboard Buttons for Elgato Stream Deck + KeyboardMaestro
<?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">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>607195820.34804296</real>
<key>Macros</key>
@mikfreedman
mikfreedman / Zoom PTT.kmmacros
Created March 25, 2020 14:05
Keyboard Maestro - Global Push to Talk Macro using a random mouse buton
<?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">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>606836837.23022795</real>
<key>Macros</key>
@mikfreedman
mikfreedman / update-dns-ssl.sh
Created December 9, 2019 03:25
Update namecheap Dynamic DNS and SSL for a given domain
#!/bin/bash
export NAMECHEAP_SOURCEIP="`ip -4 addr show eth0 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'`"
export NAMECHEAP_USERNAME=".."
export NAMECHEAP_API_KEY=".."
export NAMECHEAP_DDNS_PASSWORD=".."
export HOSNTAME='..'
export DOMAIN='..'
curl "https://dynamicdns.park-your-domain.com/update?host=$HOSTNAME&domain=$DOMAIN&password=$NAMECHEAP_DDNS_PASSWORD&ip=$NAMECHEAP_SOURCEIP"
@mikfreedman
mikfreedman / temp-fly.rb
Last active September 20, 2017 03:10
Use fly with a temporary flyrc - useful for situations where you absolutely positively want your session to be temporary
#!/usr/bin/env ruby
# -*- mode: ruby -*-
# # vi: set ft=ruby :
require 'tmpdir'
class Input
attr_reader :get_method
@mikfreedman
mikfreedman / rename.rb
Last active January 19, 2017 21:14
rename machine
hostname=ENV['HOSTNAME']
[
"scutil --set ComputerName #{hostname}",
"scutil --set LocalHostName #{hostname}",
"scutil --set HostName #{hostname}",
"hostname #{hostname}",
"diskutil rename / #{hostname}" ].each do |host_cmd|
`#{host_cmd}`
end
@mikfreedman
mikfreedman / run_command_prefix_example.rb
Created March 3, 2012 23:32
run multiple commands, return interleaved output prefixed with hostname
require 'open3'
hosts = %w{ host1 host2 host3 host4 host5 host6 }
commands = []
hosts.each do |host|
handles = Open3.popen2e("echo", "#{host}") #replace with ssh call or whathaveyou
handles << host
handles = [:input, :output, :thread, :host].zip(handles)
commands << Hash[handles]
end