Skip to content

Instantly share code, notes, and snippets.

😎
Automating...

Justin Hammond Justintime50

😎
Automating...
Block or report user

Report or block Justintime50

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Justintime50
Justintime50 / laravel-upgrade-mysql-from-v5-to-v8-password.md
Created Feb 7, 2020
Upgrading MySQL from v5 to v8 breaks passwords
View laravel-upgrade-mysql-from-v5-to-v8-password.md

Upgrading MySQL from v5 to v8 breaks passwords

Frameworks such as Laravel will no longer work with the native mysql passwords when upgraded. Follow these steps to correct:

Usage

docker exec -it database_container bash
mysql -u root -p
ALTER USER username IDENTIFIED WITH caching_sha2_password BY 'MYPASSWORDHERE';
@Justintime50
Justintime50 / git-check.md
Created Jan 29, 2020
Check if a directory is a git repo and warn the user.
View git-check.md

Git Check

Check if a directory is a git repo and warn the user.

Usage

Add this to your ~/.zshrc file or ~/.bash_profile and source it.

function git-check() {
@Justintime50
Justintime50 / setup-mailcatcher-docker.md
Created Jan 23, 2020
Have you ever needed to test mail functions for a project and didn't want to spam the real web? Use Mailcatcher!
View setup-mailcatcher-docker.md

Setup Mailcatcher on Docker

Have you ever needed to test mail functions for a project and didn't want to spam the real web? Use Mailcatcher!

Usage

docker run -d -p 1080:1080 -p 1025:1025 --name=mailcatcher -itd --network=mailcatcher sj26/mailcatcher
@Justintime50
Justintime50 / add-ssh-passphrase-to-ssh-agent.md
Last active Feb 10, 2020
Tired of typing in your SSH passphrase when using Git? Get ride of it!
View add-ssh-passphrase-to-ssh-agent.md

Add SSH Passphrase to SSH Agent

Tired of typing in your SSH passphrase? Get rid of it!

This process may need to be done on each login.

ssh-add

# If you need to specify the SSH location/file, use the following
@Justintime50
Justintime50 / migrate-google-drive-across-domains.md
Created Jan 15, 2020
Guide to migrating Google Drives across domains.
View migrate-google-drive-across-domains.md

Migrate Google Drive Across Domains

Guide to migrating Google Drives across domains.

Intro

Have you ever needed to migrate files or an entire drive structure from one domain to another? Many people have. Whether you rebrand or just want to share some files with another company quickly, there is a growing need to do this; however, Google does not provide a way to automatically migrate files across domains. I spent the last two years brainstorming and testing methods to do this after the company I worked for rebranded and we suddenly had a need to move 4+ terrabytes of data and thousands of folders across domains. Here is the journey we took to get there.

What didn't work

@Justintime50
Justintime50 / the-homebrew-guide.md
Last active Jan 15, 2020
The ultimate Homebrew setup and usage guide.
View the-homebrew-guide.md

The Homebrew Guide

The ultimate Homebrew setup and usage guide.

What is Homebrew?

Homebrew is the missing package manager for macOS. It allows you to install command line tools brew install ... as well as GUI desktop apps brew cask install ... all through the command line.

Install Homebrew

@Justintime50
Justintime50 / generate-ssh-key.md
Created Jan 15, 2020
Run the following commands to generate and copy an SSH key.
View generate-ssh-key.md

Generate SSH Key

Run the following commands to generate and copy an SSH key.

Usage

ssh-keygen -t rsa

pbcopy < ~/.ssh/id_rsa.pub
@Justintime50
Justintime50 / remove-latest-git-commit.md
Last active Feb 5, 2020
Reset your latest Git commit as if it never happened.
View remove-latest-git-commit.md

Remove Latest Git Commit

Have you ever pushed something you wish you hadn't? There is a simple solution to this problem. You can reset your latest commit and then push that to remote as if the commit never happened.

Usage

# Roll us back to the last commit
git reset --hard HEAD^
# Push back to origin "as if it never happened."
@Justintime50
Justintime50 / hash-password.md
Last active Jan 8, 2020
Run the following to hash a password using PHP.
View hash-password.md

Hash a Password

Run the following to hash a password using PHP. Replace mypass with the password you'd like to hash.

php -r '$hash = password_hash("mypass", PASSWORD_DEFAULT); echo $hash;'
@Justintime50
Justintime50 / standard-user-owned-brew.MD
Last active Jan 22, 2020
Use the following commands to setup Hombrew as a standard user getting around needing sudo access for most packages.
View standard-user-owned-brew.MD

Standard User Owned Brew

Use the following commands to setup Hombrew as a standard user getting around needing sudo access for most packages.

NOTE: This still requires an admin to install Homebrew initially. After the ownership change, the standard user can use Homebrew moving forward.

Setup Homebrew for a Standard User

curl -fsS 'https://raw.githubusercontent.com/Homebrew/install/master/install' | ruby
You can’t perform that action at this time.