Skip to content

Instantly share code, notes, and snippets.

View bgupta's full-sized avatar

Brian Gupta bgupta

View GitHub Profile
@bgupta
bgupta / foreman-cli
Created May 27, 2011 07:51
foreman-cli
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@bgupta
bgupta / foreman-cli
Created May 28, 2011 07:50 — forked from ohadlevy/foreman-cli
foreman-cli
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
ubuntu@dmetest:~/bg-foreman$ ./foreman-cli2 --help
Usage: foreman-cli2 [options] ...
-v, --verbose Output more information
--hosts [filter] Retreive a list of hosts
--puppetclasses [filter] Retreive a list of puppetclasses
--fact_values [filter] Retreive a list of fact_values
--environments [filter] Retreive a list of environments
--hostgroups [filter] Retreive a list of hostgroups
--architectures Retreive a list of architectures
--auth_source_ldaps Retreive a list of auth_source_ldaps
def get_collection(foreman_url,path)
response = RestClient.get foreman_url + path.to_s,
{:user => @@foreman_user,
:password => @@foreman_pass,
:headers => { :accept =>:json, :content_type => :json }}
results = JSON.parse(response.to_str)
end
@bgupta
bgupta / gist:1022380
Created June 13, 2011 06:17
auth is broken
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@bgupta
bgupta / foremancli
Created October 8, 2011 01:48
Basic CLI for Querying Foreman
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@bgupta
bgupta / gist:1310758
Created October 24, 2011 23:43
ssh_using_foreman
#!/usr/bin/env ruby
# Copyright (C) 2011 Vijay Brian Gupta brian.gupta@brandorr.com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#!/opt/local/bin/python
"""
A script to query the Amazon Web Services usage reports programmatically.
Ideally this wouldn't exist, and Amazon would provide an API we can use
instead, but hey - that's life.
Basically takes your AWS account username and password, logs into the
website as you, and grabs the data out. Always gets the 'All Usage Types'
@bgupta
bgupta / README.md
Created April 11, 2017 22:02 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed