This file contains hidden or 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
mkdir temp | |
cd temp | |
# Configure Windows | |
Set-WindowsExplorerOptions ` | |
-EnableShowHiddenFilesFoldersDrives ` | |
-EnableShowProtectedOSFiles ` | |
-EnableShowFileExtensions ` | |
-EnableShowFullPathInTitleBar |
This file contains hidden or 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
user="adampats" | |
curl -u "$user" "https://rubygems.org/api/v1/api_key.yaml" > ~/.gem/credentials | |
chmod 0600 ~/.gem/credentials |
This file contains hidden or 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
@Library('jenkinsfile-library') | |
import com.foo.Methods | |
node { | |
def m = new com.foo.Methods() | |
def ip = m.getPublicIP() | |
echo ip | |
} |
This file contains hidden or 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
h = [{:form_name=>nil, | |
:form_fields=> | |
[{:type=>"text", :name=>"hostname", :value=>"test\n"}, | |
{:type=>"text", :name=>"syslog", :value=>""}, | |
{:type=>"text", :name=>"time_server", :value=>"pool.ntp.org\n"}, | |
{:type=>"hidden", :name=>"task", :value=>"3"}, | |
{:type=>"hidden", :name=>"task_action", :value=>"save"}, | |
{:type=>nil, | |
:name=>"resolv", | |
:value=>"nameserver\n\n"}, |
This file contains hidden or 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
require 'ruby_expect' | |
require 'timeout' | |
require 'pry' | |
@verbose = true | |
log_name = "#{Time.now.utc.strftime('%Y-%m-%d-%H%M%SZ')}-#{@prog_name}.log" | |
timeout_seconds = '600' | |
class Log | |
def initialize(log_path) |
This file contains hidden or 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
export $(cat config.env | grep -v ^# | xargs) |
This file contains hidden or 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
apt-get update | |
apt-get install -y linux-image-extra-$(uname -r) \ | |
linux-image-extra-virtual \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - |
This file contains hidden or 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
// requires Jenkins - Groovy Sandbox to be turned OFF | |
new_var = "varname" | |
new GroovyShell(this.binding).evaluate("${new_var} = 'skittles'") | |
println varname |
This file contains hidden or 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
try { | |
err = null | |
currentBuild.result = "SUCCESS" | |
node { | |
stage 'One' | |
// using a single secret Jenkins credential | |
withCredentials([[$class: 'StringBinding', credentialsId: 'my-api-token', variable: 'API_TOKEN']]) { | |
sh ''' | |
set +x |
This file contains hidden or 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 github import Github | |
g = Github("user", "pass", base_url="https://github.foo.net") | |
u = g.get_user('user') | |
print u.name |
NewerOlder