Skip to content

Instantly share code, notes, and snippets.

Avatar
🏡
Working from Home

Justin Paul recklessop

🏡
Working from Home
View GitHub Profile
@recklessop
recklessop / sudo_bootstrap.sh
Created Jan 7, 2020
script to add a user to sudoers
View sudo_bootstrap.sh
#!/bin/sh
#
# Script for adding and removing user from /etc/sudoers file used by sudo
# for bootstrapping perl soap framework
# NOTES:
# This code assuming that user being added to sudo file has been already created
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/X11R6/bin:/root/bin
export PATH
View Get-IgniteContent.ps1
# Author Rajesh Sitaraman
# @rjesh | rjesh.com
<#
.SYNOPSIS
Download Ignite 2019 session presentation slides and videos.
.EXAMPLE
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "AI"
.EXAMPLE
PS C:\> .\Get-IgniteContent.ps1 -DownloadPath /Users/rajeshsitaraman/src/public/share/IG-2019 -Keyword "Teams" -IncludeVideos
View Zerto-Ports.md

ZVM Inbound Ports

  • 9989
  • 9969
  • 9779
  • 9080
  • 9081
  • 9000
  • 9180
@recklessop
recklessop / dailystats.py
Last active Feb 21, 2019
multi-threaded daily stats table generator
View dailystats.py
#!/usr/bin/python3
import pymysql.cursors
import threading
import time
import queue
import multiprocessing
exitFlag = 0
@recklessop
recklessop / install.sh
Created Feb 21, 2019
requirements for dailystats.py for zplanner
View install.sh
sudo apt install python3-pip3 -y
sudo pip install pymysql.cursors
@recklessop
recklessop / dailstats.sql
Created Feb 20, 2019
daily stats table structure
View dailstats.sql
-- phpMyAdmin SQL Dump
-- version 4.5.4.1deb2ubuntu2.1
-- http://www.phpmyadmin.net
--
-- Host: localhost
-- Generation Time: Feb 20, 2019 at 04:11 PM
-- Server version: 5.7.24-0ubuntu0.16.04.1
-- PHP Version: 7.0.32-0ubuntu0.16.04.1
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
@recklessop
recklessop / dailystats.php
Last active Feb 20, 2019
dailystats.php for zplanner
View dailystats.php
<?php
$connect = mysqli_connect("localhost","root","Zertodata1!");
mysqli_select_db($connect,"zerto"); //select the table
$query = "SELECT name FROM `vms` WHERE monitor = 'Y'";
$vms = mysqli_query($connect, $query) or die (mysqli_error($connect));
$query = "SELECT datestamp FROM `stats` GROUP BY datestamp DESC";
$dateresult = mysqli_query($connect, $query) or die (mysqli_error($connect));
@recklessop
recklessop / netplan-nic-cfg.py
Last active Sep 23, 2019
netplan-nic-cfg.py
View netplan-nic-cfg.py
#!/usr/bin/python3
import yaml
import psutil
# function to validate it an IP address is real, or NA to skip (used for NS2)
def validate_ip(s):
if s.upper() == "NA":
return True
a = s.split('.')
@recklessop
recklessop / Wireguard-Notes
Last active Jan 28, 2019
Wireguard Notes
View Wireguard-Notes
One step keygen:
umask 077 # This makes sure credentials don't leak in a race condition.
wg genkey | tee privatekey | wg pubkey > publickey
Manual steps:
wg genkey
echo <private key> | wg pubkey
---------------------------------------------------------------------------
wg.conf
View gist:c3418b24e50e0e94ac1e33e55a843f7a

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream