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:0c92107b409ceb7f74f7331d3e716287
Created May 24, 2016 17:30 — forked from kwilczynski/gist:2279315
Puppet hash merge and deep merge example ...
matti@acrux ~/reject $ RUBYLIB=. cat - | puppet apply
$a = { 'abc' => 123, 'def' => 456}
$b = { 'abc' => 123, 'def' => 999}
notice dump(merge($a, $b))
notice dump(merge($b, $a))
notice: Scope(Class[main]): {"abc"=>"123", "def"=>"999"}
notice: Scope(Class[main]): {"abc"=>"123", "def"=>"456"}
notice: Finished catalog run in 0.07 seconds
matti@acrux ~/reject $ RUBYLIB=. cat - | puppet apply
@tuxfight3r
tuxfight3r / netstat.rb
Created May 25, 2016 16:34 — forked from kwilczynski/netstat.rb
Simple netstat in Ruby
!#/usr/bin/env ruby
PROC_NET_TCP = '/proc/net/tcp' # This should always be the same ...
TCP_STATES = { '00' => 'UNKNOWN', # Bad state ... Impossible to achieve ...
'FF' => 'UNKNOWN', # Bad state ... Impossible to achieve ...
'01' => 'ESTABLISHED',
'02' => 'SYN_SENT',
'03' => 'SYN_RECV',
'04' => 'FIN_WAIT1',

Quick Installation Howto

  1. Make sure you have successfuly set up iPXE, iSCSI target (iSCSI Enterprise Target on Debian works fine for me), TFTP server and some time to spend.
  2. Get yourself a NTFS-formatted USB stick.
  3. Copy contents of installation DVD into mentioned USB stick.
  4. Get a copy of wimboot and load it into your TFTP server.
  5. Copy boot/bcd, boot/boot.sdi, sources/boot.wim and bootmgr into TFTP root as well.
  6. Create the bootstrap script (included bootstrap.ipxe file) and boot your
@tuxfight3r
tuxfight3r / Autounattend.xml
Created June 10, 2016 13:13 — forked from sneal/Autounattend.xml
Windows Server 2012 R2 Autounattend.xml
<?xml version="1.0" encoding="utf-8"?>
<unattend xmlns="urn:schemas-microsoft-com:unattend">
<settings pass="windowsPE">
<component xmlns:wcm="http://schemas.microsoft.com/WMIConfig/2002/State" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Microsoft-Windows-International-Core-WinPE" processorArchitecture="amd64" publicKeyToken="31bf3856ad364e35" language="neutral" versionScope="nonSxS">
<SetupUILanguage>
<UILanguage>en-US</UILanguage>
</SetupUILanguage>
<InputLocale>en-US</InputLocale>
<SystemLocale>en-US</SystemLocale>
<UILanguage>en-US</UILanguage>
@tuxfight3r
tuxfight3r / rsyslog.conf
Created June 17, 2016 14:28 — forked from kamermans/rsyslog.conf
RainerScript version of /etc/rsyslog.conf for Ubuntu with rsyslog 8+
# /etc/rsyslog.conf Configuration file for rsyslog.
#
# For more information see
# /usr/share/doc/rsyslog-doc/html/rsyslog_conf.html
#
# Default logging rules can be found in /etc/rsyslog.d/50-default.conf
#
# WARNING: This config has been converted to RainerScript format which could
# affect config files provided by other software in /etc/rsyslog.d/
# It should behave the same as the legacy-format config file that ships
@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' =>
{
#!/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: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.
#
@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
node "default" {
stage { 'first':
before => Stage['main'],
}
class { 'apt_update':
stage => first,
}
class { 'apt': }