Skip to content

Instantly share code, notes, and snippets.

View ops-gaurav's full-sized avatar
:octocat:
may the forks be with you

Gaurav Sharma ops-gaurav

:octocat:
may the forks be with you
View GitHub Profile
@ops-gaurav
ops-gaurav / install_nvm_git.sh
Last active June 16, 2021 03:23
install nvm
#!/usr/bin/sh
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash
export NVM_DIR="/home/ubuntu/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# install the node version
nvm install 14.15.4
echo "Installed node version " && node --version
@ops-gaurav
ops-gaurav / deploy-keys.md
Created May 6, 2021 08:29 — forked from holmberd/deploy-keys.md
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@ops-gaurav
ops-gaurav / config.json
Last active March 21, 2021 16:39
Refresh ECR tokens based on config.json. Start app with pm2 start config.json
{
"apps": [
{
"name": "refresh-cron",
"command": "python3 /etc/docker/compose/composeservice/configurations/ecr-refresh-token.py",
"autorestart": true,
"env": {
"REGION": "ap-south-1",
"ENDPOINT": "388364135013.dkr.ecr.ap-south-1.amazonaws.com"
}
@ops-gaurav
ops-gaurav / README.md
Created March 1, 2021 09:40 — forked from mosquito/README.md
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
Requires=docker.service
After=docker.service
@ops-gaurav
ops-gaurav / create-vod-hls.sh
Created April 22, 2020 19:38
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X). Usage: create-vod-hls.sh beach.mkv
#!/usr/bin/env bash
set -e
# Usage create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]
[[ ! "${1}" ]] && echo "Usage: create-vod-hls.sh SOURCE_FILE [OUTPUT_NAME]" && exit 1
# comment/add lines here to control which renditions would be created
renditions=(
# resolution bitrate audio-rate
Kubernetes Deployments
- Minikube disto for kuberntes deployment (locally Linux Mac and Windows) (recommended for development and learning) use cloud for production
- Deployments are high level constructs that define an application
- Pods are instances of a container in a deployment
- Services are the endpoints that export ports to the outside world
Text Lecture: Minikube Setup
Commands
* Linux:
*  
@ops-gaurav
ops-gaurav / sample commands
Created March 28, 2019 09:54
Docker commands for docker
docker rm $(docker ps -a -q)
docker rmi $(docker images -q)
Policy
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:PutObject",
"s3:GetObject"
@ops-gaurav
ops-gaurav / setup-jenkins-ubuntu.sh
Last active March 22, 2018 18:21
Configuring jenkins script
#!/bin/bash
echo "Downloading jenkins...."
wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins -y
echo "Starting jenkins..."
sudo systemctl start jenkins
@ops-gaurav
ops-gaurav / docker-compose.yaml
Last active March 26, 2018 12:06
Docker compose single docker nodejs application on different ports using nginx server. Complete docker stack
# This is the production variant of
# docker deployment for litnite
version: '3'
services:
#built by master branch
litnite-app:
image: index.docker.io/litnite/backend:master
container_name: 'litnite'
ports:
- 3001:3001