Skip to content

Instantly share code, notes, and snippets.

View AustinWinstanley's full-sized avatar

AustinWinstanley

View GitHub Profile
git filter-branch --index-filter 'git rm -r --cached --ignore-unmatch <file/dir>' HEAD
@AustinWinstanley
AustinWinstanley / authorize-root.sql
Created April 24, 2017 19:05
Authorize root access outside of sudo #MariaDB
-- Insecure, do not use in production
UPDATE mysql.user SET plugin = 'mysql_native_password' WHERE user = 'root' AND plugin = 'unix_socket';
@AustinWinstanley
AustinWinstanley / install-docker-mint-serena.sh
Created April 19, 2017 16:56
Docker Linux Mint 18 "Serena" #Docker #Mint
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates -y
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo deb https://apt.dockerproject.org/repo ubuntu-xenial main >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-get install linux-image-extra-$(uname -r) -y
sudo apt-get install docker-engine cgroup-lite apparmor -y
sudo usermod -a -G docker $USER
sudo service docker start
@AustinWinstanley
AustinWinstanley / docker-quick-commands.sh
Last active January 19, 2018 00:36
Docker quick commands #Docker
#
# Docker
#
# List dangling volumes
docker volume ls -f dangling=true
# Purge dangling volumes
docker volume rm $(docker volume ls -f dangling=true -q)
@AustinWinstanley
AustinWinstanley / wp-config.php
Last active April 10, 2017 21:53
Change Content Directory #WordPress
/**
* Content Directories and URL's
*
* Only needs to be set if you want to change the location of wp-content.
*/
/** Content URL */
define( 'WP_CONTENT_URL', 'https://content.example.com' );
/** Content Directory */
define( 'WP_CONTENT_DIR', dirname( dirname( __FILE__ ) ) . '/wp-content' ); // Up one directory
@AustinWinstanley
AustinWinstanley / wp-config.php
Last active April 10, 2017 21:32
Shared user tables and cookies between sites #WordPress
/**
* Authentication Unique Keys and Salts.
*
* Change these to different unique phrases!
* You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}
* You can change these at any point in time to invalidate all existing cookies. This will force all users to have to log in again.
*
* @since 2.6.0
*/
//
@AustinWinstanley
AustinWinstanley / lock-bitlocker-drive.ps1
Created April 5, 2017 03:05
Lock Drive #Bitlocker #Windows
param (
[string]$drive
);
Lock-BitLocker -MountPoint $drive -ForceDismount
@AustinWinstanley
AustinWinstanley / glassfish-uninstall.sh
Created April 5, 2017 03:04
Glassfish uninstall and purge #Java #Glassfish
#!/bin/bash
update-rc.d -f glassfish remove
/etc/init.d/glassfish stop
rm /etc/init.d/glassfish
unlink /opt/domain
unlink /opt/log
unlink /etc/init.d/glassfish
rm -R /opt/glassfish
@AustinWinstanley
AustinWinstanley / clean-git.sh
Created April 5, 2017 03:01
Clean all non-repo files and tmp files #Git
#!/bin/bash
git clean -dxf
@AustinWinstanley
AustinWinstanley / keystore-from-cert-and-pkey.sh
Created April 5, 2017 03:00
Keystore from cert and private key #Java #OpenSSL
#!/bin/bash
openssl pkcs12 -export -in foobar.crt -inkey foobar.key -out foobar.p12 -name foobar -CAfile foobar.crt -caname root
keytool -importkeystore -deststorepass password -destkeypass password -destkeystore foobar.keystore -srckeystore foobar.p12 -srcstoretype PKCS12 -srcstorepass password -alias foobar