Skip to content

Instantly share code, notes, and snippets.

View scottjbarr's full-sized avatar

Scott Barr scottjbarr

View GitHub Profile
@denji
denji / golang-tls.md
Last active November 7, 2024 05:58 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
@p4tin
p4tin / text_adv-part-1.go
Last active September 24, 2024 14:38
Writing a Text Adventure Game in Go - Part 1
package main
import (
"fmt"
"math/rand"
"time"
)
type Game struct {
Welcome string
@farshidtz
farshidtz / time_prefix_logger.go
Last active August 15, 2018 12:06
Go logger with prefix after the timestamp
package main
import (
"io"
"log"
"os"
"time"
)
type writer struct {
@ipbastola
ipbastola / clean-up-boot-partition-ubuntu.md
Last active August 16, 2024 13:39
Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Safest way to clean up boot partition - Ubuntu 14.04LTS-x64, Ubuntu 16.04LTS-x64

Reference

Case I: if /boot is not 100% full and apt is working

1. Check the current kernel version

$ uname -r 
@crittermike
crittermike / wget.sh
Last active October 30, 2024 20:38
Download an entire website with wget, along with assets.
# One liner
wget --recursive --page-requisites --adjust-extension --span-hosts --convert-links --restrict-file-names=windows --domains yoursite.com --no-parent yoursite.com
# Explained
wget \
--recursive \ # Download the whole site.
--page-requisites \ # Get all assets/elements (CSS/JS/images).
--adjust-extension \ # Save files with .html on the end.
--span-hosts \ # Include necessary assets from offsite as well.
--convert-links \ # Update links to still work in the static version.
@tyagiakhilesh
tyagiakhilesh / journalctl.md
Last active January 9, 2021 23:32
Using JournalCtl to view system logs
// To display utc timestamp in logs
journalctl --utc

// Displaying Logs from the Current Boot
journalctl -b

// Listing boots
journalctl --list-boots