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
//Here we define Person object by creating a constructor for it. We could also do this by doing new Object() then dynamically | |
//adding attributes and functions to it. | |
var Person = function(name, age){ | |
this.name = name; | |
this.age = age; | |
this.getAge = function(){ | |
return this.age; | |
}; | |
this.toString = function(){return "Person";}; | |
}; |
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
# Script to migrate jenkins job from one server to another via cli | |
# Make sure python-jenkins is installed in order to use script | |
import argparse | |
import jenkins | |
def get_parser(): | |
parser = argparse.ArgumentParser() | |
parser.add_argument('-j', '--job_name', type=str, required=True, help='Name of job that is to be migrated') | |
parser.add_argument('-o', '--original_server', type=str, required=True, help='Server to migrate from') |
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
#!groovy | |
package tests | |
import support.PipelineSpockTestBase | |
class TestThing extends PipelineSpockTestBase { | |
def scriptPath = 'vars/thing.groovy' |
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 | |
INSTANCE_TO_ISOLATE=$1 | |
INSTANCE_TO_ISOLATE_FROM_1=$2 | |
INSTANCE_TO_ISOLATE_FROM_2=$3 | |
PEM_PATH=$4 | |
ssh -i $PEM_PATH -t centos@$INSTANCE_TO_ISOLATE "sudo iptables -I INPUT -s $INSTANCE_TO_ISOLATE_FROM_1 -j DROP && sudo iptables -I INPUT -s $INSTANCE_TO_ISOLATE_FROM_2 -j DROP" | |
ssh -i $PEM_PATH -t centos@$INSTANCE_TO_ISOLATE "sudo iptables -I OUTPUT -d $INSTANCE_TO_ISOLATE_FROM_1 -j DROP && sudo iptables -I OUTPUT -d $INSTANCE_TO_ISOLATE_FROM_2 -j DROP" |
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 | |
INSTANCE_TO_RESTORE=$1 | |
PEM_PATH=$2 | |
ssh -i $PEM_PATH -t centos@$INSTANCE_TO_RESTORE "sudo iptables -D OUTPUT 1 && sudo iptables -D OUTPUT 1" | |
ssh -i $PEM_PATH -t centos@$INSTANCE_TO_RESTORE "sudo iptables -D INPUT 1 && sudo iptables -D INPUT 1" |