Skip to content

Instantly share code, notes, and snippets.

View haani-niyaz's full-sized avatar

Haani Niyaz haani-niyaz

  • Melbourne, Australia
View GitHub Profile
@haani-niyaz
haani-niyaz / go-journal.md
Last active January 6, 2025 02:20
Go notes

Go Journal

Developer Environment

Private Repo Setup

git config --global \
  url."https://${user}:${personal_access_token}@privategitlab.com".insteadOf \
 "https://privategitlab.com"
@haani-niyaz
haani-niyaz / haproxy-docker-nexus.md
Last active October 23, 2024 13:58
HAProxy config for nexus docker repo with no connector

HAPROXY Docker Nexus (No HTTP Connector)

Background

  1. The docker-login repo is setup with minimal (read-only) access which allows all users to login. This creates the necessary credentials store required for all subsequent docker operations. The team docker repositories will be setup with RBAC to only allow access to members of that respective team to perform docker push/pull operations.

  2. The proxy will inspect the context path for the docker pull/push operations and proceed only if authorization is successful.

@haani-niyaz
haani-niyaz / getting_started_with_ansible.markdown
Last active February 28, 2023 12:54
Ansible getting started guide

Ansible

Build Ansible from source

$ sudo yum install python-setuptools
$ sudo easy_install pip
$ sudo yum install python-devel
$ sudo pip install ansible
@haani-niyaz
haani-niyaz / gitserver_port_forwarding.md
Last active June 28, 2022 12:38
Setup a port forwarding for git server

GIT Portforwarding

Setup port forwarding connection from a server that does not have access to the git_server but does have access to the proxy_server.

Configure port forwarding

#ssh -L <local_port>:git_server:<git_port> proxy_server
$ ssh -L 3333:mygitserver.com:7999 myproxyserver
global
log 127.0.0.1 local2
user haproxy
group haproxy
chroot /var/lib/haproxy
pidfile /var/run/haproxy.pid
daemon
maxconn 1000
defaults
@haani-niyaz
haani-niyaz / go-dev-guiding-principles.md
Last active February 10, 2022 07:02
Go application development guiding principles

Go Dev Guiding Principles

An opinionated list of practices when developing in Go.

(1) Names

Names should be self revealing.

@haani-niyaz
haani-niyaz / clean_code.md
Created June 29, 2020 01:37 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

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.

Design rules

@haani-niyaz
haani-niyaz / 14-aws.sh
Last active May 24, 2020 09:07 — forked from vfarcic/14-aws.sh
kubernetes training
cd k8s-specs
git pull
export AWS_ACCESS_KEY_ID=[...]
export AWS_SECRET_ACCESS_KEY=[...]
aws --version
@haani-niyaz
haani-niyaz / verify_ssl.md
Last active May 23, 2020 07:13
SSL Verification

RHEL Admin Tasks

Set timezone

$ sudo timedatectl set-timezone Australia/Melbourne

Setup NTP

$ yum install -y ntp