Let's imagine a very simple table
CREATE TABLE people {
id bigserial,
name character varying
}| #!/bin/sh | |
| set -e | |
| HOST=localhost | |
| DB=test-entd-products | |
| COL=asimproducts | |
| S3PATH="s3://mongodb-backups-test1-entd/$DB/$COL/" | |
| S3BACKUP=$S3PATH`date +"%Y%m%d_%H%M%S"`.dump.gz | |
| S3LATEST=$S3PATH"latest".dump.gz | |
| /usr/bin/aws s3 mb $S3PATH |
| upstream websocket { | |
| server localhost:3000; | |
| } | |
| server { | |
| listen 80; | |
| server_name localhost; | |
| access_log /var/log/nginx/websocket.access.log main; |
| var date = new Date(); | |
| var daysToDeletion = 120; | |
| var deletionDate = new Date(date.setDate(date.getDate() - daysToDeletion)); | |
| printjson(deletionDate); | |
| var db = db.getSiblingDB('db') | |
| db.getMongo().setSlaveOk(); | |
| printjson(db.messages.find({insertDate : {$lt : deletionDate}}).count()); |
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "html/template" | |
| "github.com/gorilla/sessions" |
| package main | |
| import ( | |
| "compress/gzip" | |
| "io" | |
| "net/http" | |
| "strings" | |
| ) | |
| // Gzip Compression |
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/mail" | |
| "net/smtp" | |
| "crypto/tls" | |
| ) |
| package main | |
| import ( | |
| "fmt" | |
| "github.com/gorilla/mux" | |
| "github.com/gorilla/securecookie" | |
| "net/http" | |
| ) | |
| // cookie handling |
master branch is always production-ready, deployable, 100% green test suitegit pull is configured to automatically rebase)