Skip to content

Instantly share code, notes, and snippets.

View vpatel95's full-sized avatar

Ved Patel vpatel95

View GitHub Profile
@vpatel95
vpatel95 / build_image.sh
Last active November 7, 2024 19:43
Build custom ubuntu image
#!/bin/bash
SOURCE_IMG=jammy-server-cloudimg-amd64.img
IMG_TEMPLATE_INTR=template-v1-intermediate.qcow2
IMG_TEMPLATE=template-v1.qcow2
IMG_TEMPLATE_VMDK=template-v1.vmdk
TEMPLATE_SZ=20G
DIR=`pwd`
if [[ ! -f ${DIR}/${SOURCE_IMG} ]]
@vpatel95
vpatel95 / tunnel_pkt.py
Created January 24, 2024 02:06
Send different tunneled packets using scapy
#!/usr/bin/python3
import os
import sys
import string
from scapy.all import *
from scapy.contrib.mpls import *
from scapy.layers.vxlan import *
import argparse
@vpatel95
vpatel95 / pre-commit.sh
Last active November 14, 2024 20:50
Pre-commit hook for C/C++ code format enforcement using clang-format
#!/bin/bash
# Print an introduction line in cyan
printf "\033[0;36mPre-commit hook is linting your changes for C/CPP code...\033[0m \n"
# Grab feed of staged cppfiles
cppfiles=$(git diff --name-only --cached --diff-filter=ACMRT | \
grep ".*\.\(c\|cc\|cpp\|h\|hh\|hpp\)$" )
numfiles=$( printf '%s' "$cppfiles" | grep -c '^' )
@vpatel95
vpatel95 / machine_setup.sh
Created April 8, 2020 19:56
Create tmux sesison with custom setup
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage : $0 <session_name> <machine_type>"
exit 1
fi
session="$1"
machine="$2"