Skip to content

Instantly share code, notes, and snippets.

View vigindian's full-sized avatar
🎯
Focusing

Vignesh vigindian

🎯
Focusing
View GitHub Profile
@vigindian
vigindian / lxc_container_new.sh
Created April 27, 2023 06:49
lxc scripts to create new container and take container snapshot
#!/bin/bash
###############################################
# lxc: Script to create a new Ubuntu container
#
# Vignesh Narasimhulu
###############################################
#Validate user
user=$(whoami)
if [ $user != "root" ];then
@vigindian
vigindian / git_untrack_ignoredfiles
Created April 27, 2023 06:43
Remove files from git repo, that have been added to .gitignore after git upload
#remove files from git repo, that have been added to .gitignore after git upload
git rm -r --cached . && git add . && git commit -am "Remove ignored files"
git push
@vigindian
vigindian / install_gvm20.sh
Created April 27, 2023 06:35
Install GVM v20 on Ubuntu 20
#!/bin/bash
##########################################################################
# Install GVM v20 on Ubuntu
#
# VN
#
# Reference: https://kifarunix.com/install-and-setup-gvm-20-08-on-ubuntu/
##########################################################################
@vigindian
vigindian / certs_convert_format.sh
Created April 27, 2023 06:21
Convert Certificates to different formats
#pem to pfx with empty export password: IIS first-time import cert
openssl pkcs12 -export -out yourcert.pfx -inkey yourpemkey.key -in yourcrt.crt -passout pass:
#cer/pem to pfx without private-key and with empty export password:
openssl pkcs12 -export -nokeys -in yourcer.cer -out yourpfx.pfx -passout pass:
#pem to p7b: IIS existing cert renewal
openssl crl2pkcs7 -nocrl -certfile _.yourpem.pem -out yourp7b.p7b -certfile /etc/ssl/certs/ca-certificates.crt
#if pfx is password-protected: this command will prompt for the pfx password and will convert to pem
@vigindian
vigindian / keycloak_upgrade.sh
Created April 27, 2023 06:11
Keycloak Upgrade script
#!/bin/bash
##################################################################
# Keycloak Upgrade Script
#
# VN
#
# Assumptions:
# - soft-link with name "current" exists to live keycloak folder
# - keycloak uses postgresql backend
@vigindian
vigindian / grafana-exporter.sh
Last active May 3, 2023 23:20
Grafana dashboards export script
#!/bin/bash
#####################################################
# Script to export Grafana dashboards
#
# Vignesh Narasimhulu
#
#####################################################
#get today's date
today=$(date +%Y%m%d)
@vigindian
vigindian / nagios-msteams.pl
Created April 27, 2023 05:50
Nagios MSTeams Notification Script
#!/usr/bin/perl
#
# Nagios MSTeams Notification Script
# You can auto-trigger this script for specific alerts, to get notified in the teams channel of your choice
#
# Setup:
# - Setup msteams webhook
# - Add your webhook URI to this script
# - Setup auto-trigger of this script for specific nagios alerts
@vigindian
vigindian / ubuntu_update.sh
Created April 27, 2023 05:43
Ubuntu update/upgrade scripts
#!/usr/bin/env bash
##########################################################################################################
#
# Ubuntu OS Patching
#
# VN
# v1.0 202010
#
# Upgrade packages: $0 -uU
# Fix dependency issues: $0 -d