Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
🐧 🗡️ 💻

Milan Thapa thapakazi

💭
🐧 🗡️ 💻
View GitHub Profile
View docker_compose_cheatsheet.md
@thapakazi
thapakazi / install-kubernetes-archlinux.md
Created Jun 12, 2019 — forked from StephenSorriaux/install-kubernetes-archlinux.md
Install Kubernetes on bare-metal ArchLinux host
View install-kubernetes-archlinux.md

Installing Kubernetes on ArchLinux

Packages

pacman -S curl docker ebtables ethtool wget unzip

Also cfssl is needed but available on AUR, using pacaur

pacaur -S cfssl
@thapakazi
thapakazi / curl.md
Created Aug 14, 2018 — forked from subfuzion/curl.md
curl POST examples
View curl.md

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

View gist:6556642b392448d9d01268ffd0f6c0b3
(defun source (filename)
"Update environment variables from a shell source file."
(interactive "fSource file: ")
(message "Sourcing environment from `%s'..." filename)
(with-temp-buffer
(shell-command (format "diff -u <(true; export) <(source %s; export)" filename) '(4))
(let ((envvar-re "declare -x \\([^=]+\\)=\\(.*\\)$"))
@thapakazi
thapakazi / ecdsa_example.rb
Created May 19, 2018 — forked from ostinelli/ecdsa_example.rb
ECDSA usage from Ruby.
View ecdsa_example.rb
require 'openssl'
require 'base64'
# ===== \/ sign =====
# generate keys
key = OpenSSL::PKey::EC.new("secp256k1")
key.generate_key
public_key = key.public_key
public_key_hex = public_key.to_bn.to_s(16).downcase # public key in hex format
@thapakazi
thapakazi / ecc.rb
Created May 19, 2018 — forked from bkerley/ecc.rb
ruby ECDSA fun time
View ecc.rb
# derived from http://h2np.net/tips/wiki/index.php?RubyOpenSSLDigitalSignatureSample
require 'openssl'
require 'base64'
include OpenSSL
group_name = 'secp521r1'
message = '10000 fartbux sent to bryce from a can of beans'
key = PKey::EC.new(group_name)
key = key.generate_key
@thapakazi
thapakazi / README.md
Created Apr 5, 2018 — forked from bigglesrocks/README.md
Rails Scoped Invitation System
View README.md

#Scoped Invitation System for User Groups with Rails#

Starting out with the following models and associations:

####User

  • has_many :memberships
  • has_many :organizations through :memberships

####Organization (User Group)

  • has_many :memberships
@thapakazi
thapakazi / AWSRegionsAndAZs.md
Created Mar 13, 2018
List of AWS availability zones for each AWS region
View AWSRegionsAndAZs.md
AWS region code AWS region name Number of AZs AZ names
us-east-1 Virginia 4 us-east-1a, us-east-1b, us-east-1c, us-east-1e
us-west-1 N. California 2 us-west-1a, us-west-1b
us-west-2 Oregon 3 us-west-2a, us-west-2b, us-west-2c
eu-west-1 Ireland 3 eu-west-1a, eu-west-1b, eu-west-1c
eu-central-1 Frankfurt 2 eu-central-1a, eu-central-1b
ap-southeast-1 Singapore 2 ap-southeast-1a, ap-southeast-1b
ap-southeast-2 Sydney 2 ap-southeast-2a, ap-southeast-2b, ap-southeast-2c
ap-northeast-1 Tokyo 2 ap-northeast-1a, ap-nort
You can’t perform that action at this time.