Skip to content

Instantly share code, notes, and snippets.

View bhalothia's full-sized avatar
🛠️
Building something cool. ;)

Virendra Singh Bhalothia bhalothia

🛠️
Building something cool. ;)
View GitHub Profile
@bhalothia
bhalothia / ansible-playbook.yml
Last active August 29, 2015 14:26
register variables across plays
- vars:
# Extra vars from Rundeck for partition type
partition: "{{ partition }}"
# For 'nmctl ps' wrapper - Some deployment validation
number_of_tries: 5
sleep_between_tries: 60
hosts: "app-{{ partition }}[0]" # Canary
Jenkins Best Practices
https://en.wikipedia.org/wiki/Continuous_integration<- Read this!
https://wiki.jenkins-ci.org/display/JENKINS/Jenkins+Best+Practices
http://www.slideshare.net/andrewbayer/7-habits-of-highly-effective-jenkins-users
Set up version control of job configurations
Keep jobs simple! Don't put a ton of bash in each job. If a job needs to do something complex, put it in a script in GitHub and check it out as needed.
Use templated builders to simplify common tasks
Keep all scripts in version control - avoid running scripts that live on the Jenkins server filesystem
Don't install unnecessary plugins - plugins are often written by third parties and can interact with each other in strange ways
Use LDAP authentication if possible for traceability - avoid anonymous access
#
# This is an example of a knife.rb configuration that uses yml and a
# simple env var (CHEF_ENV) to manage multiple hosted Chef environments.
#
# Example usage:
# export CHEF_ENV=evnironment_01
# knife status
#
# Based on: http://blog.blankpad.net/2010/09/28/multiple-knife-environments---the-return/
#
ORIGINAL_JENKINS_SERVER=
ORIGINAL_SERVER_USER=
NEW_JENKINS_SERVER=
NEW_SERVER_USER=
# ON THE ORIGINAL JENKINS SERVER
ssh $ORIGINAL_SERVER_USER@$ORIGINAL_JENKINS_SERVER
cd /var/lib/jenkins/
for i in `ls jobs`; do echo "jobs/$i/config.xml";done > config.totar
RDpropertyfilelogin {
org.mortbay.jetty.plus.jaas.spi.PropertyFileLoginModule sufficient
debug="true"
file="/.../server/config/realm.properties";
com.dtolabs.rundeck.jetty.jaas.JettyCachingLdapLoginModule sufficient
debug="false"
contextFactory="com.sun.jndi.ldap.LdapCtxFactory"
providerUrl="ldap://xx.xx.xx.xx:389"
port="389"
#!/bin/bash
env x='() { :;}; echo vulnerable' bash -c "echo this is a test" | grep vulnerable > /dev/null 2>&1
if [ $? -eq 1 ]; then
echo "Not vulnerable. Machine is safe."
exit 0
else
echo -n "Vulnerable. Version: "
/bin/bash --version
echo "Installing patch."
java.lang.NullPointerException: Cannot get property 'nodeSet' on null object
17:16:02 at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:56)
17:16:02 at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:169)
17:16:02 at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:44)
17:16:02 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:227)
17:16:02 at com.dtolabs.rundeck.app.internal.workflow.MutableWorkflowStepStateImpl.getParameterizedStepState(MutableWorkflowStepStateImpl.groovy:79)
17:16:02 at com.dtolabs.rundeck.app.internal.workflow.MutableWorkflowStepState$getParameterizedStepState.call(Unknown Source)
17:16:02 at com.dtolabs.rundeck.app.internal.workflow.MutableWorkflowStateImpl.locateStepWithContext(MutableWorkflowStateImpl.groovy:467)
17:16:02 at com.dtolabs.rundeck.app.internal.workflow.MutableWorkflowStateImpl.this$2$locateStepWithContext(MutableWorkflowStateImpl
#!/bin/sh
# Sublime Text 3 install with Package Control
# http://simonewebdesign.it/install-sublime-text-3-on-linux/
# Run this script with:
# $ curl -L git.io/sublimetext | sh
# Detect the architecture
@bhalothia
bhalothia / gist:7068bd4a34f0cd96f1e3
Created August 10, 2014 06:04
Error Logs for chef-rundeck plugin sinatra web app
/var/lib/gems/1.8/gems/ohai-7.2.0/lib/ohai/loader.rb:188: warning: regexp has `]' without escape
Writing to /var/run/chef-rundeck-9980.pid
== Error writing pid file /var/run/chef-rundeck-9980.pid!
== Sinatra/1.4.5 has taken the stage on 9980 for production with backup from Thin
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:9980, CTRL+C to stop
[2014-08-08T11:31:54+05:30] INFO: Loading all nodes for /
[2014-08-08T11:31:54+05:30] INFO: search started (project: 'default')
[2014-08-08T11:32:24+05:30] INFO: Loading all nodes for /
[user]
name = Pavan Kumar Sunkara
email = pavan.sss1991@gmail.com
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com