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"
)
@smjure
smjure / syncthing-setup-exclusively-with-CLI.md
Last active September 5, 2024 10:08 — forked from Jonny-exe/syncthing-setup-exclusively-with-CLI.md
syncthing setup exclusively with CLI

GCE Instance example [1.23 has Telemetry, switch it off go telemetry off]

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
@smjure
smjure / cloudSettings
Last active November 25, 2019 07:46
Settings_Sync_Windows
{"lastUpload":"2019-11-25T07:46:39.314Z","extensionVersion":"v3.4.3"}