Skip to content

Instantly share code, notes, and snippets.

View skamithi's full-sized avatar

Stanley Karunditu skamithi

  • Raleigh, North Carolina
View GitHub Profile
@skamithi
skamithi / virsh_win7.md
Last active August 29, 2015 14:10
virsh + win7
@skamithi
skamithi / install_new_vm_on_laptop.md
Created December 11, 2014 19:05
installing a new VM on my laptop_using libvirt
# virt-builder ubuntu-14.04 --size 5G --hostname cacti --root-password password:<mypassword> --format qcow2 -o cacti.qcow2

# virt-install --import --name cacti --ram 1024 --disk $HOME/imgs/cacti.qcow2,format=qcow2,bus=virtio,cache=none --os-type linux --os-variant ubuntutrusty
@skamithi
skamithi / nslcd.conf
Created December 22, 2014 18:37
nslcd.conf confguration for Cumulus Linux KB on LDAP Authentication.
# /etc/nslcd.conf
# nslcd configuration file. See nslcd.conf(5)
# for details.
# The user and group nslcd should run as.
uid nslcd
gid nslcd
# The location at which the LDAP server(s) should be reachable.
uri ldaps://myadserver.rtp.example.test
@skamithi
skamithi / pep_501_check.md
Last active October 18, 2022 19:42
increasing size of max line to avoid pep8 e501 check

I use pymode to modify my python scripts. Keep on getting E501 when length of line is 82 or 83..which I think is just fine.

to fix this did the following

_$HOME/.config/pep8

[pep8]
max-line-length = 90
@skamithi
skamithi / serverspec.diff
Last active August 29, 2015 14:14
serverspec patches to make bridge class inherit from interface class
diff --git a/lib/serverspec/helper/type.rb b/lib/serverspec/helper/type.rb
index 5fcfaae..23d81a0 100644
--- a/lib/serverspec/helper/type.rb
+++ b/lib/serverspec/helper/type.rb
@@ -2,8 +2,8 @@ module Serverspec
module Helper
module Type
types = %w(
- base bridge cgroup command cron default_gateway file fstab group host
- iis_website iis_app_pool interface ipfilter ipnat iptables
@skamithi
skamithi / example.rb
Last active August 29, 2015 14:14
serverspec/specinfra for bonding
cumulus@leaf1$ netshow bond
Name Speed Mtu Mode Summary
-- ------ ------- ----- ------- -------------------------------
UP bond0 20G 1500 Bond/L3 BondMems: swp1s0(UP) swp1s1(UP)
IP: 10.1.2.1/30
cumulus@leaf1$
cumulus@leaf1$ bundle exec rspec
Interface "br0"
@skamithi
skamithi / specinfra_speed.patch
Created January 30, 2015 17:37
specinfra interface speed patch
commit 83cd84ddad6d4ebf683cfaa5850dc2dc0b823f2d
Author: Stanley Karunditu <[email protected]>
Date: Wed Jan 28 00:51:24 2015 -0500
get speed from /sys/class/net instead of ethtool. simpler way of doing it.
diff --git a/lib/specinfra/command/linux/base/interface.rb b/lib/specinfra/command/linux/base/interface.rb
index 2bb5bec..0ba7efc 100644
--- a/lib/specinfra/command/linux/base/interface.rb
+++ b/lib/specinfra/command/linux/base/interface.rb
@skamithi
skamithi / notes.md
Last active August 29, 2015 14:15
testing when handlers kick in.
  • So to get handlers to work properly you must put the handlers in a different "host" definition.
- hosts: all
  roles:
     - requires_switchd_restart

- hosts: all
  roles:
 - system_basics
@skamithi
skamithi / prefix_check.py
Last active August 29, 2015 14:15
ansible module prefix_check
DOCUMENTATION = '''
---
module: prefix_check
author: Stanley Kamithi [email protected]
short_description: Check route prefix
description:
- Inspired by Cumulus Linux prefix_check Ansible Module. \
Given a route prefix, check to see if route exists. \
If the route exists, then do nothing. If route does not exist \
the module will exit with an error.
@skamithi
skamithi / ipv6-test.js
Created February 17, 2015 06:39
using phantomjs to get info from a website - closest thing to text base browser for a server
/**
* Wait until the test condition is true or a timeout occurs. Useful for waiting
* on a server response or for a ui change (fadeIn, etc.) to occur.
*
* @param testFx javascript condition that evaluates to a boolean,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.
* @param onReady what to do when testFx condition is fulfilled,
* it can be passed in as a string (e.g.: "1 == 1" or "$('#bar').is(':visible')" or
* as a callback function.