Skip to content

Instantly share code, notes, and snippets.

View greglamb's full-sized avatar

Greg Lamb greglamb

View GitHub Profile
@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
#!/bin/bash
systemctl stop mysqld
/usr/sbin/mysqld --skip-grant-tables --user=mysql &
sleep 10
echo "update mysql.user set authentication_string=password('') where user='root';" | mysql
echo "FLUSH PRIVILEGES;" | mysql
### Keybase proof
I hereby claim:
* I am greglamb on github.
* I am greglamb (https://keybase.io/greglamb) on keybase.
* I have a public key whose fingerprint is 47D5 247F E3F7 BE8D 5C78 3E6F 1761 0EBD C592 9642
To claim this, I am signing this object:
@greglamb
greglamb / DbImportCommand.php
Created February 11, 2014 21:19
Laravel DbImportCommand
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Process\Process;
class DbImportCommand extends Command {
@greglamb
greglamb / DbTabledumpCommand.php
Created February 11, 2014 21:18
Laravel DbTabledumpCommand
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Process\Process;
class DbTabledumpCommand extends Command {