Skip to content

Instantly share code, notes, and snippets.

@apokalyptik
apokalyptik / debian-jessie-kubernetes-1.3-manual-install-guide.md
Last active November 21, 2023 12:31
Set up Kubernetes on 3 Debian Jessie virtual machines -- No magic

The Goal

Set up Kubernetes on 3 Debian Jessie virtual machines: One master. Two nodes. Additionally do this without any "magic" so that what is required to be running to make everything work is plain and obvious.

We will be using flannel for the inter-machine networking layer. Mainly because it is useful and it seems to be pretty popular.

The Setup

@apokalyptik
apokalyptik / init.lua
Created March 16, 2023 17:56
My NVIM configuration
-- Install packer
local install_path = vim.fn.stdpath 'data' .. '/site/pack/packer/start/packer.nvim'
local is_bootstrap = false
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
is_bootstrap = true
vim.fn.system { 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path }
vim.cmd [[packadd packer.nvim]]
end
@apokalyptik
apokalyptik / encrypt.go
Created September 1, 2014 22:38
Go RSA public key encryption example. Compatible with http://us3.php.net/manual/en/function.openssl-private-decrypt.php for decryption
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"log"
type Foo struct {
value []string
}
func (f *Foo) String() string {
return ""
}
func (f *Foo) Set(s string) error {
f.value = append(f.value, s)
@apokalyptik
apokalyptik / bash.face.sh
Last active March 16, 2022 14:45
fun, crazy, little bash prompt
#!/bin/bash
function my_custom_prompt {
ECODE=$?
local HAPPYF=( "('◡')" '(•‿•)' '(˘‿˘)' '(^‿^)' )
local SADF=( '(⊙‸⊙)' '(⊙_☉)' '(o_O)' )
local BLACK="\[\033[0;30m\]"
local LBLACK="\[\033[0;90m\]"
@apokalyptik
apokalyptik / decrypt.go
Created September 1, 2014 22:36
Go RSA private key decryption example. Compatible with data encrypted via http://us3.php.net/openssl_public_encrypt
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"

About this document

This will tell you how to use your iPhone as a webcam input source on your Mac (running OSX) for web based video conferencing apps such as WhereBy and VirtualEDH

So... How absurd is this setup? Well here in the opening of 2020 with the pandemic drying up the market for cheap webcams... it's a lot less absurd now than it would have been 3 months ago, and probably a lot more absurd after that whole thing clears up. Right now finding a webcam can be difficult.

Phase 1: Install Software

On your iPhone

Download a full screen camera app. I used FullScreeen which cost me one dollar in app to buy pro as an IAP

@apokalyptik
apokalyptik / .vimrc
Last active October 5, 2017 02:47
My .vimrc file
" Instructions:
" 1. Download this .vimrc file:
" curl https://gist.githubusercontent.com/apokalyptik/fdf050e2dd004b756d2e1a0b6f2d399a/raw/.vimrc > .vimrc
" 2. Install vundle:
" git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
" 3. Run vim
" 4. Install Plugins:
" :PluginInstall
" 5. Exit vim
package main
import (
"bufio"
"flag"
"fmt"
"io"
"log"
"os"
)
#!/usr/bin/env php
<?php
define( 'DEBUG_RECURSION', false );
if ( $_SERVER['argc'] > 1 ) {
if ( substr( $_SERVER['argv'][1], 0, 1 ) !== "/" ) {
define( 'FUNCTION_MATCH', "/" . preg_quote( $_SERVER['argv'][1] ) . "/" );
} else {
define( 'FUNCTION_MATCH', $_SERVER['argv'][1] );