Skip to content

Instantly share code, notes, and snippets.

@so0k
so0k / kubectl.md
Last active April 25, 2024 12:40
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@so0k
so0k / 00-README.md
Last active May 26, 2018 08:03
Cog Multi Pod deployment with external Postgres

Deploying Cog on Kubernetes (on AWS)

Note: Use the excellent helm chart - ohaiwalt/cog-helm to get up quickly on k8s

Follow the guide below to understand the inner workings a bit better.

We will be creating 1 deployment for the cog server and 1 deployment for the relay server.

We chose to run Postgres outside the Kubernetes cluster and provide instructions how to expose all service ports on a single ELB.

@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
@so0k
so0k / powerline.md
Last active September 18, 2020 14:04

Powerline

http://powerline.readthedocs.io

 mkdir powerlineFonts
 cd powerlineFonts/
 git init
 git remote add origin https://github.com/powerline/fonts.git
 git remote -v
@so0k
so0k / config.cfg
Last active January 4, 2017 14:43
unbindall
bind "0" "slot10"
bind "1" "slot1"
bind "2" "slot2"
bind "3" "slot3"
bind "4" "slot4"
bind "5" "slot5"
bind "9" "slot9"
bind "a" "+duck"
bind "b" "slot8"
@so0k
so0k / aws-docs-original.md
Last active June 28, 2016 08:19
AWS Docs clarification

Orig AWS Documentation:

url

You can enable query logging for your PostgreSQL DB instance by setting two parameters in the DB parameter group associated with your DB instance: log_statement and log_min_duration_statement. The log_statement parameter controls which SQL statements are logged. We recommend setting this parameter to all to log all statements; the default value is none. Alternatively, you can set this value to ddl to log all data definition language (DDL) statements (CREATE, ALTER, DROP, etc.) or to mod to log all DDL and data modification language (DML) statements (INSERT, UPDATE, DELETE, etc.).

The log_min_duration_statement parameter sets the limit in milliseconds of a statement to be logged. All SQL statements that run longer than the parameter setting are logged. This parameter is disabled and set to minus 1 (-1) by default. Enabling this parameter can help you find unoptimized queries.

@so0k
so0k / README.md
Last active April 27, 2016 22:10

Docker Tallinn Demo script

Ensure swarm cluster is started before start of demo script

Docker CLI

Using Beta Docker for Windows

@so0k
so0k / gist:cdd24d0a4ad92014a1bc
Last active March 4, 2024 14:17
droplet discovery over digitalocean private networks

Digital Ocean recently released private networking support in their NYC2 Data center.

They also published a blog post on how to setup a new droplet with private networking. But one thing the post doesn't do is tell you how to scale your private network for many boxes. One approach is obviously to edit /etc/hosts (but this gets annoying when you add a new box). A better way is to create an internal DNS zone (via the digital ocean web interface) and have your droplets use it:

Steps

setup the internal DNS zone file

  1. Login to digital ocean
  2. Click "DNS" on the right hand menu
@so0k
so0k / sshcommand.sh
Created January 3, 2016 13:59
sshcommand.sh
#!/bin/bash
set -e
shopt -s nocasematch #For case insensitive string matching, for the first parameter
SELF=`which $0`
case "$1" in
create) # sshcommand create <user> <command>
if [[ $# -ne 3 ]]; then
@so0k
so0k / eraser\chat.db
Last active October 1, 2015 02:10
counter-strike [POD] and quake 2 [ERASER] bot chat
# Eraser Bot chat data
#
# Thanks to Meanstryk for the additions
# -> http://www.planetquake.com/ramshackle
# Also thanks to Shawn "Benighted1" Lisk for more additions
# -> kclisk@bright.net
#
# OK, here's the deal. Bot's can say one of the following things:
#
# 1. Greetings