Skip to content

Instantly share code, notes, and snippets.

View somaliz's full-sized avatar
:shipit:

S somaliz

:shipit:
  • Metaverse
View GitHub Profile
@somaliz
somaliz / aws-vpc-cni.yaml
Created February 9, 2022 16:14
AWS EKS vpc-cni cutom networking v1.7.10
---
"apiVersion": "rbac.authorization.k8s.io/v1"
"kind": "ClusterRoleBinding"
"metadata":
"name": "aws-node"
"roleRef":
"apiGroup": "rbac.authorization.k8s.io"
"kind": "ClusterRole"
"name": "aws-node"
"subjects":
@somaliz
somaliz / kubernetes_add_service_account_kubeconfig.sh
Created June 10, 2020 09:14 — forked from xtavras/kubernetes_add_service_account_kubeconfig.sh
create kubernetes service account and corresponding kubeconfig
#!/usr/bin/env bash
# script was taken from https://gist.github.com/innovia/fbba8259042f71db98ea8d4ad19bd708 and adjusted with "apply_rbac" function and colorized output
set -e
set -o pipefail
# Colors
RED="\e[01;31m"
@somaliz
somaliz / kubernetes_add_service_account_kubeconfig.sh
Created June 10, 2020 09:14 — forked from innovia/kubernetes_add_service_account_kubeconfig.sh
Create a service account and generate a kubeconfig file for it - this will also set the default namespace for the user
#!/bin/bash
set -e
set -o pipefail
# Add user to k8s using service account, no RBAC (must create RBAC after this script)
if [[ -z "$1" ]] || [[ -z "$2" ]]; then
echo "usage: $0 <service_account_name> <namespace>"
exit 1
fi
@somaliz
somaliz / Install kops on Ubuntu
Created September 8, 2019 20:56
kops installation on ubuntu steps
# Install AWS CLI, Kubectl, Kops
sudo apt update
sudo apt install -y awscli
sudo snap install kubectl --classic
curl -LO https://github.com/kubernetes/kops/releases/download/1.7.0/kops-linux-amd64
chmod +x kops-linux-amd64
mv ./kops-linux-amd64 /usr/local/bin/kops
# Setup the AWS profile
aws config
@somaliz
somaliz / Install kops on Ubuntu
Created September 8, 2019 20:56
kops installation on ubuntu preque
# Install AWS CLI, Kubectl, Kops
sudo apt update
sudo apt install -y awscli
sudo snap install kubectl --classic
curl -LO https://github.com/kubernetes/kops/releases/download/1.7.0/kops-linux-amd64
chmod +x kops-linux-amd64
mv ./kops-linux-amd64 /usr/local/bin/kops
# Setup the AWS profile
aws config
### Keybase proof
I hereby claim:
* I am somaliz on github.
* I am somaliz (https://keybase.io/somaliz) on keybase.
* I have a public key ASDBYmA3RfNQFofhGeEq-TeoN1tZm7Qzl4STgrjilbc8igo
To claim this, I am signing this object:
@somaliz
somaliz / Ansible-Vault how-to.md
Created May 13, 2019 12:58 — forked from tristanfisher/Ansible-Vault how-to.md
A short tutorial on how to use Vault in your Ansible workflow. Ansible-vault allows you to more safely store sensitive information in a source code repository or on disk.

Working with ansible-vault


I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.

What I decided on was the following: put your secret information into a vars file, reference that vars file from your task, and encrypt the whole vars file using ansible-vault encrypt.

Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.

@somaliz
somaliz / PowerShell Customization.md
Created August 22, 2018 13:35 — forked from jchandra74/PowerShell Customization.md
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@somaliz
somaliz / http-status-codes.md
Created November 23, 2017 13:32 — forked from subfuzion/http-status-codes.md
General REST API HTTP Status Codes

Reference: RFC 2616 - HTTP Status Code Definitions

General

  • 400 BAD REQUEST: The request was invalid or cannot be otherwise served. An accompanying error message will explain further. For security reasons, requests without authentication are considered invalid and will yield this response.
  • 401 UNAUTHORIZED: The authentication credentials are missing, or if supplied are not valid or not sufficient to access the resource.
  • 403 FORBIDDEN: The request has been refused. See the accompanying message for the specific reason (most likely for exceeding rate limit).
  • 404 NOT FOUND: The URI requested is invalid or the resource requested does not exists.
  • 406 NOT ACCEPTABLE: The request specified an invalid format.
@somaliz
somaliz / sudoers_edit.md
Created November 2, 2017 16:49 — forked from carlessanagustin/sudoers_edit.md
Ways of adding NOPASSWD to /etc/sudoers file

Way 1:

groupadd -r admin
usermod -a -G admin vagrant
cp /etc/sudoers /etc/sudoers.orig
sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=admin' /etc/sudoers
sed -i -e 's/%admin ALL=(ALL) ALL/%admin ALL=NOPASSWD:ALL/g' /etc/sudoers
visudo -cf /etc/sudoers