Archive for rubygems

[just.few.tuts] MessQ : message queue for quickly trying any idea

Posted in Blogroll, tutorial with tags , , , , , , , , on April 30, 2013 by abhishekkr

justfewtuts.blogspot.com [3/Feb/2013]

http://justfewtuts.blogspot.in/2013/02/messq-message-queue-for-quickly-trying.html

Past some time while trying up some set-up based on Message Queue at infrastructure… needed a quick to set-up, localhost friendly, network available Message Queue service to try out ideas.
So here is Mess(age)Q(ueue). Something quickly thrown together. Would work later to get it more performance oriented, good to go with smaller projects.

@GitHub:       https://github.com/abhishekkr/messQ
@RubyGems: https://rubygems.org/gems/messQ
_________________________

A Quick Tryout

[+] Install
$ gem install messQ –no-ri –no-rdoc
[+] Start Server (starts at 0.0.0.0 on port#5566)

$ messQ –start
[+] Enqueue user-id & home value to the Queue
$ messQ -enq $USER
$ messQ –enqueue $HOME

[+] Dequeue 2 values from Queue

$ messQ -deq
$ messq –dequeue
[+] Stop Server
$ messQ –stop
_________________________

Via Code….

…click here to read full post

Advertisements

[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

[tekwalk] Explicit SASS update

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

@ tekwalk.blogspot.com [26-September-2011]

http://tekwalk.blogspot.com/2011/09/explicit-update-sass-in-rails.html

explicit update SASS in Rails Application Sass (Syntactically Awesome StyleSheets)?
But, if you are using any other web-server (like, thin)….. in that case you’ll have to get your CSS files to be explicitly updated using ‘sass –update’ action.

$ bundle exec sass –update –watch public/stylesheets/sass:public/stylesheets

…..click here to read in detail