Skip to content

Instantly share code, notes, and snippets.

View tsdtsdtsd's full-sized avatar

Orkan Alat tsdtsdtsd

View GitHub Profile
@tsdtsdtsd
tsdtsdtsd / signal.go
Created November 25, 2017 11:41 — forked from reiki4040/signal.go
signal handling example for golang
package main
import (
"fmt"
"os"
"os/signal"
"syscall"
)
func main() {
@tsdtsdtsd
tsdtsdtsd / guess.go
Created July 26, 2017 08:33 — forked from akhenakh/guess.go
Guess an image format in Golang
package main
import (
"image"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"io"
"mime"
@tsdtsdtsd
tsdtsdtsd / _.sh
Created January 2, 2017 21:12 — forked from ikennaokpala/_.sh
Starting up and Monitoring a Golang binary in production
# Make it executable
sudo chmod +x etc/init.d/myapp
# Try it:
sudo service myapp start
# Make it run upon boot:
sudo update-rc.d myapp defaults
@tsdtsdtsd
tsdtsdtsd / etc-init.d-hello-world
Created September 27, 2016 09:10 — forked from josephspurrier/etc-init.d-hello-world
/etc/init.d Script for Go Application
#!/bin/bash
#
# chkconfig: 35 95 05
# description: Hello world application.
# Run at startup: sudo chkconfig hello-world on
# Load functions from library
. /etc/init.d/functions

Generated private key

openssl genrsa -out server.key 2048

To generate a certificate

openssl req -new -x509 -key server.key -out server.pem -days 3650

https