Skip to content

Instantly share code, notes, and snippets.

View greglamb's full-sized avatar

Greg Lamb greglamb

View GitHub Profile
@greglamb
greglamb / google-domains-dynamic-dns-update.sh
Created April 15, 2023 21:26 — forked from cyrusboadway/google-domains-dynamic-dns-update.sh
Script to update a Google Domains DNS record
#!/bin/bash
### Google Domains provides an API to update a DNS "Syntheitc record". This script
### updates a record with the script-runner's public IP, as resolved using a DNS
### lookup.
###
### Google Dynamic DNS: https://support.google.com/domains/answer/6147083
### Synthetic Records: https://support.google.com/domains/answer/6069273
USERNAME=""
Link to Latest Teams Download
https://github.com/ItzLevvie/MicrosoftTeams-msinternal/issues/6
https://raw.githubusercontent.com/ItzLevvie/MicrosoftTeams-msinternal/master/defconfig2
URLs for the latest Public Developer Preview (R3.6 or P) build of Microsoft Teams:
Ring 0 Canary
Ring 1 Teams
Ring 1.5 IT Admins Preview (Beta)
@greglamb
greglamb / vsCodeOpenFolder.reg
Created July 10, 2020 18:23
Right click on Windows folder and open with Visual Studio Code
Windows Registry Editor Version 5.00
; Open files
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code]
@="Edit with VS Code"
"Icon"="C:\\Users\\GLamb\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe,0"
[HKEY_CLASSES_ROOT\*\shell\Open with VS Code\command]
@="\"C:\\Users\\GLamb\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe\" \"%1\""
@greglamb
greglamb / Installation.md
Created July 1, 2020 17:10 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Requirements

  • Mac OSX 10+
  • Administrator privileges
@greglamb
greglamb / twittermute.txt
Created January 24, 2020 23:48 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@greglamb
greglamb / connect-bluetooth.applescript
Created September 22, 2018 04:49
Connect to Bluetooth devices via the Terminal
#!/usr/bin/osascript
(*
Usage:
./connect-bluetooth.applescript listall
./connect-bluetooth.applescript "Greg’s AirPods"
*)
@greglamb
greglamb / remotewireshark.sh
Created August 16, 2018 20:38
remotewireshark.sh sshuser@remotehost.com remoteinterface
#!/bin/bash
if [ $# != 2 ]
then
echo "remotewireshark.sh sshuser@remotehost.com remoteinterface"
exit
fi
wireshark -S -l -k -i <(ssh $1 tcpdump -i $2 -s0 -w - '\(!port 22\)' )
@greglamb
greglamb / remotemyadmin.sh
Last active August 16, 2018 20:37
remotemyadmin.sh sshuser@host.com mysqluser mysqlpassword
#!/bin/bash
if [ $# != 3 ]
then
echo "remotemyadmin.sh sshuser@remotehost.com mysqluser mysqlpassword"
exit
fi
docker pull phpmyadmin/phpmyadmin
docker run --name remotemyadmin -d -e PMA_HOST=docker.for.mac.localhost -e PMA_PORT=13306 -e PMA_USER=$2 -e PMA_PASSWORD=$3 -p 18080:80 phpmyadmin/phpmyadmin
vendor/
node_modules/
npm-debug.log
bootstrap/compiled.php
app/storage/
public/storage
public/hot
storage/*.key
.env.*.php
.env.php