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.
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.
| import re | |
| import requests | |
| import simplejson as json | |
| from robot.api import logger | |
| from robot.libraries.BuiltIn import BuiltIn | |
| USERNAME_ACCESS_KEY = re.compile('^(http|https):\/\/([^:]+):([^@]+)@') | |
| @echo off | |
| SET st3Path=C:\Program Files\Sublime Text 3\sublime_text.exe | |
| rem add it for all file types | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3" /t REG_EXPAND_SZ /v "Icon" /d "%st3Path%,0" /f | |
| @reg add "HKEY_CLASSES_ROOT\*\shell\Open with Sublime Text 3\command" /t REG_SZ /v "" /d "%st3Path% \"%%1\"" /f | |
| rem add it for folders | |
| @reg add "HKEY_CLASSES_ROOT\Folder\shell\Open with Sublime Text 3" /t REG_SZ /v "" /d "Open with Sublime Text 3" /f |
| #!/usr/bin/env python | |
| # | |
| # Corey Goldberg - 2012 | |
| # | |
| # requires: | |
| # * Xvfb | |
| # * X Windows | |
| # * xvfbwrapper (pip install xvfbwrapper) | |
| # |
| web: node server.js |
| # coding: utf-8 | |
| require 'sinatra' | |
| set server: 'thin', connections: [] | |
| get '/' do | |
| halt erb(:login) unless params[:user] | |
| erb :chat, locals: { user: params[:user].gsub(/\W/, '') } | |
| end | |
| get '/stream', provides: 'text/event-stream' do |
| #!/bin/bash | |
| # Quick and dirty Chromium updater till Chromatic is updated. | |
| # Beware there is no safety net, use at your own risk! | |
| # Where is Chromium installed? | |
| INSTALLFOLDER='/Applications/Internet'; | |
| RELEASE_TYPE="snapshots" | |
| # Get current installed version | |
| CURRENT=$(xpath $INSTALLFOLDER/Chromium.app/Contents/Info.plist '/plist/dict/key[. = "SCMRevision"]/following-sibling::string[1]/text()' 2> /dev/null); |
| apt-get install xvfb | |
| apt-get install firefox |
| pool = WebDriverPortPool.new(8) | |
| port = pool.get | |
| driver = Selenium::WebDriver::Driver.new(NoLockFirefoxBridge.new(:port => port)) | |
| # do some work | |
| driver.quit | |
| pool.release port | |
| require 'sinatra' | |
| require 'dm-core' | |
| require 'dm-migrations' | |
| require 'haml' | |
| DataMapper.setup(:default, 'sqlite3::memory:') | |
| class Message | |
| include DataMapper::Resource |