Skip to content

Instantly share code, notes, and snippets.

View arangamani's full-sized avatar
✍️
All we are doing is writing tomorrow's legacy software today

Kannan Manickam arangamani

✍️
All we are doing is writing tomorrow's legacy software today
View GitHub Profile

Keybase proof

I hereby claim:

  • I am arangamani on github.
  • I am arangamani (https://keybase.io/arangamani) on keybase.
  • I have a public key whose fingerprint is FA86 A4F8 D222 5C78 5B53 6872 30BF D74C 5931 865C

To claim this, I am signing this object:

@arangamani
arangamani / _types.h
Last active August 29, 2015 14:25
_types.h
/*-
* Copyright (c) 2001, 2002 Mike Barcroft <mike@FreeBSD.org>
* Copyright (c) 2001 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Klaus Klein.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@arangamani
arangamani / rs_swap_repo.rb
Last active August 29, 2015 13:58
Swapping repositories on RightScale ServerTemplate cookbooks
# This simlpe snippet explains how to swap the repository of all the cookbooks under
# a RightScale ServerTemplate
require 'right_api_client'
# Initialize the client with correct options.
client = RightApi::Client.new(options)
# Obtain the servertemplate resource where you want to swap the respository
st = client.server_templates.index(id: 123456)
@arangamani
arangamani / chef_handler_example.rb
Last active August 29, 2015 13:57
Chef Handler Example Exception Handling
# attributes
default['cron']['service_name'] = 'cron'
# recipe
include_recipe 'chef_handler'
cookbook_file "#{node['chef_handler']['handler_path']}/blah.rb" do
source 'blah.rb'
action :create
end
@arangamani
arangamani / example
Created March 7, 2014 18:26
log_level example
provisioner:
solo_rb:
log_level: warn
@arangamani
arangamani / test-kitchen_failure
Created March 7, 2014 18:21
test-kitchen failure
kitchen | [default] Setting the name of the VM...
kitchen | [default] Clearing any previously set forwarded ports...
kitchen | [default] Clearing any previously set network interfaces...
kitchen | [default] Preparing network interfaces based on configuration...
kitchen | [default] Forwarding ports...
kitchen | [default] -- 22 => 2222 (adapter 1)
kitchen | [default] Running 'pre-boot' VM customizations...
kitchen | [default] Booting VM...
kitchen | [default] Waiting for machine to boot. This may take a few minutes...
kitchen | [default] Machine booted and ready!
class Chef
class Log
def self.warn(str); end
end
end
@arangamani
arangamani / jsonlint
Last active January 7, 2016 02:45
A JSON lint tool using Ruby and "json" Rubygem
#!/usr/bin/env ruby
require "rubygems"
require "json"
if ARGV.size < 1
puts "Please provide a JSON file"
exit 1
end
#!/usr/bin/env ruby
require 'rubygems'
require 'json'
if ARGV.size != 1
puts "This script only accepts a single parameter as organization."
puts "Usage: #{__FILE__.split("/").last} <organization>"
exit 1
end
@arangamani
arangamani / india_map.c
Created January 30, 2013 07:41
C code to print India Map
#include "stdio.h"
main()
{
int a,b,c;
int count = 1;
for (b = c = 10;
a = "- FIGURE?, UMKC,XYZHello Folks,\
TFy!QJu ROo TNn(ROo)SLq SLq ULo+\