Skip to content

Instantly share code, notes, and snippets.

@vedit
vedit / kubernetes_pod_grafana.json
Last active October 31, 2023 18:22
Kubernetes Pod Usage Dashboard Grafana Dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "prometheus",
"uid": "I8fIWFcVz"
},
"enable": true,
#!/bin/bash
cupsfilter ${1} > ${1}.pdf
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -dPDFSETTINGS=/prepress -sOutputFile=merged2.pdf ${1}.pdf merged.pdf
mv merged2.pdf merged.pdf
rm ${1}.pdf
@vedit
vedit / awspr
Last active September 11, 2021 08:45
AWS Profile Selector
#!/bin/bash
export AWS_PROFILE=$(zenity --list $(cat ~/.aws/config | grep profile | sed 's/profile //g' | sed 's/\[//g' | sed 's/\]//g' | sort) --column="" --text="Select a Profile" --title="AWS Profile Selection")
echo "${AWS_PROFILE}"
# Call the script with either "source awspr" or ". awspr" after placing the script in your path and making it executable
# Or add an alias by adding the following line to your .bashrc
# alias awsp=". awspr"
@vedit
vedit / php-syntax-check.sh
Created June 10, 2020 13:58
PHP Syntax Checker Script
#!/bin/bash
docker run -t -v "$PWD":/usr/src/ci -w /usr/src/ci php:7.2-cli bash -ec "find . -path ./vendor -prune -o -type f -iname '*.php' | xargs -I{} sh -c 'php -l {} || true'" | grep 'Parse error' && exit 1

Keybase proof

I hereby claim:

  • I am vedit on github.
  • I am vedit (https://keybase.io/vedit) on keybase.
  • I have a public key ASB4rc39WuFCIK0AYByhxRDkoYpAvH7oSKUrV_0kZyo5ygo

To claim this, I am signing this object:

@vedit
vedit / mysql_backup_to_azure_blob.sh
Last active July 24, 2017 14:41 — forked from stiucsib86/gist:ebff282a3989f9a24117
Backup MySQL dump to Azure Blob Storage
#!/bin/sh
export BACKUP_FILE=/opt/backup/db-backup.sql.gz
export DATABASE_SCHEMA_NAME=--all-databases
export AZURE_CONTAINER=YOUR_VALUE_HERE
export AZURE_NAME=YOUR_VALUE_HERE
export AZURE_KEY=YOUR_VALUE_HERE
export INSTANCE_NAME=YOUR_VALUE_HERE
export AZURE_BLOB_NAME=${INSTANCE_NAME}-$(date +%Y%m%d%H%M%S).sql.gz
export AZURE_BLOB_NAME_LATEST=${INSTANCE_NAME}-latest.sql.gz
@vedit
vedit / gist:ec8b9b16d403a0dd410791ad62ad48ef
Last active July 24, 2017 16:19 — forked from jamesonjlee/gist:11271979
dynamodb local setup
#!/bin/bash
DYNAMODB_USER=vagrant
sudo apt-get install openjdk-7-jre-headless -y
cd /home/${DYNAMODB_USER}/
mkdir -p dynamodb
cd dynamodb
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select