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 / Setting up Nagios on Centos
Created May 18, 2014 23:43
Monitoring your infra!
A very well explained article on setting up Nagios.
http://www.unixmen.com/install-and-configure-nagios-in-centos-6-4-rhel-6-4/
@bhalothia
bhalothia / Deleting Amazon EBS Volume
Last active August 29, 2015 14:01
Deleting an Amazon EBS Volume while terminating an EC2 instance
When we create an EC2 instance it uses EBS volume. By default settings, the EBS volume doesn't get deleted when you terminate the instance and keep on burning dollars.
DELETE IT!! Check the option to delete it once the instance is terminated.
Also, start tagging all of your AWS resources to make it easier when you search for them...and create metrics reports.
# -*- mode: ruby -*-
# vi: set ft=ruby :
# David Lutz's Multi VM Vagrantfile
# inspired from Mark Barger's https://gist.github.com/2404910
boxes = [
{ :name => :web, :role => 'web_dev', :ip => '192.168.33.1', :ssh_port => 2201, :http_fwd => 9980, :cpus =>4, :shares => true },
{ :name => :data, :role => 'data_dev', :ip => '192.168.33.2', :ssh_port => 2202, :mysql_fwd => 9936, :cpus =>4 },
{ :name => :railsapp, :role => 'railsapp_dev', :ip => '192.168.33.3', :ssh_port => 2203, :http_fwd => 9990, :cpus =>1}
]
[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
@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 /
#!/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
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/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."
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"
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