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 -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["node", "active"], true]' | |
curl -sf 'http://localhost:8080/v3/facts' | |
curl -sf 'http://localhost:8080/v3/nodes' | |
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fact", "kernel"], "Linux"]' | |
curl -sfG 'http://localhost:8080/v3/nodes' --data-urlencode 'query=["=", ["fa, "operatingsystem"], "windows"]' |
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
# Swtich to user to use MCO out of the box | |
sudo -i -u peadmin | |
# Find all servers in master catalog | |
mco find | |
# Find all servers in master catalog and run class reboot | |
mco find -C reboot | |
# Find all servers with puppet fact ec2_ami_id |
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 | |
CERTNAME=`facter fqdn` | |
PUPPET_MASTER='puppet' | |
SSLDIR=`/usr/local/bin/puppet agent --configprint ssldir` | |
curl --noproxy '*' -X DELETE -H "Accept: pson" "https://${PUPPET_MASTER}:8140/production/certificate_status/${CERTNAME}" --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem --key /etc/puppetlabs/puppet/ssl/private_keys/${CERTNAME}.pem --cert /etc/puppetlabs/puppet/ssl/certs/${CERTNAME}.pem |
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
# Delete all docker images | |
for x in `docker images | grep -v REPO | awk '{ print $3 }'`; do docker rmi $x; done | |
# Delete all docker containers | |
for x in `docker ps -a | grep -v CONTAINER | awk '{ print $1 }'`; do docker rm -f $x; done | |
# Start all docker containers | |
for x in `docker ps -a | grep -v CONTAINER | awk '{ print $1 }'`; do docker start $x; done | |
# Fresh docker env in Redhat flavors |
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
# List repo sources | |
choco sources list | |
# Setup local server | |
choco sources add -name local -source http://fqdn | |
choco sources disable chocolately | |
# Install package | |
choco install 7zip | |
choco install 7zip -source http://fqdn |
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 -XPOST 'http://<xld-server>:<xld-port>/deployit/repository/ci/Applications/<ci>' --user 'some_username:some_password' -H "Content-type:application/xml" -d '<core.Directory id="Applications/ci"/>' |
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
# check if job exists | |
curl -XGET 'http://jenkins/checkJobName?value=yourJobFolderName' --user user.name:YourAPIToken | |
# with folder plugin | |
curl -s -XPOST 'http://jenkins/job/FolderName/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken | |
# without folder plugin | |
curl -s -XPOST 'http://jenkins/createItem?name=yourJobName' --data-binary @config.xml -H "Content-Type:text/xml" --user user.name:YourAPIToken | |
# create folder |
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 grails.plugins.rest.client.RestBuilder | |
import grails.transaction.Transactional | |
import sun.misc.BASE64Encoder | |
@Transactional | |
class JenkinsService { | |
def grailsApplication | |
def createJob(String folderName) { | |
String url = grailsApplication.config.jenkins.url |
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
*nat | |
:PREROUTING ACCEPT [235:14024] | |
:INPUT ACCEPT [235:14024] | |
:OUTPUT ACCEPT [418:29744] | |
:POSTROUTING ACCEPT [418:29744] | |
COMMIT | |
*filter | |
:INPUT ACCEPT [0:0] | |
:FORWARD ACCEPT [0:0] | |
:OUTPUT ACCEPT [229:47805] |