Jenkins Cleanup Old Builds

I wrote a quick shell script to cleanup old Jenkins builds. This will delete any build older than 30 days. #!/bin/bash # jenkins_delete_old_builds.sh # Author: Steve Stonebraker # Date: 8/5/2019 # Description: Deletes any build older than 30 days # Place in crontab # @daily /bin/bash -x /root/scripts/jenkins_cleanup.sh > /root/scripts/jenkins_cleanup.log find /var/lib/jenkins/jobs/*/builds/ -maxdepth 1 -mindepth... » read more

Apache ProxyPass with dynamic hostname

To use Apache ProxyPass directives with dynamic hostnames you will need to also use ModRewrite. Objective All requests to the virtualhost will ProxyPass and ProxyPassReverse (also known as an “Apache Gateway”) to the %{HTTP_HOST} The only reason this would make sense to do is if you have localhost entries on the apache server for specfic... » read more

Testing SSL Chaining Issues

Recently I needed to debug an issue by testing SSL chaining issues My old standby tools (curl and openssl were not reporting any errors) The exception javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path validation failed: java.security.cert.CertPathValidatorException: Path does not chain with any of the trust anchors Cause The cert from the keystore does not match the cert from... » read more

Neo4j Couldn’t get file lock

Problem A non-root user is running Neo4j and you are seeing locking errors in the log file Symptom May 8, 2013 6:20:31 PM java.util.prefs.FileSystemPreferences checkLockFile0ErrorCode WARNING: Could not lock User prefs. Unix error code 2. May 8, 2013 6:20:31 PM java.util.prefs.FileSystemPreferences syncWorld WARNING: Couldn't flush user prefs: java.util.prefs.BackingStoreException: Couldn't get file lock. May 8, 2013... » read more

convert valid godaddy cert key to java keystore for tomcat

I spend hours trying to figure this out and here are the fruits of my labor Problem You are unable to create a valid Tomcat Keystore using a GoDaddy crt and key file Curl output may look like this: curl: (60) SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify... » read more

phone laws driving headphones

By State: phone laws driving headphones Ever wondered if it is legal to wear headphones while driving in a particular state? Wonder no more! Alabama No prohibition on wearing of headsets while driving. Alaska Wearing an audio headset or earplugs is not permitted while driving. Exempts headsets when used and designed to improve a driver’s... » read more

Mandiant Highlighter – Log and Text File Viewer Review

Product Review – Mandiant Highlighter Today we are looking at Mandiant Highlighter; Log and Text File Viewer Product home page can be found here Cost: Free! Overview MANDIANT Highlighter is a log file analysis tool. Highlighter provides a graphical component to log analysis that helps the analyst identify patterns. Highlighter also provides a number of features aimed at... » read more

sed delete all lines after

Objective: Prep dev httpd.conf for production Tasks: Remove jenkins virtual host entry (which starts with a comment line “#Start Jenkins”) Replace .dev with nothing (ex: www.dev.example.com becomes www.example.com) Replace debug with error (ex: Loglevel debug becomes Loglevel error) Sed to remove lines after match In this example we will use sed delete all lines after... » read more

rollback httpd.conf changes on error

To rollback httpd.conf changes on error use this script: #!/bin/bash #File: deploy_new_httpd_conf.sh #Define this PATH_TO_NEW_HTTPD_CONF="~/new_httpd.conf" #Backup old httpd.conf file /bin/cp -f /etc/httpd/conf/httpd.conf /root/httpd.conf.bak #Copy new httpd.conf over the existing one /bin/cp -f ${PATH_TO_NEW_HTTPD_CONF} /etc/httpd/conf/httpd.conf #Test the Syntax /usr/sbin/apachectl -t if [ $? != 0 ] then echo "apache syntax test failed! Reverting back to old... » read more

Websphere Stop All Servers Script

Here’s a ksh script to stop all running websphere servers. Booyah! #!/bin/ksh # # This script stops all running Websphere servers # cd /opt/ibm/WAS70/logs servers=`echo *Node*` cd /opt/ibm/WAS70/AppServer/profiles/AppSrv01/bin for server in $servers; do pid=`ps -ef | grep $server | grep Cell01 | awk '{print $2}'` if [ ! -z "$pid" ]; then echo Stopping $server... » read more