Skip to content

Instantly share code, notes, and snippets.

View loa's full-sized avatar

Carl Loa Odin loa

  • NoneType AB
  • Stockholm
View GitHub Profile
@loa
loa / init.lua
Created August 29, 2019 10:48
Hammerspoon Window Columns
function moveWindowColumn(column, width)
local window = hs.window.focusedWindow()
local windowFrame = window:frame()
local screen = window:screen()
local screenFrame = screen:frame()
-- minimum 2 columns even on smaller displays
local numColumns = math.max(2, math.floor(screenFrame.w / 1100))
local remainder = screenFrame.w % numColumns
local columnWidth = math.floor(screenFrame.w / numColumns)
@loa
loa / README.md
Last active May 16, 2018 18:39
Kubernetes Fedora Single node
# https://kubernetes.io/docs/getting-started-guides/fedora/fedora_manual_config/
dnf install kubernetes

Keybase proof

I hereby claim:

  • I am loa on github.
  • I am loa (https://keybase.io/loa) on keybase.
  • I have a public key ASDGz8C-dFsDm6g3EBf6Ud28FTNS4LaaYd9OOr3MMeX2yAo

To claim this, I am signing this object:

@loa
loa / README.md
Last active April 23, 2024 17:26
Dual GPG Yubikey Setup

Dual GPG Yubikey Setup

If you follow this guide you will end up with an offline and online Yubikey. Use your online Yubikey for everyday life, signing/encryption etc. Offline key for signing keys for web-of-trust and replace lost online keys.

Awesome tools with PGP keys:

  • mozilla/sops dead-simple local encryption of sensitive files
  • popass.pw password manager for you and your team stored in git

Offline Yubikey

@loa
loa / README.md
Last active January 9, 2018 11:48
Minikube host networking integration

Minikube host networking integration

Make it possible for your host to do dns lookups and reach internal pods and svcs in Minikube directly.

Networking

MacOS:

$ sudo route -n add 10.96.0.0/12 $(minikube ip) # svc
A (en) ALFA
B (en) BRAVO
C (en) CHARLIE
D (en) DELTA
E (en) ECHO
F (en) FOXTROT
G (en) GOLF
H (en) HOTEL
I (en) INDIA
J (en) JULIETT
@loa
loa / github_enterprise_jekyll_versions.md
Created March 13, 2017 14:27
GitHub Enterprise Jekyll Versions
<pre>
{% for dependency in site.github.versions %}
* {{ dependency[0] }}: {{ dependency[1] }}
{% endfor %}
</pre>
@loa
loa / openshift-go.sh
Created February 17, 2017 15:30
OpenShift New project
# it's required that name is identical with repo name
NAME=project
REPO=git@github.com/user/project.git
HOSTNAME=project.example.com
# create deploy key
ssh-keygen -t rsa -N "" -b 4096 -f deploy-key
# create new project
oc new-project $NAME
@loa
loa / gen_vagrant_atlas_index.py
Last active November 3, 2016 08:58
Generate Vagrant Atlas Index
#!/usr/bin/env python
## How to use
# - Create following structure with box/virtualbox/*.box
# - Follow naming convention box-name-SEMVER.box
# - Run script from root and index files will be generated for all unique box-names
# .
# ├── box
# │   └── virtualbox
# │   ├── centos6-0.1.0.box

In this step we'll create a swarm cluster from two nodes. You should've received access to two nodes in AWS.

  1. SSH in to the first node: ssh -i docker_demo.pem ubuntu@IP1
  2. Figure out the internal IP address of the node: ifconfig and check the eth0 address (10.0....)
  3. Initialize the Swarm cluster: `docker swarm init --listen-addr INTERNAL_IP --advertise-addr INTERNAL_IP
  4. Open a new tab and SSH to the other node: ssh -i docker_demo.pem ubuntu@IP2
  5. Check the internal IP of that node: ifconfig and eth0
  6. Join to the cluster with the command the previous command printed out. Before executing the command, you need to the extend it with the --listen-addr and --advertise-addr parameters (using the internal IP of the second node): docker swarm join TOKEN --listen-addr 10.0.... --advertise-addr 10.0..... node1...
  7. Get back to the first node and verify the results: docker node ls