Skip to content

Instantly share code, notes, and snippets.

View aaronwalker's full-sized avatar
☁️
FTaaS - Fixing things as a Service in the ⛈ and sometimes BTaaS 😉

Aaron Walker aaronwalker

☁️
FTaaS - Fixing things as a Service in the ⛈ and sometimes BTaaS 😉
View GitHub Profile
@aaronwalker
aaronwalker / postgres_activity.sql
Created May 20, 2019 12:09
current postgres activity
SELECT max(now() - xact_start) AS duration, pid, state, query FROM pg_stat_activity
WHERE state IN ('idle in transaction', 'active')
GROUP BY pid, query, state ORDER BY duration;
@aaronwalker
aaronwalker / jenkins-users.groovy
Created March 29, 2019 11:06
Create Jenkins users
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("ciinabox","xxxxx")
instance.setSecurityRealm(hudsonRealm)
//FYI the replaces the existing maxtrix config so ensure you have all users you
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<!-- connect to the local ActiveMQ broker -->
<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">
<property name="brokerURL" value="tcp://amq:61616"/>
#goes into $HOME/.jenkins
baseuri: https://jenkins.example.com/
jobs:
- Build-Master
stoplight: 1
# ssl_opts is any option listed in "perldoc IO::Socket::SSL"
ssl_opts:
verify_hostname: 0
# # by default we ignore invalid certs; set to nil to validate
# SSL_verify_callback:
Function WSUSUpdate {
$Criteria = "IsInstalled=0 and Type='Software'"
$Searcher = New-Object -ComObject Microsoft.Update.Searcher
try {
$SearchResult = $Searcher.Search($Criteria).Updates
if ($SearchResult.Count -eq 0) {
Write-Output "There are no applicable updates."
exit
}
else {
@aaronwalker
aaronwalker / git-tag-delete.sh
Created October 6, 2014 06:52
bulk git tag delete
while read tag; do
echo deleting $tag
git tag -d $tag
git push upstream :refs/tags/$tag
done </tmp/tags
@aaronwalker
aaronwalker / osxdefaults
Created July 30, 2014 04:30
osx default
#!/bin/bash
# Set custom OS X defaults
# See: github.com/mathiasbynens/dotfiles
# General UI/UX
# ----------------------------------------------------------------------
# Disable Menu bar transparency
defaults write NSGlobalDomain AppleEnableMenuBarTransparency -bool false
@aaronwalker
aaronwalker / blueprint.xml
Last active December 6, 2016 01:27
sample blueprint xml
<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.0.0"
xmlns:camel="http://camel.apache.org/schema/blueprint"
xmlns:ext="http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0 http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0/blueprint-ext.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
#!/bin/bash
#
# chkconfig: 345 88 12
# description: Karaf is a java container.
### BEGIN INIT INFO
# Provides: $activemq
### END INIT INFO
. /etc/init.d/functions
. /etc/profile.d/java.sh
@aaronwalker
aaronwalker / sha1_base64_encode
Created June 20, 2013 04:25
Uses openssl to generate an sh1 base64 encoded text
echo -n "mytext"| openssl sha1 -binary | base64