Skip to content

Instantly share code, notes, and snippets.

View karthick-kk's full-sized avatar
💣
Diffusing

karthick-kk

💣
Diffusing
View GitHub Profile
@karthick-kk
karthick-kk / verascan.sh
Created April 26, 2022 14:24
Veracode Scan Script (For use in CI/CD)
#!/bin/bash
id=""
secretKey=""
appid=""
java -jar vosp-api-wrappers-java-22.3.9.4.jar -action uploadandscan -vid $id -vkey $secretKey -appname MDM_UMPI -createprofile true -version 19.6.5.21 -filepath mdm_umpi-tst.zip > analyzeResults
cat analyzeResults
java -jar vosp-api-wrappers-java-22.3.9.4.jar -vid $id -vkey $secretKey -appid $appid -action GetBuildInfo > buildResults
@karthick-kk
karthick-kk / run-wsl-previewbuild.md
Created March 24, 2022 13:00
Windows 10 Insider Preview - WSL TimeTravel

Run in Powershell with Elevated Priviledges

Set-Date -Date (Get-Date).AddDays(-365)
wsl -e date
W32tm /resync /force

Run wsl to continue working on the Linux subsystem

@karthick-kk
karthick-kk / step-ca.md
Last active January 31, 2022 12:38
Step-ca cert handler for local domains

Step-CA

==== Install Step/Step-ca Binaries ====

wget -O step.tar.gz https://dl.step.sm/gh-release/cli/docs-ca-install/v0.18.0/step_linux_0.18.0_amd64.tar.gz
tar -xf step.tar.gz
sudo cp step_0.18.0/bin/step /usr/bin

wget -O step-ca.tar.gz https://dl.step.sm/gh-release/certificates/docs-ca-install/v0.18.0/step-ca_linux_0.18.0_amd64.tar.gz
tar -xf step-ca.tar.gz
# Source: https://gist.github.com/38fe5617f9c38125f0213d442d9ab4c9
#############################################################
# How To Secure Kubernetes Clusters With Kubescape And Armo #
# https://youtu.be/ZATGiDIDBQk #
#############################################################
# Additional Info:
# - Kubescape: https://hub.armo.cloud
@karthick-kk
karthick-kk / WSL2_Docker_Setup.md
Created January 8, 2022 09:44
WSL2 Docker Setup

Install Docker

sudo apt update
sudo apt install docker.io -y

Setup Permissions

kk ALL=(ALL) NOPASSWD: ALL // visudo
sudo usermod -a -G docker $USER
@karthick-kk
karthick-kk / install-golang-apt-get.sh
Created December 22, 2021 17:38 — forked from Adron/install-golang-apt-get.sh
Installing golang via apt-get
sudo add-apt-repository ppa:ubuntu-lxc/lxd-stable
sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install golang
# Usually this is good to install golang, but alas the apt-get repo is usually out of sync with the latest.
@karthick-kk
karthick-kk / scp.py
Created December 9, 2021 18:22
Python SCP Files
from paramiko import SSHClient
from scp import SCPClient, SCPException
ssh = SSHClient()
ssh.load_system_host_keys()
ssh.connect('172.31.144.1', port=2250, username='kk')
with SCPClient(ssh.get_transport(), sanitize=lambda x: x) as scp:
try:
scp.get(remote_path='/home/kk/*', local_path='.', recursive=False)
@karthick-kk
karthick-kk / git-clearHistory
Created November 28, 2021 18:01 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git
@karthick-kk
karthick-kk / getjenkinsbuilds.sh
Created July 6, 2021 09:02
Bash script to retrieve number of jenkins builds happened in last 'n' days
#!/bin/bash
#
while getopts u:p:j:d: flag
do
case "${flag}" in
u) user=${OPTARG};;
p) pass=${OPTARG};;
j) url=${OPTARG};;
d) daystobuild=${OPTARG};;
@karthick-kk
karthick-kk / fixtask.yml
Created July 1, 2021 14:14
fix playbook
---
- hosts: all
become: true
handlers:
- name: restart ssh
service: name=sshd state=restarted
tasks:
# Use secure and encrypted communication.