Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| // v1.1.2 | |
| var https = require('https'); | |
| var zlib = require('zlib'); | |
| var crypto = require('crypto'); | |
| var endpoint = '<aws es endpoint>'; | |
| exports.handler = function(input, context) { | |
| // decode input from base64 | |
| var zippedInput = new Buffer(input.awslogs.data, 'base64'); |
| #@ /etc/quagga/bgpd.conf (Centos & Ubuntu) | |
| hostname <Local OS hostname> | |
| password <Any random phrase> | |
| enable password <Any random phrase> | |
| ! | |
| log file /var/log/quagga/bgpd | |
| !debug bgp events | |
| !debug bgp zebra | |
| debug bgp updates |
| #!/bin/bash | |
| bucket=$1 | |
| set -e | |
| echo "Removing all versions from $bucket" | |
| versions=`aws s3api list-object-versions --bucket $bucket |jq '.Versions'` | |
| markers=`aws s3api list-object-versions --bucket $bucket |jq '.DeleteMarkers'` |
Simple collection of Groovy scripts to help me maintain some Jenkins systems.
See also https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Script+Console
Please comment & let me know if you have a fork / fixes you'd like to include.
| <?php | |
| # Fill our vars and run on cli | |
| # $ php -f db-connect-test.php | |
| $dbname = 'name'; | |
| $dbuser = 'user'; | |
| $dbpass = 'pass'; | |
| $dbhost = 'host'; | |
| $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die("Unable to Connect to '$dbhost'"); |
| --- | |
| - name: add user and create ssh key | |
| user: name=shohei | |
| - name: dowanload pubkey from Github and placed as authorized_keys | |
| get_url: url=https://github.com/shohey1226.keys dest=/tmp/shohei.authorized_keys | |
| delegate_to: 127.0.0.1 | |
| - name: Create authorized_keys from the file that just downloaded | |
| authorized_key: user=shohei key="{{ lookup('file', '/tmp/shohei.authorized_keys') }}" |
A primitive Double A (AAA-minus-Accounting) RBAC system implemented in declarative Nginx config.
So I noticed https://github.com/alexaandru/elastic_guardian, a simple AAA reverse-proxy to sit in front of Elasticsearch. Reading the source and comments tickled my "why is this in code not config?" funnybone.
I asked @alexaandru (https://twitter.com/jpluscplusm/status/438339557906735104) who told me it was mostly the resulting complexity of the nginx config he tried that prompted him to write it.
| #!perl | |
| # This calculator contains *TWO* DSL's. | |
| # The first one is for the calculator itself. | |
| # The calculator's grammar is written in OP2. | |
| # OP2 is the second DSL, and its code is the | |
| # second half of this file. | |
| use 5.010; | |
| use strict; |
| #!/bin/bash | |
| # A simple script to backup an organization's GitHub repositories. | |
| #------------------------------------------------------------------------------- | |
| # NOTES: | |
| #------------------------------------------------------------------------------- | |
| # * User @jimklimov (and probably some others called out in the long comment | |
| # thread below) have modified this script to make it more robust and keep | |
| # up with various changes in the GitHub API and response format at: | |
| # https://github.com/jimklimov/github-scripts |