Skip to content

Instantly share code, notes, and snippets.

View olen2006's full-sized avatar
🐙
https://youtu.be/TulBh6klMuU

General Zod olen2006

🐙
https://youtu.be/TulBh6klMuU
  • Solar System, Earth
View GitHub Profile
@olen2006
olen2006 / deploy-nexus.yml
Created May 9, 2022 08:46
Play to deploy nexus
---
#Deploy Nexus
- name: Install java and net-tools
hosts: nexus
tasks:
- name: Update yum repo and cache
yum: update_cache=yes name=* state=latest lock_timeout=3600
- name: Install Java 8
yum:
@olen2006
olen2006 / install_python.sh
Last active January 6, 2023 07:39
bash scipt that installs desired/latest python. if no value entered, default version is installed.
#!/bin/bash
########################################
# install latest python version
# into /usr/bin/
# with all neccessary packages
########################################
def_version="3.11.1"
py_dir="python_installation"
@olen2006
olen2006 / terraform_auto_update.sh
Last active March 23, 2021 07:21
script checks and installs latest version of terraforom
#!/bin/bash -xe
CURRENT_VER=$(terraform --version | head -n1 | cut -d " " -f2 | cut -c 2-)
LATEST_RELEASE=$(curl -s https://api.github.com/repos/hashicorp/terraform/releases/latest | jq --raw-output '.tag_name' | cut -c 2-)
if [[ $CURRENT_VER < $LATEST_RELEASE ]];
then
echo "Installing Terraform ${LATEST_RELEASE}..."
rm terraform-*
rm terraform
wget https://releases.hashicorp.com/terraform/${LATEST_RELEASE}/terraform_${LATEST_RELEASE}_linux_amd64.zip
@olen2006
olen2006 / user_data.sh
Last active March 17, 2021 06:02
user data for amazon linux 2 to install node, codedeploy-agent, update packages
#!/bin/bash -xe
# writing logs into user-data.log instead of cloud-init-output.log during boot
exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1
REGION_ID=`ec2-metadata --availability-zone | awk '{print $2}' | sed 's/.$//'`
yum update -y
yum install -y ruby
curl -O https://aws-codedeploy-${REGION_ID}.s3.${REGION_ID}.amazonaws.com/latest/install
@olen2006
olen2006 / aws-cf-logs
Created May 12, 2019 01:40 — forked from shapeshed/aws-cf-logs
Fetch AWS Cloudfront Logs, decompress, combine into a single file and remove comments
#!/usr/bin/env bash
BUCKET=$1
CWD=$(pwd)
if [[ -n $1 ]]; then
aws s3 sync s3://$BUCKET/cf-logs .
cat *.gz > combined.log.gz
find $CWD ! -name 'combined.log.gz' -name '*.gz' -type f -exec rm -f {} +
gzip -d combined.log.gz