Skip to content

Instantly share code, notes, and snippets.

@xman1980
xman1980 / gist:baa2493a418cab9f20830ccbb3af9de1
Created January 15, 2024 15:04
domain SSL cert checker | bash script
#!/bin/bash
DOMAINS="nodes.txt"
RECIPIENT="admin@aol.com"
DAYS="14"
# Mailgun settings
MAILGUN_API_KEY=""
MAILGUN_DOMAIN=""
MAILGUN_URL="https://api.mailgun.net/v3/$MAILGUN_DOMAIN/messages"
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod
#!/usr/bin/python
import sys
from cm_api.api_client import ApiResource
## ** CM Connection Settings ******************************
cm_host = "localhost"
cm_port = "7180"
cm_login = "admin"
cm_password = "admin"
@xman1980
xman1980 / get-yarn-long-running-jobs.py
Created October 28, 2020 12:20 — forked from onefoursix/get-yarn-long-running-jobs.py
Example of using the Cloudera Manager API to poll for YARN health checks and to list long running jobs using a tsquery
#!/usr/bin/python
## ********************************************************************************
## get-yarn-long-running-jobs.py
##
## Usage: ./get-yarn-long-running-jobs.py
##
## Edit the settings below to connect to your Cluster
##
## ********************************************************************************
@xman1980
xman1980 / ycsb_hbase.sh
Last active September 7, 2020 12:30 — forked from ashrithr/ycsb_hbase.sh
YCSB stress test hbase commands
#!/usr/bin/env bash
#
# Simulates mixed workload on HBase using YCSB
# Author: Ashrith (ashrith at cloudwick dot com)
# Date: Wed, 16 2014
#
#
# You may want to tweak these variables to change the workload's behavior
#
@xman1980
xman1980 / airflow-python3.sh
Created November 12, 2019 12:55 — forked from zacgx/airflow-python3.sh
Installing Airflow with CeleryExcuter, using PostgreSQL as metadata database and Redis for Celery message broker
# this script has been tested and worked in a freshly installed Ubuntu 16.04 and 16.10
# it assumes that you are running airflow in a private netowrk and no need to be worry about outside access
# if that's not the case, the lines for PostgreSQL and Redis in this script need to be updated accordingly
# run as root
sudo su
# initial system updates and installs
apt-get update && apt-get upgrade -y && apt-get autoremove && apt-get autoclean
apt-get -y install build-essential binutils gcc make git htop nethogs tmux
@xman1980
xman1980 / DisablingServicesOnServer2016wDE.ps1
Created November 4, 2019 12:38 — forked from xtratoast/DisablingServicesOnServer2016wDE.ps1
Disable unnecessary services that on Windows Server 2016 Desktop Experience (based on MS Security Blog recommendations)
# Disable extraneous services on Server 2016 Desktop Experience
# https://blogs.technet.microsoft.com/secguide/2017/05/29/guidance-on-disabling-system-services-on-windows-server-2016-with-desktop-experience/
Configuration DisablingServicesOnServer2016wDE
{
param(
[String]$ComputerName = "localhost",
[ValidateSet('ShouldBeDisabledOnly','ShouldBeDisabledAndDefaultOnly','OKToDisable','OKToDisablePrinter','OKToDisableDC')]
[String]$Level = 'OKToDisable'
)
@xman1980
xman1980 / arangobackup-s3.sh
Created October 8, 2019 18:29
backup arangodb to S3
#!/bin/sh
# Slightly modified to meet ArangoDB's needs. https://github.com/lumerit/s3-shell-backups
NOWDATE=`date +%Y-%m-%d`
LASTDATE=$(date +%Y-%m-%d --date='1 week ago')
USERNAME="${ARANGODB_USERNAME}"
PASSWORD="${ARANGODB_PASSWORD}"
DATABASE='dbname'
@xman1980
xman1980 / entrypoint-from-ssm-env-vars.sh
Created September 17, 2019 20:48 — forked from PeteGoo/entrypoint-from-ssm-env-vars.sh
Helpful SSM Parameter Store scripts
#!/bin/bash
# To use just set a variable with SSM_<target_env_var>=<ssm_parameter_store_path>
# e.g. SSM_database_password=prod/myservice/database-password
function get_parameter {
SSM_ENV_VAR_NAME=$1
ENV_VAR_NAME=`echo "$SSM_ENV_VAR_NAME" | cut -c5-`
SSM_PARAM_NAME="${!SSM_ENV_VAR_NAME}"
@xman1980
xman1980 / elastic_beanstalk_env.tf
Created September 3, 2019 11:02 — forked from msysyamamoto/elastic_beanstalk_env.tf
AWS SSM parameter store sample
resource "aws_elastic_beanstalk_environment" "sample_env" {
setting {
namespace = "aws:elasticbeanstalk:application:environment"
name = "DATASOURCE_PASSWORD"
value = "${data.aws_ssm_parameter.rds_password.value}"
}
}