Skip to content

Instantly share code, notes, and snippets.

@noromanba
noromanba / apt-daily-timer-disable.md
Created December 25, 2016 17:51
how to disable apt-daily.timer

how to disable apt-daily.timer

$ systemctl stop apt-daily.timer
$ systemctl disable apt-daily.timer
$ systemctl mask apt-daily.service
$ systemctl daemon-reload

check current status

@mastef
mastef / isexist_vs_isnotexist.go
Created February 4, 2016 08:30
os.IsExist(err) vs os.IsNotExist(err)
/*
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
@jniltinho
jniltinho / myip.go
Created March 26, 2014 16:55
Get My IP Golang
package main
/*
URL: https://github.com/mccoyst/myip/blob/master/myip.go
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/
*/
import (
"net"
"os"
@colynb
colynb / server.go
Created June 13, 2017 22:18
Stupid JSON server in golang
package main
import (
"net/http"
"encoding/json"
)
type Person struct {
ID int `json:"id"`
Firstname string `json:"firstname"`