Skip to content

Instantly share code, notes, and snippets.

View briskgopesh's full-sized avatar
✌️
Talent wins games, but teamwork and intelligence wins championships.

GOPESH CHAUDHARY briskgopesh

✌️
Talent wins games, but teamwork and intelligence wins championships.
  • Verloop.io
View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: netshoot
labels:
app: netshoot
spec:
containers:
- image: nicolaka/netshoot
command:
apiVersion: v1
kind: Pod
metadata:
name: ubuntu
labels:
app: ubuntu
spec:
containers:
- image: ubuntu
command:
@briskgopesh
briskgopesh / redis-migrate.sh
Created June 5, 2024 17:54 — forked from nicStuff/redis-migrate.sh
Comfort tool for migrating redis keys among instances. Supports KEYS syntax matching, authentication and TTL
#!/bin/bash
######
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
######
@briskgopesh
briskgopesh / install-AzCopy.sh
Created November 10, 2023 09:39 — forked from aessing/install-AzCopy.sh
Install AzCopy on Linux
#!/bin/bash
# =============================================================================
# Install AzCopy on Linux
# https://docs.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-v10
# https://github.com/Azure/azure-storage-azcopy
# -----------------------------------------------------------------------------
# Developer.......: Andre Essing (https://www.andre-essing.de/)
# (https://github.com/aessing)
# (https://twitter.com/aessing)
# (https://www.linkedin.com/in/aessing/)
@briskgopesh
briskgopesh / kubedf
Created May 10, 2023 14:15 — forked from redmcg/kubedf
Bash script to show k8s PVC usage
#!/usr/bin/env bash
NODESAPI=/api/v1/nodes
function getNodes() {
kubectl get --raw $NODESAPI | jq -r '.items[].metadata.name'
}
function getPVCs() {
jq -s '[flatten | .[].pods[].volume[]? | select(has("pvcRef")) | '\
@briskgopesh
briskgopesh / jq-insert-var.sh
Created February 17, 2023 20:18 — forked from joar/jq-insert-var.sh
Add a field to an object with JQ
# Add field
echo '{"hello": "world"}' | jq --arg foo bar '. + {foo: $foo}'
# {
# "hello": "world",
# "foo": "bar"
# }
# Override field value
echo '{"hello": "world"}' | jq --arg foo bar '. + {hello: $foo}'
{
@briskgopesh
briskgopesh / Mac SSH Autocomplete
Created January 11, 2023 10:07 — forked from aliang/Mac SSH Autocomplete
Add auto complete to your ssh, put into your .bash_profile
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@briskgopesh
briskgopesh / snat_dnat_advantech.md
Created November 3, 2022 13:24 — forked from tomasinouk/snat_dnat_advantech.md
examples of SNAT, DNAT with iptables for Advantech, Conel routers, with comments (probably will work on other routers where iptables can be manipulated, care needs to be taken on applying these commands after reboot).

Some examples of SNAT, DNAT with iptables with comments

mainly used in start-up script

How to test 'safely'

When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.

How to:

  • Enable reboot via SMS.
  • Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.

masquarade all outgoing packets to be WLAN0 IP

@briskgopesh
briskgopesh / Dockerfile
Created July 18, 2022 08:47 — forked from jaso514/Dockerfile
Dockerfile to create container with mongodb and python
# Dockerizing Python and MongoDB
# Based on ubuntu:latest, installs MongoDB following the instructions from:
# http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/
# INSTRUCTIONS:
# - Create the contianer:
# > docker build -t ubuntu_pymongo .
# - Create a folder to share your project in your host with the container. Ex: ~/shared
# - Run the next command (need the route of the created shared folder), this command access to the bash of container:
# > docker run -v /c/Users/Jhonny/Documents/vm_share/mongoDB/shared:/data/code -t -i -p 27019:27017 ubuntu_pymongo
# - To open another bash console run the command:
@briskgopesh
briskgopesh / awscli-pex.md
Created June 8, 2021 12:49 — forked from robbwagoner/awscli-pex.md
AWS CLI with PEX

What is PEX?

build with Docker image... e.g. Ubuntu 14.04

$ docker run --rm -it -v $PWD:/src -w /src ubuntu:14.04

Install PEX