Skip to content

Instantly share code, notes, and snippets.

View joshua's full-sized avatar
🌮

Joshua Suggs joshua

🌮
View GitHub Profile
package main
import (
"net/http"
"database/sql"
"fmt"
"log"
"os"
)
For PPTP:
IP Protocol=TCP, TCP Port number=1723 <- Used by PPTP control path
IP Protocol=GRE (value 47) <- Used by PPTP data path
For L2TP:
IP Protocol Type=UDP, UDP Port Number=500 <- Used by IKEv1 (IPSec control path)
IP Protocol Type=UDP, UDP Port Number=4500 <- Used by IKEv1 (IPSec control path)
IP Protocol Type=ESP (value 50) <- Used by IPSec data path
For SSTP:
@joshua
joshua / bumpme
Last active April 28, 2016 20:15
Thu Apr 28 20:15:29 UTC 2016
#!/bin/bash
set -o errexit
set -o nounset
set -o pipefail
find_files() {
find . -not \( \
\( \
-wholename '*/vendor/*' \
### Keybase proof
I hereby claim:
* I am joshua on github.
* I am suggs (https://keybase.io/suggs) on keybase.
* I have a public key ASBRaw3Jul98kKZo14kLu0w5XzS5lvUCUtOLI8UAQ92R6wo
To claim this, I am signing this object:
package main
import (
"bytes"
"context"
"fmt"
"log"
"net"
"net/http"
"os"
@joshua
joshua / images.sh
Created January 21, 2021 14:36
Save and Load All Docker Images
#!/bin/bash
case "${1}" in
"save")
# dump image tags so they can be restored later
echo "saving tags to image-tags.txt"
docker images | sed '1d' | awk '{print $1 " " $2 " " $3}' > allimages-tags.txt
# save all images to a single tar
echo "saving images to allimages.tar"
@joshua
joshua / updateModified.js
Created April 12, 2022 18:07 — forked from kodie/updateModified.js
A JavaScript function for Google Sheets that updates a specific cell with the current date/time when cell(s) are updated.
function getColumnNumberByName(name, sheet) {
if (!sheet) {
sheet = SpreadsheetApp.getActiveSheet()
}
var headers = sheet.getDataRange().offset(0, 0, 1).getValues()[0]
var column = false
for (var i = 0; i < headers.length; i++) {
if (headers[i].trim() === name) {