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 / cheatsheet.py
Last active January 6, 2021 16:21 — forked from fuyufjh/cheatsheet.py
python cheatsheet
Python Cheatsheet
=================
################################ Input & Output ###############################
name = input('please enter your name: ')
print('hello,', name)
ageStr = input('please enter your age: ')
age = int(ageStr)
@tuxfight3r
tuxfight3r / flask_quickstart.py
Created March 13, 2016 23:59 — forked from aliles/flask_quickstart.py
Example CLI help output for possible re-implementation of boolean flags for begins.
from flask import Flask
import begin
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello World!'
@begin.start(env_prefix='WEB_')
@tuxfight3r
tuxfight3r / _INSTALL.md
Created April 5, 2016 15:35 — forked from robinsmidsrod/_INSTALL.md
Bootstrapping full iPXE native menu with customizable default option with timeout (also includes working Ubuntu 12.04 preseed install)

Add the following chunk to your existing ISC dhcpd.conf file.

if exists user-class and ( option user-class = "iPXE" ) {
    filename "http://boot.smidsrod.lan/boot.ipxe";
}
else {
    filename "undionly.kpxe";
}

(or see https://gist.github.com/4008017 for a more elaborate setup

@tuxfight3r
tuxfight3r / skeleton-daemon.sh
Created May 16, 2016 09:59 — forked from shawnrice/skeleton-daemon.sh
A template to write a quick daemon as a bash script
#!/bin/sh
# This is a skeleton of a bash daemon. To use for yourself, just set the
# daemonName variable and then enter in the commands to run in the doCommands
# function. Modify the variables just below to fit your preference.
daemonName="DAEMON-NAME"
pidDir="."
pidFile="$pidDir/$daemonName.pid"
@tuxfight3r
tuxfight3r / proxy.rb
Created May 16, 2016 15:41 — forked from rubiojr/proxy.rb
proxy.rb
#!/usr/bin/env ruby
# A quick and dirty implementation of an HTTP proxy server in Ruby
# because I did not want to install anything.
#
# Copyright (C) 2009 Torsten Becker <torsten.becker@gmail.com>
require 'socket'
require 'uri'
@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