Skip to content

Instantly share code, notes, and snippets.

View syedmhashim's full-sized avatar

Syed Muhammad Hashim syedmhashim

View GitHub Profile
@syedmhashim
syedmhashim / docker-compose.yaml
Last active February 29, 2024 06:41
Serve static build using nginx
version: '3.1'
services:
web:
image: nginx
volumes:
- $PWD:/usr/share/nginx/html
- $HOME/mystuff/docker/nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- "8080:80"
@syedmhashim
syedmhashim / Dockerfile
Created May 11, 2023 06:43
DB OPS (DUMP & RESTORE)
FROM mysql:8.0
# MODE can be restore or dump
ENV MODE=dump
ENV MYSQL_DATABASE=ghostdb
ENV MYSQL_PWD=password
ENV MYSQL_USER=ghost_admin
ENV MYSQL_HOST=127.0.0.1
@syedmhashim
syedmhashim / dind.docker-compose.yaml
Created May 10, 2023 09:03
Run docker commands in a docker container with your current directory mounted into the container
version: "3.3"
services:
docker:
image: docker:20.10.16
restart: always
volumes:
- $PWD:/home/
environment:
- DOCKER_TLS_VERIFY=
- DOCKER_TLS_CERTDIR=
@syedmhashim
syedmhashim / dockerscp
Created May 10, 2023 08:34
Script for transferring a docker image to multiple private servers with no internet access
#!/bin/bash
print_usage() {
echo "
////////////////////////////////////////////////////////////////////////////////////////////
* Script for transferring docker image to multiple private servers with no internet access *
///////////////////////////////////////////////////////////////////////////////////////////
Usage:
@syedmhashim
syedmhashim / kill_process
Last active May 16, 2023 12:07
Kill a process which has a specific pid or is running on a specific port
#!/bin/bash
print_usage() {
echo "
////////////////////////////////////////////////////////////////////////////////////
* Kill a process which has a specific pid or is running on a specific port *
///////////////////////////////////////////////////////////////////////////////////
Usage:
@syedmhashim
syedmhashim / kube_remove_finalizers
Created May 10, 2023 08:30
Remove finalizers from kubernetes resources based on grep patterns or name of the resource
#!/bin/bash
print_usage() {
echo "
//////////////////////////////////////////////////////////////////////////////////////////////
* Remove finalizer from kubernetes resources based on grep patterns or name of the resource *
//////////////////////////////////////////////////////////////////////////////////////////////
Usage:
@syedmhashim
syedmhashim / kube_delete
Last active May 10, 2023 08:32
Delete kubernetes resources based on grep patterns
#!/bin/bash
print_usage() {
echo "
///////////////////////////////////////////////////////
* Delete kubernetes resources based on grep patterns *
//////////////////////////////////////////////////////
Usage: