Skip to content

Instantly share code, notes, and snippets.

@mkell85
mkell85 / gist:463a6744ca8059695130ea77b50f481c
Last active January 20, 2018 07:48
Steps to provision Ubuntu server
## 1. Update and upgrade with apt-get
> apt-get update -y
> apt-get -y upgrade
## 2. Add user "admin"
> adduser username
## 3. Configure ssh
@mkell85
mkell85 / nginx-naxsi.sh
Created January 25, 2018 07:48 — forked from dcnl1980/nginx-naxsi.sh
Nginx Naxsi (firewall) on Ubuntu 16.04
#!/usr/bin/env bash
apt-get install -y gcc libpcre3 libpcre3-dev libssl-dev unzip make \
libgoogle-perftools-dev google-perftools jq
mkdir /tmp/ngxbuild
cd /tmp/ngxbuild
latestNginx=$(curl -s http://hg.nginx.org/nginx/tags |
grep "^ *release-" | head -1 | cut -c 9-)
latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases |
jq -r .[].tag_name | grep -v rc | head -1)
@mkell85
mkell85 / Path.java
Created November 7, 2018 15:32
Dynamic Programming to count paths with blockages
import java.util.Arrays;
class Path {
static boolean isValidPosition(boolean[][] board, int row, int col) {
if(row >= board.length || col >= board.length)
return false;
return board[row][col];