Skip to content

Instantly share code, notes, and snippets.

@r00tvvm
r00tvvm / nix-macos.md
Created March 23, 2024 22:59 — forked from ykomatsu/nix-macos.md
Installing Nix on macOS in single-user mode
@r00tvvm
r00tvvm / install_debian_with_debootstrap_howto.md
Created January 6, 2023 19:05 — forked from varqox/install_debian_with_debootstrap_howto.md
Instructions how to install Debian using debootstrap
@r00tvvm
r00tvvm / ssh_key.tf
Created December 20, 2022 16:33 — forked from irvingpop/ssh_key.tf
Terraform external data source example - dynamic SSH key generation
# ssh key generator data source expects the below 3 inputs, and produces 3 outputs for use:
# "${data.external.ssh_key_generator.result.public_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key}" (contents)
# "${data.external.ssh_key_generator.result.private_key_file}" (path)
data "external" "ssh_key_generator" {
program = ["bash", "${path.root}/../ssh_key_generator.sh"]
query = {
customer_name = "${var.customer_name}"
customer_group = "${var.customer_group}"
@r00tvvm
r00tvvm / xiaomi-redmi-4x-unlock.md
Created September 17, 2022 21:57 — forked from szkrd/xiaomi-redmi-4x-unlock.md
Xiaomi Redmi 4x unlock, lineage install and root

Unlock Xiaomi Redmi 4X (santoni) and install Lineage OS via sideloading

So far the most useful documentation was at Lineage's Redmi section, random "mobile enthusiast" sites were "not very good" and youtube videos are to be avoided like the plague.

Files needed

  • SDK platform tools from android.com
  • mi flash unlock gui tool (miflash_unlock-en-5.5.224.24.zip)
  • newest twrp for device (twrp-3.5.2_9-0-santoni.img), from twrp site
@r00tvvm
r00tvvm / macos-ramdisk.md
Created August 17, 2022 15:03 — forked from htr3n/macos-ramdisk.md
Creating RAM disk in macOS

Built-in

diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`

where XXXXX is the size of the RAM disk in terms of memory blocks.

Notes:

@r00tvvm
r00tvvm / gpg-ssh-setup.md
Created July 15, 2022 18:44 — forked from mcattarinussi/gpg-ssh-setup.md
A setup guide to use a personal gpg key for ssh authentication

GPG - SSH setup

Generating the master key

Here we create the master key. We want only Certify capability: we use the master key only to create the subkeys, Sign - Encrypt - Authenticate capabilities will be assigned to the subkeys.

Run the following command to start the master key generation process. Select the set your own capabilities creation process (type 8)

  ▶ gpg --full-generate-key --expert

gpg (GnuPG) 2.2.9; Copyright (C) 2018 Free Software Foundation, Inc.

@r00tvvm
r00tvvm / vimrc
Created February 25, 2022 17:13 — forked from romainl/vimrc
One way to set up Vim for Python on MacOS (assuming MacPorts)
if toupper(substitute(system('uname'), '\n', '', '')) =~ 'DARWIN'
\ && exists('+pythonhome')
\ && exists('+pythondll')
\ && exists('+pythonthreehome')
\ && exists('+pythonthreedll')
let python_path = '/opt/local/Library/Frameworks/Python.framework/Versions'
for i in range(0, 9)
if filereadable(python_path . '/2.' . i . '/lib/libpython2.' . i . '.dylib')
let &pythonhome = python_path . '/2.' . i
let &pythondll = python_path . '/2.' . i . '/lib/libpython2.' . i . '.dylib'
@r00tvvm
r00tvvm / gettext-install.md
Last active February 16, 2022 01:01 — forked from Manuel4131/gist:67bc86b05e5a46a518d7
How to install GNU gettext on MAC OSX
  1. Wget ftp://ftp.gnu.org/pub/gnu/gettext/gettext...t-0.12.1.tar.gz
  2. Untar file as tar -zxvf gettext-0.12.1.tar.gz
  3. cd to the directory containing the package's source code and type ./configure to configure the package for your system. If you're using csh on an old version of System V, you might need to type sh ./configure instead to prevent csh from trying to execute configure itself.

Running configure takes awhile. While running, it prints some messages telling which features it is checking for.

  1. Type make to compile the package.
  2. Optionally, type make check to run any self-tests that come with the package.
  3. Type make install to install the programs and any data files and documentation.
@r00tvvm
r00tvvm / stdin_example.go
Created January 1, 2022 18:01 — forked from miguelmota/stdin_example.go
Golang stdin read line example
package main
import (
"bufio"
"fmt"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
@r00tvvm
r00tvvm / patch_example.md
Created November 7, 2021 17:04 — forked from coresolve/patch_example.md
An example of using kubectl patch

Start with a simple deployment:

kubectl run simple --image=quay.io/dcooley/simple-app:plain --replicas=3 --port=80 --labels=app=simple

show the yaml for this deployment:

$ kubectl get deployment simple -o yaml --export
apiVersion: extensions/v1beta1
kind: Deployment