Skip to content

Instantly share code, notes, and snippets.

View safeith's full-sized avatar

Hojjat Ali Mohammadi safeith

View GitHub Profile

Keybase proof

I hereby claim:

  • I am safeith on github.
  • I am safeith (https://keybase.io/safeith) on keybase.
  • I have a public key ASC5kRT8sp5M8ZLpM1chR21S1FCtNyqVXAaEt9XwDeTCfQo

To claim this, I am signing this object:

Kubernetes With Hyperkube

In this document we will create a cluster with Ubuntu 18.04 servers and Hyperkube, It's a multi master cluster.

Requirements

  1. Two Ubuntu 18.04 as master
  2. Two Ubuntu 18.4 as worker
  3. Minimum 2 core vCPU per server
  4. Minimum 2 GB RAM per server
config:
linux.kernel_modules: bridge,br_netfilter,ip6_tables,ip_tables,ip_vs,ip_vs_rr,ip_vs_sh,ip_vs_wrr,netlink_diag,nf_conntrack,ip_conntrack,nf_nat,overlay,xt_conntrack
raw.lxc: |-
lxc.cgroup.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop =
security.nesting: "true"
security.privileged: "true"
description: microk8s profile
devices:
config:
linux.kernel_modules: bridge,br_netfilter,ip_tables,ip6_tables,ip_vs,netlink_diag,nf_nat,overlay,xt_conntrack
raw.lxc: |-
lxc.cgroup.devices.allow = a
lxc.mount.auto=proc:rw sys:rw
lxc.cap.drop =
security.nesting: "true"
security.privileged: "true"
description: docker profile
devices:
@safeith
safeith / local.conf
Last active September 3, 2021 14:19
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<description>User font configuation</description>
<!-- Default sans-serif font -->
<match target="pattern">
<test qual="any" name="family">
<string>sans-serif</string>
</test>
<edit name="family" mode="prepend" binding="strong">
*background: #282828
*foreground: #ebdbb2
*color0: #282828
*color8: #928374
*color1: #cc241d
*color9: #fb4934
*color2: #98971a
*color10: #b8bb26
*color3: #d79921
*color11: #fabd2f
#
# Powerline Red Block - Tmux Theme
# Created by Jim Myhrberg <[email protected]>.
#
# Inspired by vim-powerline: https://github.com/Lokaltog/powerline
#
# Requires terminal to be using a powerline compatible font, find one here:
# https://github.com/Lokaltog/powerline-fonts
#
#!/bin/bash
action=$1
if [ "$action" == "" ]
then
echo -e "\e[1mUsage:\e[0m"
echo -e " To TORIFY whole system run: torification enable"
echo -e " To UNTORIFY run: torification disable"
echo -e " To check STATUS run: torification status"
@safeith
safeith / url_status.py
Last active October 2, 2020 13:20
Simple TCP socket in Python that accepts URL(s) as input and return its http status code
#!/usr/bin/env python3
import socket
import requests
def url_status(listening_ip, listening_port, *args, **kwargs):
"""
This a simple TCP socket that accept url(s) as input and return url(s), and
its status code.
@safeith
safeith / SimpleTcpSocket.py
Last active October 3, 2020 07:05
Simple TCP socket class in Python that accepts URL(s) as input and return its http status code
#!/usr/bin/env python3
import socket
import requests
class SimpleTcpSocket:
"""
A TCP socket class