Skip to content

Instantly share code, notes, and snippets.

View MeenachiSundaram's full-sized avatar

MeenachiSundaram V MeenachiSundaram

View GitHub Profile
@MeenachiSundaram
MeenachiSundaram / docker-compose.yml
Created September 15, 2023 10:57
traefik issue
version: "3.9"
########################### NETWORKS
# You may customize the network subnet (192.168.90.0/24) below as you please.
# Docker Compose version 3.5 or higher required to define networks this way.
networks:
default:
driver: bridge
t2_proxy:
@MeenachiSundaram
MeenachiSundaram / digitalocean-userdata-docker-compose-script.sh
Last active March 4, 2021 21:04
DigitalOcean userdata(startup script) for Docker and Docker Compose Installation
#!/bin/bash
# Docker
curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh
# Docker Compose
compose_release() {
curl --silent "https://api.github.com/repos/docker/compose/releases/latest" |
grep -Po '"tag_name": "\K.*?(?=")'

SCREEN Quick Reference

Getting in

Description Command
start a new screen session with session name screen -S
list running sessions/screens screen -ls
attach to a running session screen -x
attach to session name screen -r
@MeenachiSundaram
MeenachiSundaram / Helpful_Unix_Commands.md
Last active July 21, 2021 13:55
Helpful Unix Commands

Combining multiple Files

Method 1

    head -n1 file1.txt > combined.txt
    for fname in *.txt
    do
        tail -n+3 $fname >> combined.txt
    done

Method 2

@MeenachiSundaram
MeenachiSundaram / Readme.md
Created October 13, 2018 17:32
docker setup
@MeenachiSundaram
MeenachiSundaram / startup.sh
Last active December 29, 2023 17:43
startup script for installing docker in GCP
#!/bin/bash
apt-get update
apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
@MeenachiSundaram
MeenachiSundaram / k8s-user-data.sh
Last active December 27, 2018 06:04 — forked from initcron/k8s-user-data.sh
kubernetes user data script
#!/bin/bash
apt-get update
apt-get install -y git wget
# Install Docker
apt-get install \
apt-transport-https \
ca-certificates \
curl \
@MeenachiSundaram
MeenachiSundaram / Readme.md
Last active February 15, 2018 16:46
Screen Cheat Cheet

Functions and Commands

Function Command
New Window ctrl a+c
Set Window name ctrl a+Shift A
Show All Window ctrl a+w
Switch to windows ctrl a+1|2|...n
Choose Window ctrl a+"
Switch between prev Window ctrl a+ctrl a
@MeenachiSundaram
MeenachiSundaram / grep for file with file path and line number.md
Last active February 6, 2018 10:48
How do I find all files containing specific text on Linux using grep?

Checking for the file using pattern match

grep -rnw '/path/to/somewhere/' -e 'pattern'
  • -r or -R is recursive,
  • -n is line number, and
  • -w stands for match the whole word.
  • -l (lower-case L) can be added to just give the file name of matching files.
@MeenachiSundaram
MeenachiSundaram / entrypoint.sh
Last active January 25, 2018 10:47
grav docker file with multiple domain entrypoint
#!/bin/bash
for file in $( ls /etc/nginx/sites-available/ )
do
#mkdir -p /home/grav/domains/$file
unzip -q /home/grav/grav-admin.zip -d /tmp/
mv /tmp/*grav* /home/grav/domains/$file
ln -sF /etc/nginx/sites-available/$file /etc/nginx/sites-enabled/$file
done