Skip to content

Instantly share code, notes, and snippets.

View greglamb's full-sized avatar

Greg Lamb greglamb

View GitHub Profile
@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 [email protected] remoteinterface
#!/bin/bash
if [ $# != 2 ]
then
echo "remotewireshark.sh [email protected] 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 [email protected] mysqluser mysqlpassword
#!/bin/bash
if [ $# != 3 ]
then
echo "remotemyadmin.sh [email protected] 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 {
@greglamb
greglamb / DbSchemadumpCommand.php
Last active December 27, 2015 22:54
Laravel DbSchemadumpCommand
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Process\Process;
class DbSchemadumpCommand extends Command {