Skip to content

Instantly share code, notes, and snippets.

View krzysbaranski's full-sized avatar

Krzysztof Baranski krzysbaranski

View GitHub Profile
@krzysbaranski
krzysbaranski / javaee-tools.md
Last active May 31, 2016 19:50
java ee dev tools
- description: ''
executionEnabled: true
id: 823c1c31-6b06-493c-a859-d09cc4891954
loglevel: INFO
name: key_value_data_recieve
nodeFilterEditable: false
options:
- name: referenceTime
required: true
- name: timeShift
- description: ''
executionEnabled: true
id: 829fa3fe-86af-423a-a308-d7422df37dec
loglevel: INFO
name: key_value_data
nodeFilterEditable: false
nodefilters:
dispatch:
excludePrecedence: true
keepgoing: false
@krzysbaranski
krzysbaranski / jdk8_install.sh
Created September 14, 2017 18:15
Java JDK 8 install
#!/usr/bin/env bash
exec 1> >(logger -s -t $(basename $0)) 2>&1
set -x
DOWNLOAD_DIR="/tmp/software/"
JDK_HOME="/opt/jdk8"
OUT_FILENAME="jdk-linux-x64.tar.gz"
URL="http://download.oracle.com/otn-pub/java/jdk/8u144-b01/090f390dda5b47b9b721c7dfaa008135/jdk-8u144-linux-x64.tar.gz"
if [ -f "${JDK_HOME}/bin/java" ]; then
VERSION=`${JDK_HOME}/bin/java -version 2>&1|head -n 1`
if [[ ${VERSION} == *"1.8.0_144"* ]]
#!/bin/bash
export RD_URL='http://localhost:4440'
export RD_TOKEN="@option.rundeck_token@"
export CURRENT_DATE=$(date -u -d now "+%Y-%m-%d %H:%M:%S")
echo "${CURRENT_DATE} starting job"
echo "[email protected]_time@"
echo "[email protected]_time@"
RUN_JOB_ID="xxxxx-xxxx-xxxxx-xxxx"
PROJECT="rundeck-project"
#!/bin/python
import requests
import xml.etree.ElementTree as ET
import time
import sys
from datetime import datetime
class RundeckDelete:
API_KEY = ''
EXPIRE_DAYS = 50
@krzysbaranski
krzysbaranski / rundeck_delete_bulk.sh
Created November 8, 2019 17:02
rundeck delete bulk
#!/bin/bash
export RD_URL='http://localhost:4440'
export RD_TOKEN="@option.rundeck_token@"
export CURRENT_DATE=$(date -u -d now "+%Y-%m-%d %H:%M:%S")
echo "Bulk delete of executions for frequent jobs"
for run in {1..5}
do
echo "deleting jobs older than 14 days - iteration ${run}"
#!/bin/bash
echo "rundeck logs compression and cleanup..."
set -exp
find /var/log/rundeck -name "rundeck.*.log.$(date -u +%Y-%m)-??" -exec xz -v {} \;
find /var/log/rundeck -name "rundeck.*.log.$(date -u -d "-1 month" +%Y-%m)-??" -exec xz -v {} \;
find /var/log/rundeck -name "rundeck.*.log.$(date -u -d "-2 month" +%Y-%m)-*" -exec rm -v {} \;
echo "Done"