This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def notifyBuild(String buildStatus) { | |
// build status of null means successful | |
buildStatus = buildStatus ?: 'SUCCESSFUL' | |
// Default values | |
def subject = "${buildStatus}: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'" | |
def summary = "${subject} (${env.BUILD_URL})" | |
def details = """<p>STARTED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p> | |
<p>Check console output at "<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"</p>""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl --header 'Authorization: token INSERTACCESSTOKENHERE' \ | |
--header 'Accept: application/vnd.github.v3.raw' \ | |
--remote-name \ | |
--location https://api.github.com/repos/owner/repo/contents/path | |
# Example... | |
TOKEN="INSERTACCESSTOKENHERE" | |
OWNER="BBC-News" | |
REPO="responsive-news" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from browsermobproxy import Server | |
import requests | |
from selenium import webdriver | |
bmp_path = "browsermob-proxy-2.1.0-beta-3/bin/browsermob-proxy" | |
sut = "http://the-internet.herokuapp.com/" | |
server = Server(bmp_path) | |
server.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// gecko and webkit | |
// details here https://developer.mozilla.org/en-US/docs/DOM/event.initKeyEvent | |
var keyboardEvent = document.createEvent("KeyboardEvent"); | |
var initMethod = typeof keyboardEvent.initKeyboardEvent !== 'undefined' ? "initKeyboardEvent" : "initKeyEvent"; | |
keyboardEvent[initMethod]( | |
"keydown", // event type : keydown, keyup, keypress | |
true, // bubbles |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/expect | |
set timeout 30 | |
#setup some abitrary commands | |
set cmdstr(0) "cd /opt/obb/server" | |
set cmdstr(1) ". build/setup" | |
set cmdstr(2) "rebuild_db" | |
spawn /bin/bash | |
#send the first command | |
send "$cmdstr(0)\n" | |
#wait for a prompt to appear |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.internet.protocol import Factory | |
from twisted.internet.endpoints import TCP4ClientEndpoint, connectProtocol | |
from twisted.internet import reactor, defer, stdio | |
from twisted.protocols.basic import LineReceiver | |
import json | |
your_name = "bmannix" | |
class NotConnectedError(BaseException): pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Building your own baseboxes: | |
http://briceno.mx/2012/10/easy-guide-to-create-a-vagrant-box-from-virtualbox/ | |
http://feed2.me/post/44067313534/building-your-own-base-box-for-vagrant | |
List of generic baseboxes: | |
http://www.vagrantbox.es/ | |
Hey Gagan, | |
Here are some resources for building baseboxes. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from robot.libraries.BuiltIn import BuiltIn | |
from robot.api import logger | |
def log_s2l_version(): | |
""" | |
Gets the Selenium version used by Selenium2Library | |
""" | |
seleniumlib = BuiltIn().get_library_instance('Selenium2Library') | |
browser = seleniumlib._current_browser() | |
sel_version = locals()['webdriver'].__version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -xe | |
#THIS SCRIPT MUST BE RUN AS ROOT | |
ADMIN_USER=admin | |
ADMIN_GROUP=admin | |
#add admin group | |
(cat /etc/group | grep -E '\b$ADMIN_GROUP\b') || sudo groupadd $ADMIN_GROUP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fabfile as fab | |
class Pyfab: | |
def __init__(self, role, user): | |
self.role = role | |
self.user = user | |
def fab_exec(self, command, *args, **kwargs): | |
''' | |
this runs fabric commands defined in the fabfile. By default it |