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
| # Dump all docker registry image versions | |
| docker_reg_image_versions () { | |
| if [ -z $1 ]; then | |
| echo "Pass registry hostname as argument." | |
| else | |
| reg="$1" | |
| read -p "$reg username: " user | |
| read -s -p "$reg password: " pass | |
| echo "" | |
| for i in $(curl -k -s -X GET "https://$reg/v2/_catalog" \ |
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
| { | |
| "CreateTime": "2016-02-29T18:18:48.000Z", | |
| "ImageId": "ami-f7a2bf96", | |
| "InstanceType": "m4.large", | |
| "SpotInstanceRequestId": "sir-039b6k6b", | |
| "SpotPrice": "0.030000", | |
| "State": "cancelled", | |
| "Status": { | |
| "Code": "instance-terminated-by-user", | |
| "Message": "Spot Instance terminated due to user-initiated termination.", |
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
| foo () { | |
| jqf='.ImageId,'\ | |
| '.InstanceId' | |
| aws_ec2_list | jq -S "$jqf" | |
| } |
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
| sudo pip install saws --ignore-installed six | |
| Password: | |
| The directory '/Users/adam/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
| The directory '/Users/adam/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. | |
| Collecting saws | |
| Downloading saws-0.4.0.tar.gz | |
| Collecting awscli>=1.7.46 (from saws) | |
| Downloading awscli-1.10.27-py2.py3-none-any.whl (937kB) | |
| 100% |████████████████████████████████| 942kB 1.3MB/s |
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
| def cmd = 'hostname' | |
| def sout = new StringBuffer(), serr = new StringBuffer() | |
| def proc = cmd.execute() | |
| proc.consumeProcessOutput(sout, serr) | |
| proc.waitForOrKill(1000) | |
| println sout |
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 |
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
| // 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
| 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
| export $(cat config.env | grep -v ^# | xargs) |