Skip to content

Instantly share code, notes, and snippets.

@nohtyp
nohtyp / update_autoscaling_group.py
Created April 12, 2020 07:23
To update launch configurations using a script, this is a prototype of the script.
#!/usr/bin/env python3
import sys
import re
import os
import boto3
ssm_client = boto3.client('ssm')
@nohtyp
nohtyp / copy_launch_configurations.py
Last active April 12, 2020 07:21
This gist is for copying the launch configurations of an existing launch configuration in AWS.
#!/usr/bin/env python3
import boto3
import argparse
def create_launch_configuration(lcargs):
lc_dict = {}
try:
@nohtyp
nohtyp / .sh
Created November 21, 2019 14:36
curl_vcenter_rest_api
curl -X POST --header 'Content-Type: application/json' --header 'Accept: application/json' --header 'vmware-use-header-authn: test' --header 'vmware-api-session-id: null session' 'https://<vcenter>/rest/com/vmware/cis/session' -k -u <username>
@nohtyp
nohtyp / vagrant_iam
Created October 24, 2019 09:58
This script will allow use of Iam roles with vagrant.
#!/usr/bin/env python3
import os
import subprocess
import json
import sys
iam_output = subprocess.check_output(["curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/<role name>], shell=True)
#print(iam_output)
@nohtyp
nohtyp / rpm_build_script.sh
Last active June 25, 2018 01:28
Jenkins RPM build script
#!/bin/bash -x
NEWSPEC_FILE=$RPM_BUILD_DIR/$NEWSPEC_PATH/$NEWSPEC_FILE
APP_DIR=$APP_DIR
TEMP_FILES='install_dirs files'
URL=$URL
DELETE_DIRS=../delete_dirs
SOURCE_DIR=$RPM_BUILD_DIR/$NEWSPEC_SOURCE
SUMMARY=$SUMMARY
LICENSE=$LICENSE
@nohtyp
nohtyp / geminabox.service
Created May 25, 2018 13:26
Geminabox systemd service script
[Unit]
Description=Geminabox
After=network.target
[Service]
User=geminabox
ExecStart=/usr/local/bin/rackup /etc/geminabox/config.ru -o 0.0.0.0
ExecStop=/bin/kill $(ps -ef |grep puma|grep -v grep | awk -F ' ' '{print $2}')
[Install]
@nohtyp
nohtyp / systemd_atlassian.service
Created May 25, 2018 13:25
Atlassian application systemd scripts
[Unit]
Description=<Application Name>
After=network.target
[Service]
Type=forking
User=<Application User>
ExecStart=<Path to Applications startup script>
ExecStop=<Path to Applications stop script>
@nohtyp
nohtyp / getReleaseDateofVersion.sil
Created May 24, 2018 22:57
This Gist wll get the releasedate for the version in the fixversions field in Jira and returns dueDate if not available.
//Gather due date based on fixed version or issue due date
string getvers;
if (isNull(fixVersions)) {
return dueDate;
}
else {
getvers = fixVersions;
return admGetProjectVersion(project, getvers).releaseDate;
@nohtyp
nohtyp / comment.sil
Last active May 24, 2018 18:34
Jira SIL code to get x comments from issue
// This is the name of the column "Latest comments SIL" code will need to be optimized (first sil script)
int lastnumOfComments = 3;
string [] allcmt;
number [] allCommentIds = getAllCommentIds(key);
int t = 0;
int arrsize;
int mcomments;
if (!isNull(allCommentIds)) {
if (size(allCommentIds) < lastnumOfComments){
@nohtyp
nohtyp / migrate.sh
Last active August 29, 2015 14:18
This is a gist (not finished) that will migrate vm's for KVM to a different host with shared lvm's. This is currently a proof of concept for a VRTX system.
#!/bin/bash
#####################################
# Written By: Thomas Foster #
# Date: 04/02/2015 #
#####################################
#This script will automate the process of moving a vm from
#one host to the other using saved states. I don't know how
#useful the script can be for larger vm's but I am writing this