Skip to content

Instantly share code, notes, and snippets.

@nareshganesan
nareshganesan / pipeline.go
Created August 12, 2021 11:43 — forked from thomaspoignant/pipeline.go
Building a pipeline system in golang
package main
import (
"fmt"
"gopkg.in/yaml.v3"
"io"
"net/http"
)
// PipelineConfig is the representation of a pipeline in the configuration.
@nareshganesan
nareshganesan / delete_git_submodule.md
Created February 26, 2021 18:00 — forked from myusuf3/delete_git_submodule.md
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@nareshganesan
nareshganesan / ubuntu-18.04-pipenv.bash
Last active February 3, 2024 12:17
Ubuntu 18.04 install python3 with pip and pyenv - for multiple python versions
# install dependencies
sudo apt install -y make build-essential \
python3 python-pip libpq-dev python3-dev libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
# pyenv for installing different python versions
git clone https://github.com/pyenv/pyenv.git ~/.pyenv
# export pyenv path for python environments
@nareshganesan
nareshganesan / service-checklist.md
Created July 24, 2018 08:06 — forked from acolyer/service-checklist.md
Internet Scale Services Checklist

Internet Scale Services Checklist

A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."

Basic tenets

  • Does the design expect failures to happen regularly and handle them gracefully?
  • Have we kept things as simple as possible?
@nareshganesan
nareshganesan / ubuntu-install-certbot.bash
Created June 15, 2018 08:19
Ubuntu 16.04 install cerbot / letsencrypt
apt-get update
apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get update
apt-get install python-certbot-nginx
@nareshganesan
nareshganesan / install-go.bash
Created June 15, 2018 05:53
install script for golang (Linux, Mac OS)
#!/bin/bash
err_report() {
echo "Error on line $1"
}
trap 'err_report $LINENO' ERR
usage() {
echo "Usage: $0
@nareshganesan
nareshganesan / linux_screen_cmds.txt
Last active November 5, 2018 06:44
Linux screen shorcuts
# The file contains list of frequently used screen shortcuts
# https://tournasdimitrios1.wordpress.com/2010/11/04/linux-the-screen-command-a-must-for-ssh/
Ctrl - control key
# Create a new screen window (create)
Ctrl-a + c # Press 'control' key and 'a' and followed by 'c'
# or
screen -S namexx
# get the wifi card details using the following command
lspci -vvnn | grep 14e4
# I had BM4360
sudo apt-get update && sudo apt-get install bcmwl-kernel-source
@nareshganesan
nareshganesan / python-version-swap.bash
Last active April 23, 2018 05:54
macOS Sierra installing python 2 and python 3 alongside
brew update
# installs pyenv
brew install pyenv
echo 'eval "$(pyenv init -)"' >> ~/.bash_profile;
# activates pyenv
source ~/.bash_profile
# installs pyenv-virtualenvwrapper
brew install pyenv-virtualenvwrapper
echo 'export PYENV_VIRTUALENVWRAPPER_PREFER_PYVENV="true"'
echo 'export WORKON_HOME=$HOME/.pyenvs'
@nareshganesan
nareshganesan / install-vscode.bash
Created December 6, 2017 15:55
Install vscode Ubuntu 16.04
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list'
# install vs code
sudo apt-get update
sudo apt-get install code # or code-insiders