Skip to content

Instantly share code, notes, and snippets.

@Christophosaurus
Christophosaurus / main.go
Created October 1, 2024 14:06 — forked from julz/main.go
containersched minicontainer
package main
import (
"fmt"
"os"
"os/exec"
"syscall"
)
func main() {
@Christophosaurus
Christophosaurus / 7etsuo-printf.c
Created September 12, 2024 12:49 — forked from 7etsuo/7etsuo-printf.c
printf cheatsheet
┌──────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────────────────────────────
│ printf Format Specifiers │
│ ┌──────────┬──────────────────────────────────────────────────┬───────────────────────────────────────┐ │/** printf format specifiers
│ │ Specifier│Description │ Example Output │ │ * ███ ▄████████ ███ ▄████████ ███ █▄ ▄██████▄
│ ├──────────┼──────────────────────────────────────────────────┼───────────────────────────────────────┤ │ *▀█████████▄ ███ ███ ▀█████████▄ ███ ███ ███ ███ ███ ███
│ │ %d │Signed decimal integer │ printf("%d", 42); // 42 │ │
@Christophosaurus
Christophosaurus / systemd_service_hardening.md
Created July 3, 2024 12:08 — forked from ageis/systemd_service_hardening.md
Options for hardening systemd service units

security and hardening options for systemd service units

A common and reliable pattern in service unit files is thus:

NoNewPrivileges=yes
PrivateTmp=yes
PrivateDevices=yes
DevicePolicy=closed
ProtectSystem=strict
@Christophosaurus
Christophosaurus / ANSI.md
Created May 2, 2024 14:30 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@Christophosaurus
Christophosaurus / 1_simple.go
Created April 17, 2024 19:42 — forked from sosedoff/1_simple.go
Golang Custom Struct Tags Example
package main
import (
"fmt"
"reflect"
)
// Name of the struct tag used in examples
const tagName = "validate"
@Christophosaurus
Christophosaurus / Makefile
Last active April 17, 2024 13:32 — forked from alexedwards/Makefile
Boilerplate Makefile for Go projects
# Change these variables as necessary.
MAIN_PACKAGE_PATH := ./cmd/example
BINARY_NAME := example
# ==================================================================================== #
# HELPERS
# ==================================================================================== #
## help: print this help message
.PHONY: help
package main
import (
"net"
"os"
)
func main() {
strEcho := "Halo"
servAddr := "localhost:6666"
tcpAddr, err := net.ResolveTCPAddr("tcp", servAddr)
@Christophosaurus
Christophosaurus / grokking_to_leetcode.md
Created July 15, 2022 18:13 — forked from tykurtz/grokking_to_leetcode.md
Grokking the coding interview equivalent leetcode problems

GROKKING NOTES

I liked the way Grokking the coding interview organized problems into learnable patterns. However, the course is expensive and the majority of the time the problems are copy-pasted from leetcode. As the explanations on leetcode are usually just as good, the course really boils down to being a glorified curated list of leetcode problems.

So below I made a list of leetcode problems that are as close to grokking problems as possible.

Pattern: Sliding Window

@Christophosaurus
Christophosaurus / mern-server-setup.md
Created June 21, 2022 19:59 — forked from bradtraversy/mern-server-setup.md
Setup Ubuntu & Deploy MERN app

Linux Server Setup & MERN App Deployment

These are the steps to setup an Ubuntu server from scratch and deploy a MERN app with the PM2 process manager and Nginx. We are using Linode, but you could just as well use a different cloud provider or your own machine or VM.

Create an account at Linode

Click on Create Linode

Choose your server options (OS, region, etc)

SSH Keys

@Christophosaurus
Christophosaurus / job_control_zsh_bash.md
Created January 7, 2022 14:00 — forked from CMCDragonkai/job_control_zsh_bash.md
CLI: Job Control in ZSH and Bash

Job Control in ZSH and Bash

All processes in ZSH/Bash under job control are in 3 states: foregrounded, backgrounded and suspended.

# run command in the foreground
command
# run commend in the background