I added a way to preview templates before publishing them. Simply click on "Preview" and a new tab or window will pop up so you can test.
Latest Templates
ESX Server CLI Switching Configuration
May 17, 2012 – CLI commands to create various VMware ESX virtual switches to a basic level. These can be used post-install or as part of a kickstart driven installation. vSwitch0 is created by default with vmnic0 or whatever NIC you tell the installer to boot with via kernel options. The management IP address will by default be on vm kernel NIC vmk0. Hence ...
Cisco Switchport Security
May 15, 2012 – Static access port with configurable permitted MAC's, if you want to use a dot1q trunk configure it as so and look up the option extras - MAC's can be specified per-VLAN on a dot1q trunk. One static MAC, sticky mode for additional MAC's. Duplicate mac-address line for more statics. Violation mode configurable, ensure mls statement is used if using protect ...
Generate Django 1.4 settings.py for my enviornment
May 2, 2012 – The following generates a standard settings.py file that I use for all my apps.
Import mysql database from file to table
April 4, 2012 – How to import data from a text file into a databse table
Add django-tinymce + django-filebrowser to projects
March 5, 2012 – Adding wysiwyg editors with image uploading is kind of a pain in the ass. The below template may need some cleanup, but it works for me now. This is on ubuntu using apache2, my projects are in /var/www/%{fqdn}%/%{project_name}%/. Make sure to grab django-filebrowser-no-grappelli-and-uploadify, I didn't want grappelli.
Password protect a site with .htaccess
February 24, 2012 – Despite htaccess being around forever, I always forget how to implement it. This is a simple "just get it to work" implementation.
Installing hubot as a Campfire Bot on Ubuntu
February 22, 2012 – A couple of friends and I utilize Campfire as a chat room, yeah I know there are free alternatives, blah blah. This room is essentially a better version of irc for us. Anyway.. there are a ton of tutorials on how to deploy hubot to heroku, but not a whole lot on how to deploy hubot on your own servers. ...
Refresh Browser for IE Citrix Session
February 16, 2012 – So I've been working on a development project for a client, and doing all of the development remotely. The issue I've been having is with their Citrix environment, I've launched Citrix from an IE8 browser and after a period of 30 minutes or so the remote session will die and the Citrix session will be gone due to inactivity. If ...
IP SLA Probes for IOS instead of rtr
February 16, 2012 – http://www.cisco.com/en/US/docs/ios/12_4/ip_sla/configuration/guide/hsicmp.html
Setup enivornment for new django application
May 11, 2012 – Copying this entire config into an ssh window on a linux host will create all the necessary scaffolding to run a django 1.4 site on apache2 using wsgi and create the necessary database and user.
Configure DHCP Snooping on Cisco IOS
February 16, 2012 – DHCP snooping allows you to create a white-list of interfaces for which trusted dhcp servers are connected. All dhcp specific traffic which passes through "untrusted" interfaces will be dropped. This helps guard against rogue dhcp servers.
Reset Mysql Password
February 16, 2012 – Created from http://www.debian-administration.org/articles/442
Convert PEM to PFX with OpenSSL
February 17, 2012 – OpenSSL command to convert from .crt and .key to .pfx.
Test MySQL Database Connection with PHP
February 16, 2012 – PHP script to test if you can connect to a MySQL database
Replace text in multiple files with perl
February 16, 2012 – This script allows you to replace a string in multiple files with a new string
Set up site on remote IIS Server
February 16, 2012 – Save this script as a .bat file Example script: cd .. c: cd "C:Program Files (x86)IIS ResourcesIIS 6.0 Migration Tool" iismt.exe server-name w3svc/1 /serverbindings 127.0.0.1:80:dev-site2.example.com /siteid 1 /configonly
Change ID of website in IIS
February 16, 2012 – This script will change the ID of a site for you in IIS. You will need to save the output as a .bat file
Run a program as a specific user...
February 16, 2012 – Launch files as a specific user. Sample: set WshShell = WScript.CreateObject("WScript.Shell") WshShell.run "runas /user:Administrator ""C:Program FilesInternet Exploreriexplore.exe""" 'Open command prompt WScript.Sleep(1000) WshShell.SendKeys("AdminPassword") 'send password WshShell.SendKeys("{ENTER}") 'send enter keystroke WScript.Sleep(1000) set wshshell = Nothing Launches IE as a Administrator.
Configure 3750X Power Stack in Redundant Mode
February 16, 2012 – This is a standard configuration for powerstack redundancy. This was tested with 2 3750X switches each with a single 1100W power supply. In this configuration power can be removed from a single power supply and all the switches in this stack will stay powered on. http://www.cisco.com/en/US/prod/collateral/switches/ps5718/ps6406/white_paper_c11-578931.html
Configure tacacs in Cisco IOS
February 16, 2012 – Simple template to configure tacacs on a given IOS piece of gear. A "network" entry should be added to your CiscoACS configuration for the ip address of %[tacacs_source_interface]%.
Configure SNMP RO/RW Community Strings Cisco IOS
February 16, 2012 – A simple template to configure snmp community strings for read-only and read-write access according to access-lists
Cisco ASA Guest Wireless Configuration
February 16, 2012 – This is a simple template to configure an ASA device using asa821-k8.bin code. Interfaces: Ethernet0/0 is connected to a DSL modem and that DSL modem dishes out dhcp addresses. Ethernet0/1 is the management interface for this device. Ethernet0/2 is a trunk interface to a Cisco wireless controller. The guest wireless network is 192.168.10.0/24
Create Share buttons using Django Templatetags
February 16, 2012 – It's easy to copy and paste urls to share links, but its easier to just click on a button to do it.
Cisco Router as Terminal Server with SSH Line Access
February 16, 2012 – Example of how to use a Cisco router as a terminal server using an NM-32A 32-port async serial line card. In use with 2811's and IOS 12.4T. SSH is used to securely make the serial lines available on the network. Be aware that SSH requires a username/password combination, hence this is not like when you simply bind the serial ports ...
Cisco IOS IPSec L2L VPN with AES PSK Encryption
February 16, 2012 – Example of Cisco IOS IPSec LAN2LAN VPN with local on device AES (type 6) encryption of PSK's to protect them. WARNING - This will encrypt your PSK with non-reversible encryption. MAKE SURE YOU HAVE A SECURE BACKUP OF IT. Notes: - xauth is disabled for the peer - AES 256 with PFS using group 5 for phase 1 ISAKMP. - ...
Tweeting from a django application
February 17, 2012 – A recent feature request for hatch was to have a twitter feed. A twitter feed would allow people to be notified when new config templates are created via twitter.
Configuring A Cisco 2600 Series Router as a Terminal Server
February 16, 2012 – Configures the use of a NM-16A card in a cisco 2600 router as a terminal server.
Ipsec l2l tunnel between two routers
February 16, 2012 – Build an ipsec tunnel between Router A and Router B.
Get IOS version via snmp
February 16, 2012 – The following allows you to grab the IOS version of a list of cisco devices.Radius Authentication on OpenBSD
February 16, 2012 – login.conf file which configures radius authentication for an OpenBSD host servers file which contains keys for each of these radius servers
Apache2 mod_wsgi for django
February 16, 2012 – A simple template to setup a django site for apache2 and mod_wsgi.
F5 Base System Template
February 16, 2012 – F5 base system configuration template. * LACP based 802.1Q trunk for uplink * Failover configuration for HA pair with state mirror and config sync password Dump template output to file and use bigpipe merge. If it errors fix file and try again :-)
Configure RTR/SLA Ping in IOS
February 22, 2012 – This configures and schedules the pinging of a destination ip address. I tend to define "site codes" which is generally the third octet of a given site's /24 address space. For example: Beijing, China = 192.168.56.0/24 , site code is "56" rtr 56 type echo protocol ipIcmpEcho 192.168.56.1 frequency 300 rtr schedule 56 life forever start-time now Once this is ...
shell script ping all IP
February 17, 2012 – Simple shell script which will ping all devices which are in text file. Please enter your filename %[file]%
Cisco ACE Module New Farm - 2 Servers http/https - w/ sticky
February 16, 2012 – Create Rservers Create Serverfarm Create VIP This is specific to my environment and doesn't create the probes but should be easy enough or enough of a baseline for most simple configs.
Enable netflow and export on a router
February 16, 2012 – Enables netflow monitoring on the %[interface_to_monitor]% interface and configures netflow exporting to a %[destination_ip]% and %[destination_port]%
Fetch ipsec Tunnel in/out octets with SNMP
February 16, 2012 – Simple bash script to retrieve ingress and egress traffic statistics for an ipsec tunnel.
Loop through text file in Bash
September 26, 2011 – Simple way to loop through a text file in a shell script using bash.
Create MySQL user
February 16, 2012 – This template generates the commands to create a new MySQL user with full permissions on a given database.
