Skip to content

Instantly share code, notes, and snippets.

View smjure's full-sized avatar

smjure

View GitHub Profile
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/go-fsnotify/fsnotify"
)

GCE Instance example

image

WHEN YOU SETUP NEW GCE, DO IT IN THE MORNING THEN TEST RUNNING UNTIL YOUR 13:46, BECAUSE THE FIRST DAY ALWAYS FLIPS OUT FOR SOME STRANGE REASON. ESPECIALLY TEST:

  • Telegram commands (statsBot): news, day, stats, etc.
  • Terminal commands (statsBot): news, day, stats, etc.
  • screen command (detech a couple of times), just this time it was a reason for a flip out
  • Close terminal and let screen running in backend

GCE gcloud command: setup ssh key and connect to the desired VM instance

@smjure
smjure / humanize-duration.go
Created November 30, 2022 19:51 — forked from harshavardhana/humanize-duration.go
humanizeDuration humanizes time.Duration output to a meaningful value - golang's default ``time.Duration`` output is badly formatted and unreadable.
package main
import (
"fmt"
"math"
"time"
)
// humanizeDuration humanizes time.Duration output to a meaningful value,
// golang's default ``time.Duration`` output is badly formatted and unreadable.

Screen Quick Reference

Basic

Description Command
Detach from screen keybinding ctrl+a d
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x