Skip to content

Instantly share code, notes, and snippets.

View tuxfight3r's full-sized avatar
:octocat:
Working from home

Mohan Balasundaram tuxfight3r

:octocat:
Working from home
View GitHub Profile
@tuxfight3r
tuxfight3r / gist:9056eb0862fdf2e8b8755b3c6ce40af1
Created November 14, 2016 15:26
Puppetdb query examples
curl -s -X GET http://localhost:8080/pdb/query/v4/facts --data-urlencode query@test --data-urlencode 'pretty=true'
curl -X POST http://localhost:8080/pdb/query/v4/facts \
-H 'Content-Type:application/json' \
-d '{"query":["and",["=","certname","FQDN"],["=","name","ipaddress"]]}'
content of file test :
["and",["=","certname","FQDN"],["or",["=","name","ipaddress"]]]
@tuxfight3r
tuxfight3r / gist:0d740263e674057364a7ae4d95b18842
Created October 26, 2016 00:40 — forked from rogeriopradoj/gist:6954261
How to use Vagrant.has_plugin? -> small list of example plugins
@tuxfight3r
tuxfight3r / supervisord-example.conf
Created September 18, 2016 22:39 — forked from didip/supervisord-example.conf
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
node "default" {
stage { 'first':
before => Stage['main'],
}
class { 'apt_update':
stage => first,
}
class { 'apt': }
@tuxfight3r
tuxfight3r / docker-cheat-sheet.md
Created July 28, 2016 15:30 — forked from yairark/docker-cheat-sheet.md
Docker Cheat Sheet
@tuxfight3r
tuxfight3r / ruby_classes_0.rb
Last active July 28, 2016 15:25 — forked from mkurtikov/ruby_classes_1.rb
Ruby classes
#simple class
class Person
end
#inheritance
class Sarah < Person
end
#class with constructor arguments
class Jet
@tuxfight3r
tuxfight3r / ruby_monk_primer.rb
Created July 27, 2016 11:27 — forked from brownmike/ruby_monk_primer.rb
Ruby Monk Primer My solutions to all problems in ascending order
# Problem Statement
# Create a class Calculator, which performs addition and subtraction of two numbers at a time.
class Calculator
def add(a, b)
a+b
end
def subtract(a, b)
a-b
end
@tuxfight3r
tuxfight3r / gist:fec592879256cee5f45579abe3e9c262
Created July 27, 2016 10:25 — forked from marcel/gist:2100703
giftube – Generates an animated gif from a YouTube url.
#!/usr/bin/env ruby
# giftube – Generates an animated gif from a YouTube url.
#
# Usage:
#
# giftube [youtube url] [minute:second] [duration]
#
# ex.
#
#!/usr/bin/env ruby
require 'rubygems'
require 'chatterbot/dsl'
require 'speedtest'
# debug_mode
# remove this to get less output when running your bot
verbose
@tuxfight3r
tuxfight3r / gist:f1e20d5a50282bb08ebfd72a866a55f1
Created June 29, 2016 10:46 — forked from jaredcurtis/gist:1895347
sorted hash in puppet templates
databases => {
'default' =>
{
'ENGINE' => 'postgresql_psycopg2',
'NAME' => 'defaultdb',
'HOST' => '2.2.2.2.2',
'USER' => 'username',
'PASSWORD' => 'secretinfo',
'OPTIONS' =>
{