Skip to content

Instantly share code, notes, and snippets.

View yasir2000's full-sized avatar
🏠
Working from home

Yasir Karam yasir2000

🏠
Working from home
View GitHub Profile
@yasir2000
yasir2000 / README.md
Created April 13, 2022 20:30 — forked from bnhf/README.md
WSL 2 - Enabling systemd in Debian 11

Enable systemd in WSL2 Debian 11

This guide will help you install systemd to run as normal under WSL2 Debian. This will allow services like microk8s, docker, cockpit and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 21H2, running Debian 11 in WSL2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Download install-sg.sh to a temporary location /tmp:

cd /tmp
@yasir2000
yasir2000 / faq.md
Created December 21, 2021 15:14 — forked from samuelfvlcastro/faq.md
GoLang Tips and Tricks

FAQ

Q: pointers vs values (in general) ?

A:

Don't pass pointers as function arguments just to save a few bytes.

Don't pass a pointer to a string (*string) or a pointer to an interface value (*io.Reader). In both cases the value itself is a fixed size and can be passed directly.

Use pointes on large structs, or even small structs that might grow.

@yasir2000
yasir2000 / kubectl-cheats.md
Created November 24, 2021 20:15 — forked from davidalger/kubectl-cheats.md
kubectl cheats

List evicted pods

kubectl get pods --all-namespaces -o json \
  | jq -r '.items[] | select(.status.reason == "Evicted") | "pod/\(.metadata.name) -n \(.metadata.namespace)"'

Delete evicted pods

git init # initiates git in the current directory
git clone <address> # creates a git repo from given address (get the address from your git-server)
git clone <address> -b <branch_name> <path/to/directory> # clones a git repo from the address into the given directory and checkout's the given branch
git clone <address> -b <branch_name> --single-branch # Clones a single branch
git add file.txt # adds(stages) file.txt to the git
git add * # adds(stages) all new modifications, deletions, creations to the git
git reset file.txt # Removes file.txt from the stage
git reset --hard # Throws away all your uncommitted changes, hard reset files to HEAD
git rm file.txt # removes file.txt both from git and file system
@yasir2000
yasir2000 / docker-compose.yml
Created August 11, 2021 18:44 — forked from Mau5Machine/docker-compose.yml
Traefik Configuration and Setup
version: "3.3"
services:
################################################
#### Traefik Proxy Setup #####
###############################################
traefik:
image: traefik:v2.0
restart: always
@yasir2000
yasir2000 / questions-answers.md
Created August 11, 2021 18:22 — forked from jakubhajek/questions-answers.md
Gettting Started with Traefik on Kubernetes, Workshop #1, Q&A

1. I am interested in monitoring traefik with Datadog. Is this workshop with this topic?

There is no dedicated workshop with the monitoring Traefik by using Datadog. I’ve found in Datadog docs how to configure DataDog Agent and tune Traefik configuration to collect the data. However, I’ve not tested that setup.

2. In terms of Capabilities, how would Traefik provide a value add over some in-built services such as Azure LB or App Gateway?

Here are just a few of advantages by using Traefik:

  • easier configuration / service discovery
  • single point TLS termination
# Source: https://gist.github.com/ed8ad113fff4322ef309198d5455687f
##############################################################################################
# Full App Lifecycle In Kubernetes With Argo CD, DevSpace, vCluster, k3d, and GitHub Actions #
# https://youtu.be/uU-EAQ8Vbvk #
##############################################################################################
# Referenced videos:
# - How To Create Virtual Kubernetes Clusters With vcluster By loft: https://youtu.be/JqBjpvp268Y
# - DevSpace - Development Environments in Kubernetes: https://youtu.be/nQly_CEjJc4
@yasir2000
yasir2000 / Clean code.md
Created July 11, 2021 11:49 — forked from bansalankit92/Clean code.md
Lessons learnt from “The Clean Code” — Robert C. Martin

Even bad code can function. But if code isn't clean, it can bring a development organization to its knees.

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.
@yasir2000
yasir2000 / sql.md
Created April 19, 2021 20:24 — forked from rosswd/sql.md
Learn Relational Database Design and SQL