Archive for service

[tekwalk] [puppet] quick PuppetMaster Service Script

Posted in Uncategorized with tags , , , , , , , , , , , on July 3, 2012 by abhishekkr

tekwalk.blogspot.com [25-April-2012]

http://tekwalk.blogspot.in/2012/04/quick-puppetmaster-service-script-for.html

#!/usr/bin/env ruby
module PuppetMaster
  def self.puppetmaster_cmd
   ‘puppet master –debug –verbose’
  end
  def self.start
    puts “Starting Puppet Master in Debug+Verbose+Daemon mode logging to /var/log/puppet/a.log”
    puts “Started.” if system(“#{puppetmaster_cmd} >> /var/log/puppet/a.log”)
  end
  def self.stop
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if system(“kill -9 #{puppet_master_pid}”)
      puts “PuppetMaster with pid:#{puppet_master_pid} has been killed.”
    else
      puts “Failure killing PuppetMaster with pid:#{puppet_master_pid}.”
    end
  end
  def self.status
    puppet_master_ps = %x{ps aux | grep -e ‘#{puppetmaster_cmd}’ | grep -v grep}
    puppet_master_pid = puppet_master_ps.split[1]
    if puppet_master_pid.nil?
      puts “No PuppetMaster found.”
    else
      puts “Running @ #{puppet_master_ps}”
    end
  end
end
case ARGV.first
when ‘start’
  PuppetMaster.start
when ‘stop’
  PuppetMaster.stop
when ‘restart’
  PuppetMaster.stop
  PuppetMaster.start
when ‘status’
  PuppetMaster.status
else
  puts <<-PMUSAGE
$service puppetmaster (start|stop|restart|status)
PMUSAGE
end
Advertisements

[just.few.tuts] http_voodoo_mongo ~ Remote Control MongoDB over HTTP

Posted in AbhishekKr, tutorial with tags , , , , , , on November 14, 2011 by abhishekkr

@ justfewtuts.blogspot.com [20-October-2011]

http://justfewtuts.blogspot.com/2011/10/httpvoodoomongo-remote-control-your.html

usage: it’s a remote controller for your local/remote MongoDB instances working over an HTTP mocking service
What it consists of?

…..click here to read in detail