main.go // start the server
/api // define all my REST routing per domain
- {domain}.go // domain specific route definitions w/ handlers
- router.go // main router that will mount all the other routes.
/db // where I will define db connection init
/{domain} // where {domain} is a defined domain (e.g. user)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I ran into the battle of running all of my VMs and the host node under a single public IP address. Luckily, the host is just pure Debian, and ships with iptables. | |
What needs to be done is essentially to run all the VMs on a private internal network. Outbound internet access is done via NAT. Inbound access is via port forwarding. | |
Network configuration | |
Here’s how it’s done: | |
Create a virtual interface that serves as the gateway for your VMs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* reMarkable Text to Google Docs | |
*/ | |
var EMAIL_ALIAS = 'email+alias@gmail.com'; | |
var DRIVE_FOLDER_ID = 'your-drive-document-folder-id'; | |
var REMARKABLE_LABEL = GmailApp.getUserLabelByName('your-label-name') |
main.go // start the server
/api // define all my REST routing per domain
- {domain}.go // domain specific route definitions w/ handlers
- router.go // main router that will mount all the other routes.
/db // where I will define db connection init
/{domain} // where {domain} is a defined domain (e.g. user)
- structs.go // define the structs for each domain object
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"github.com/jaysonjphillips/golang-mux/server" | |
) | |
func main() { | |
s := server.Server{} | |
s.Initialize() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package server | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"github.com/gorilla/handlers" | |
"github.com/gorilla/mux" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"net/http" | |
"os" | |
"github.com/gorilla/handlers" | |
"github.com/gorilla/mux" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Archive your Twitpic photos and metadata | |
# | |
# A cleaned-up fork of Terence Eden's original archiver: | |
# http://shkspr.mobi/blog/2013/08/exporting-twitpic-images-python/ | |
# | |
# License: MIT | |
import urllib | |
import urllib2 | |
import json |