Skip to content

Instantly share code, notes, and snippets.

Suresh Prajapati toddlers

Block or report user

Report or block toddlers

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@toddlers
toddlers / check_swap_paging_rate.sh
Created Feb 3, 2014
it’s actually the rate it’s swapped in/out that can impact performance, not the quantity
View check_swap_paging_rate.sh
#!/bin/bash
# Show the rate of swapping (in number of pages) between executions
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=-1
EXITFLAG=$OK
WARN_THRESHOLD=1
@toddlers
toddlers / notify.sh
Created Feb 3, 2014
Notify when the system rebooted
View notify.sh
#!/bin/bash
#
# *************************************************
# chkconfig: 2345 99 99
# description: notify email address on system boot.
# *************************************************
# Installing:
# 1) save as /etc/rc.d/init.d/notify
# 2) set the desired email address in "MAILADD" variable
# 3) chmod a+w /etc/rc.d/init.d/notify
@toddlers
toddlers / check_forkrate.sh
Created Feb 3, 2014
The process counter in /proc/stat . Normally you would only expect a fork rate of 1-10/sec on a production box with steady traffic.
View check_forkrate.sh
#!/bin/bash
DATAFILE="/var/tmp/nagios_check_forkrate.dat"
VALID_INTERVAL=600
OK=0
WARNING=1
CRITICAL=2
UNKNOWN=-1
@toddlers
toddlers / error.txt
Created Feb 9, 2014
creating users via chef
View error.txt
[2014-02-09T13:33:52+01:00] INFO: Processing directory[/home/oper/.ssh] action create (dirty::example11 line 24)
================================================================================
Error executing action `create` on resource 'directory[/home/oper/.ssh]'
================================================================================
Chef::Exceptions::EnclosingDirectoryDoesNotExist
------------------------------------------------
Parent directory /home/oper does not exist, cannot create /home/oper/.ssh
@toddlers
toddlers / varant.rb
Created Feb 9, 2014
absolute path for cookbooks in vagrant file
View varant.rb
20 homebase = "/Users/sureshprajapati/chef/dirty/dirty-chef"
21 #config.vm.synced_folder "/Users/sureshprajapati/chef/dirty/dirty-chef/cookbooks", "/cookbooks"
22 config.vm.provision "chef_solo" do |chef|
23 ¦ chef.cookbooks_path = "#{homebase}/cookbooks"
24 ¦ #chef.run_list = [ "recipe[dirty::default]" ]
25 ¦ chef.add_recipe "dirty::default"
26 ¦ chef.log_level = :debug
27 ¦ chef.verbose_logging = :true
28 end
@toddlers
toddlers / Vagrantfile.rb
Created Feb 10, 2014
Vagrant file for testing
View Vagrantfile.rb
homebase = "/path/to/homebase"
Vagrant::Config.run do |config|
config.vm.box = "opscode-ubuntu-12.04-chef11"
config.vm.box_url = "https://opscode-vm.s3.amazonaws.com/vagrant/opscode_ubuntu-12.04_chef-11.2.0.box" # from https://github.com/opscode/bento
config.vm.network :hostonly, "10.111.222.33"
config.vm.customize ["modifyvm", :id, "--memory", 2048]
config.vm.provision :chef_solo do |chef|
# chef.log_level = :debug
chef.cookbooks_path = "#{homebase}/cookbooks"
@toddlers
toddlers / Vagrantfile
Created Feb 10, 2014
Syntax and using the cookbooks in vagrant file
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant::Config.run do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
# Every Vagrant virtual environment requires a box to build off of.
config.vm.box = "precise64"
View bootstrap_chef.bash
#!/usr/bin/env bash
# call like this on the target server:
# NODENAME='foo' CHEF_ENV='production' RUNLIST='["role[foo]","recipe[bar]"]' CHEFREPO='git@example.com:repo.git' bash <( curl -L https://raw.github.com/gist/1026628 )
# You will need to ensure that the ssh key is already set up on the server.
set -e
export CHEF_DIR="${HOME}/chef"
sudo rm -rf $CHEF_DIR
mkdir -p "$CHEF_DIR"
@toddlers
toddlers / Vagrantfile
Created Mar 2, 2014
vagrant file for aws provisioning
View Vagrantfile
Vagrant.configure("2") do |config|
config.vm.provider :aws do |aws|
aws.access_key_id = ###
aws.secret_access_key = ###
aws.keypair_name = ###
aws.ssh_private_key_path = ###
aws.region = 'us-east-1'
aws.security_groups = ####
View Configuring Daemontools for Ubuntu 10
#!/bin/sh
## you'll have to do a couple extra steps to get this running
## there are probably other ways to handle svncanboot, but this is from the linux forum
set -e
if
touch /etc/_testr_file
then
You can’t perform that action at this time.