Skip to content

Instantly share code, notes, and snippets.

View ranjib's full-sized avatar
🥁
having fun

Ranjib Dey ranjib

🥁
having fun
View GitHub Profile
@ranjib
ranjib / tweeter_search.rb
Created January 22, 2013 07:17
tweeter gem search api not returning the most recent tweets
tweets = Twitter.search("#devops",
:count => 100,
:result_type => "recent").results
#!/bin/bash
# As the "bufferbloat" folks have recently re-discovered and/or more widely
# publicized, congestion avoidance algorithms (such as those found in TCP) do
# a great job of allowing network endpoints to negotiate transfer rates that
# maximize a link's bandwidth usage without unduly penalizing any particular
# stream. This allows bulk transfer streams to use the maximum available
# bandwidth without affecting the latency of non-bulk (e.g. interactive)
# streams.
@ranjib
ranjib / default.rb
Last active December 14, 2015 09:09 — forked from bryanwb/gist:5063043
# cookbooks/nokogiri/recipes/default.rb
stage "install_deps" do
run_list "recipe[nokogiri::deps]"
end
stage "install_gem" do
run_list "recipe[nokogiri::gem]"
end
ruby_block "some command" do
block do
c = Mixlib::Shelout.new("ls -l")
c.run_command
c.stdout # do something exciting with c.stdout
end
end
@ranjib
ranjib / berkshelf_error.txt
Created March 14, 2013 09:01
berkshelf error
[berkshefl] $ berks upload
Using apache2 (1.6.0)
Using java (1.10.0)
Using yum (2.1.0)
Using s3cmd (0.0.0) at path: 'site-cookbooks/s3cmd'
Using as_app (0.0.3) at path: 'site-cookbooks/as_app'
Using rabbitmq (0.0.0) at path: 'site-cookbooks/rabbitmq'
Using solr (0.0.0) at path: 'site-cookbooks/solr'
Using windows (1.8.4)
Using chef_handler (1.1.4)
@ranjib
ranjib / clone_opscode_cookbooks.rb
Created March 19, 2013 20:56
Clone all opscode cookbooks
require 'nokogiri'
require 'restclient'
Nokogiri::HTML(RestClient.get('https://github.com/opscode-cookbooks/')).
css('ul.repolist h3 a').collect{|n| n.attribute('href').value}.each do |s|
system "git clone http://github.com#{s}"
end
@ranjib
ranjib / kitech-test-faild-run.txt
Created March 19, 2013 22:26
kitech test fails on bluepill
community-cookbooks/bluepill [master] $ bundle exec kitchen test
-----> Starting Kitchen
-----> Cleaning up any prior instances of <default-ubuntu-1204>
-----> Destroying <default-ubuntu-1204>
[vagrant command] BEGIN (vagrant destroy default-ubuntu-1204 -f)
[default-ubuntu-1204] Forcing shutdown of VM...
[Berkshelf] cleaning Vagrant's shelf
[default-ubuntu-1204] Destroying VM and associated drives...
[vagrant command] END (0m4.37s)
Vagrant instance <default-ubuntu-1204> destroyed.
@ranjib
ranjib / pr.md
Created March 21, 2013 04:59 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

conf_files = Dir['/etc/profile.d/*']
template "/etc/template-example" do
variable :files => conf_files
source "template-example.erb"
end
ranjib@ranjib-pd:~/workspace/foss/community-cookbooks/apt [master] $ gem list
*** LOCAL GEMS ***
activesupport (3.2.13)
addressable (2.3.3)
archive-tar-minitar (0.5.2)
awesome_print (1.0.2)
berkshelf (1.3.1)
bigdecimal (1.1.0)