Skip to content

Instantly share code, notes, and snippets.

View michaeltreat's full-sized avatar
🧟‍♂️

Michael Treat michaeltreat

🧟‍♂️
View GitHub Profile
@michaeltreat
michaeltreat / mongodb_shell_commands.md
Last active March 13, 2024 07:27
Quick Cheat Sheet for Mongo DB Shell commands.

MongoDB Shell Commands Cheat Sheet.

This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.

Preface:

Mongo Manual can help you with getting started using the Shell.

FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.

@michaeltreat
michaeltreat / psql_wsl_install.md
Last active December 29, 2023 21:05
Postgres WSL install instructions

Install psql on WSL

Home

This install is pretty different from previous versions of psql install instructions for windows. This install uses the WSL and Ubuntu shell.

We are installing this through the Ubuntu command line which is different from the other Ubuntu install instructions because those instructions use Ubuntu's GUI, which we don't have access to here.

NOTE: Since this is a service that is running on Ubuntu, you should be in the the Ubuntu file system when running these commands!

Install

@michaeltreat
michaeltreat / heroku_pg:push_workaround.md
Last active November 16, 2022 09:19
Quick workaround for pushing your local database to heroku for windows machines.

Workaround for pushing to heroku database on windows machince.

Context:

The command heroku pg:push essentially executes two commands under the hood. First, it executes pg_dump, which makes a backup file of a specific database. Then, it pipes that file into pg_restore, where it takes that dump file and uses it to restore another database. The way we usually use it is to push a local database to a deployed heroku database.

The problem is that on windows, the command breaks while trying to pipe in the backup file from pg_dump to pg_restore, so we need to do these two commands manually.

Solution:

@michaeltreat
michaeltreat / ckgh.txt
Last active September 21, 2022 05:44
A quick and simple script to change your Github user.email and user.name config details. Also a decent intro into scripting.
This is a simple script file that will allow a user to quickly switch their current github user.name and user.email. This is useful if you have multiple github accounts.
I use gh auth login to manage my github accs. Gh auth login will allow your device to push changes to a repo, and it seems that it will allow any user account on the device to do that.
But, if you don't want one account to be making changes on another repo it's important to manage the current github user credentials. This script helps with that.
Scripting:
First, read up on how to make script files on a mac here:
@michaeltreat
michaeltreat / CodeFellows_SCC_afterhours_locations.md
Last active August 26, 2022 20:18
List of locations for Students

Here's a list of possible places nearby where students may gather after class if they wish to continue working.

  • Rhein Haus Seattle
    • 912 12th Ave, Seattle, WA 98122
    • 1.7 miles, 8 minute drive
    • 206-325-5409
    • Open 4pm - 11pm
    • Good seating, but need to check for wi-fi and outlets
@michaeltreat
michaeltreat / Windows_201_WSL_setup.md
Last active August 7, 2022 20:11
Windows WSL setup

Note: This doc is currently being updated.

Windows 201 WSL setup

Preface

WSL stands for Windows Subsystem for Linux and it is a feature that you can enable on Windows 10 machines. It allows for you to add a Linux subsystem to your Windows machine. This subsystem will allow you to run programs and files in a POSIX or Unix-like environment, which solves many common issues that Windows users face when trying to run software that is developed for Linux.

Before you begin check to make sure that you have the most recent version of Windows 10.

@michaeltreat
michaeltreat / WSL_terminal.md
Last active April 12, 2022 16:58
Update Windows PowerShell Ubuntu Terminal

Update the WSL Ubuntu Terminal

Home

Typically we will always be working in the Windows PowerShell, but for this task we need to be in the Ubuntu app because we need to edit a file in the Ubuntu File System.

It is also highly recommended that you DO NOT edit a file in the Ubuntu system from Windows or through a Windows app as there will be errors, so we are doing this the right way by going through Ubuntu's commandline editor Nano.

At the end, this will add some coloring to your command line, and you command line will be formatted like this:

PathToCurrentDirectory[GitStatus]$

Install Mongo with WSL for Windows.

Home

This doc will guide you through installing Mongo DB using WSL through the Command Line.

Most of the steps are listed out here, but this guide will trim them down and make it more straight forward for our needs. There is also 1 step that is not in the link above as well, which will be noted when we come across it.

Install MongoDB Community Edition.

  1. Open a Windows PowerShell and type wsl.
@michaeltreat
michaeltreat / Install_Node_WSL.md
Last active April 26, 2018 20:27
Node install instructions for WSL

Install Node on the Windows Subsystem for Linux.

Home

Install Node

  1. Open a new shell and type wsl.
  2. Type cd ~/../../.
  3. Type sudo apt-get update
  4. Copy these two lines and paste them into the terminal: