SPF: SPF Record Syntax.
Read ArticleCategory: Allgemein
systemd open file limit aka ulimit -n
|
1 2 3 |
[Service] LimitMEMLOCK=infinity LimitNOFILE=65535 |
I’m using archlinux. In /etc/security/limits.conf
|
1 2 |
* - nofile 65535 * - memlock unlimited |
Session rememberme easy to remember ;)
I was searching around, since it has been a while since I’ve worked at this level with sessions and the gist of it is: session lifetime = 0 means remove cookie after browser is closed session lifetime < 0 means remove cookie right now session lifetime > 0 means remove cookie after int seconds This…
Read ArticleDsero = scam + spam, careful
Long story short, I contacted them on Facebook. I had not once received any spam on Facebook, ever. A few minutes after I contacted them I received Nigera Spam on Facebook. Careful. I would advise to not use their “service”. Their business plan is to get ahold of email addresses and sell them to spammers…
Read ArticleNginx and Go through unix socket
Simple setup example Our nginx vhost:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
upstream ango { server unix:/tmp/ango.sock; } # the nginx server instance server { listen 80; server_name go.dev *.go.dev; error_log /var/log/nginx/go_error.log; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_http_version 1.1; # for keep-alive proxy_pass http://ango/; proxy_redirect off; } } |
The Go app
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
package main import ( "fmt" "github.com/gorilla/mux" "net" "net/http" ) var ( router *mux.Router = mux.NewRouter() ) func main() { // This is the route and an anonymous or first class function to return <h1>Hello World</h1> router.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "<h1>Hello World</h1>") }) // This here is an example of Chuck Han https://groups.google.com/forum/#!topic/golang-nuts/41TPj4PWBI8 // Listen on unix socket /tmp/ango.sock l, err := net.Listen("unix", "/tmp/ango.sock") if err != nil { fmt.Printf("%s\n", err) } else { err := http.Serve(l, router) if err != nil { panic(err) } } } |