Skip to content

Instantly share code, notes, and snippets.

Ken Garber KenG98

Block or report user

Report or block KenG98

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
@KenG98
KenG98 / nvminit.sh
Created Dec 11, 2018
Putting NVM init into a function
View nvminit.sh
# PUT THESE LINES
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# INTO A FUNCTION
function initnvm {
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
@KenG98
KenG98 / pm.txt
Last active Apr 10, 2018
April 10th, 10:30am massive bostonhacks.io outage -- post mortem
View pm.txt
# DISCOVERY
In the early morning hours of Tuesday, April 10th, 2018, BostonHacks member Charles Ma discovered that the landing page for bostonhacks, bostonhacks.io, was offline. Charles promptly accessed his facebook messenger to notify the BostonHacks team (from now on refered to as BH team). Ken Garber then opened his computer to diagnose and repair the issue.
# DIAGNOSIS
Accessing bostonhacks.io, Ken noticed that he was getting an error message from cloudflare, showing that, "The SSL certificate presented by the server did not pass validation...". He realized the SSL certificates from letsencrypt are short lived and probably just expired.
# REPAIR
First Ken turned off Nginx, as it gets in the way of "certbot", the program which renews our certificates. He ran the "sudo service nginx stop" command. Next, he accessed cloudflare to turn off the proxy for bostonhacks.io,museo.bostonhacks.io, and www.bostonhacks.io. He ran the command "sudo certbot renew --cert-name bostonhacks.io --dry-run" to dry run a rene
@KenG98
KenG98 / sudokuSolver.java
Created May 28, 2015
A Java Sudoku solver.
View sudokuSolver.java
package sudoku.solver.two;
import java.util.Scanner;
/**
*
* @author kengarber
*/
public class SudokuSolverTwo {
@KenG98
KenG98 / pythonSudokuSolver.py
Last active Aug 29, 2015
A brute force approach to solving a sudoku board, in Python.
View pythonSudokuSolver.py
__author__ = 'kengarber'
import datetime
# SETUP ------------------------------------------------------------------
given_board = [[0, 0, 0, 0, 4, 0, 0, 0, 0],
[1, 0, 7, 0, 0, 0, 0, 8, 0],
[5, 0, 0, 6, 0, 7, 0, 3, 0],
[2, 0, 0, 3, 0, 4, 8, 9, 0],
You can’t perform that action at this time.