Skip to content

Instantly share code, notes, and snippets.

View KenG98's full-sized avatar

Ken Garber KenG98

View GitHub Profile
@KenG98
KenG98 / sudokuSolver.java
Created May 28, 2015 22:54
A Java Sudoku solver.
package sudoku.solver.two;
import java.util.Scanner;
/**
*
* @author kengarber
*/
public class SudokuSolverTwo {
@KenG98
KenG98 / pythonSudokuSolver.py
Last active August 29, 2015 14:22
A brute force approach to solving a sudoku board, in Python.
__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],
@KenG98
KenG98 / pm.txt
Last active April 10, 2018 15:37
April 10th, 10:30am massive bostonhacks.io outage -- post mortem
# 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
[ RUN ] CliTest.writeMultipleTimesAllExecute
I0204 20:29:01.236227 1 magma_logging.h:28] Setting verbosity to 4
I0204 20:29:01.265228 1 Engine.cpp:40] SSH already initialized
I0204 20:29:01.266278 1 Engine.cpp:55] Logging already initialized
I0204 20:29:01.267364 1 Engine.cpp:86] Cli engine started with concurrency set to 8
I0204 20:29:01.269641 1 Ssh.cpp:66] Opening server: 0.0.0.0:9999
I0204 20:29:01.273094 366 Ssh.cpp:95] Waiting for session on: 0.0.0.0:9999
I0204 20:29:01.784387 367 ReconnectingCli.cpp:125] [localhost-test-device] Recreating cli stack
I0204 20:29:01.785070 1 KeepaliveCli.cpp:64] [localhost-test-device] initialized
I0204 20:29:01.786698 1 KeepaliveCli.cpp:98] [localhost-test-device] ([7763] ) triggerSendKeepAliveCommand created new command
@KenG98
KenG98 / nvminit.sh
Created December 11, 2018 23:13
Putting NVM init into a function
# 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