Skip to content

Instantly share code, notes, and snippets.

View teterkin's full-sized avatar

Alexander Teterkin teterkin

View GitHub Profile
@teterkin
teterkin / gitlab-clone.sh
Last active March 14, 2026 09:27
Bash script to clone all the repositories from your self-hosted GitLab server
#!/bin/bash
# Configuration
GITLAB_URL="https://<GITLAB_URL>"
# To get Token click on your avatar in Gitlab UI, then click Preferences, and then Access tokens
# To clone repo you need only read_repository scope — This scope provides read-only access to the repository, allowing you to perform git clone, git pull, and git fetch operations.
PRIVATE_TOKEN="<YOUR_GITLAB_PERSONAL_ACCESS_TOKEN>"
@teterkin
teterkin / getNetManager.sh
Created December 9, 2025 13:28
This scipts displays what controls the Network on your Linux
#!/bin/bash
# This scipts displays what controls the Network on your Linux
GREEN='\033[0;32m'
NC='\033[0m'
echo
if [ "$(id -u)" -eq 0 ]; then
@teterkin
teterkin / vikubeconfig.sh
Created November 13, 2025 14:43
Bash script to adds new Kubernetes configuration to default Kubeconfig file, so you can access multiple Kubernetes clusters
#!/bin/bash
# Extra info is here: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/
echo
echo "> ${0} script adds Kubernetes configuration to Kubeconfig file"
echo "> Press ENTER to continue or Comtrol-C to Exit..."
echo
READ zz
@teterkin
teterkin / Install-Packer-on-Ubuntu-via-Ansible.md
Created February 21, 2021 11:49
Install Packer on Ubuntu via Ansible

Установка HashiCorp Packer в Ubuntu с помощью Ansible

Ansible устанавливается стандартно из репозитория Ubuntu:

  1. sudo apt update
  2. sudo apt install ansible
  3. Нажать Y для подтверждения установки Ansible.

Ниже приведен файл install_packer.yml содержащий Ansible Playbook.

@teterkin
teterkin / MakeSlideShow.sh
Created February 2, 2021 12:49
Simple utility to create Ubuntu 20.10 XML file for slideshow from all the images in given folder.
#!/bin/bash
# MakeSlideShow.sh - Simple utility to create Ubuntu 20.10 XML file for slideshow from all the images in given folder.
#
# Note! You will need gnome-tweaks app to add your XML
# as your wallpaper slideshow (Appearance > Background > Image)
# or as your lock screen slideshow (Appearance > Lock Screen > Image).
#
# Change WDIR, XMLFile and WPFolder variables to fit your environment:
# - WDIR - directory for your XML file and backups.
@teterkin
teterkin / deploy.sh
Created December 5, 2020 21:06
Get the code, install dependencies and start the application
#!/bin/bash
echo -----------------------------------------------------
echo Installing Dependancies and Deploying the Application
echo -----------------------------------------------------
CHECK=$(ps -ef | grep -v grep | grep -c puma)
if [ "$CHECK" -ge 1 ]; then
echo "Puma is running already. Exiting..."
exit 0
@teterkin
teterkin / install_mongodb.sh
Last active December 7, 2020 17:54
MongoDB 3.2 installation
#!/bin/bash
echo -------------------------------
echo Installing and Starting MongoDB
echo -------------------------------
sudo rm /etc/apt/sources.list.d/mongodb*.list
sudo apt install apt-transport-https
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv D68FA50FEA312927 && \
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list && \
@teterkin
teterkin / install_ruby.sh
Created December 5, 2020 21:01
Ruby installation
#!/bin/bash
echo ---------------------------
echo Installing Ruby and Bundler
echo ---------------------------
sudo apt update && \
sudo apt install -y ruby-full ruby-bundler build-essential && \
ruby -v && \
bundler -v

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@teterkin
teterkin / latency.txt
Created October 5, 2020 04:19 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD