This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # very new to node.js and express. | |
| # very excited to play with server side rendering of SVG. | |
| # If this simple example can be improved pls put your comments. | |
| express = require('express') | |
| d3 = require('d3') | |
| draw_divs = -> | |
| dataset = [ 5, 10, 15, 20, 25 ] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FILELIST=`find . -regex '\.\/[a-z]+.*'` | |
| for f in $FILELIST; do | |
| cat license.header $f > $f.new | |
| mv $f.new $f | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| for i in `ls $HOME/.vim/bundle`; do | |
| echo "Update Git for $i" | |
| if [ -d $i ]; then | |
| cd "$i" | |
| git pull | |
| fi | |
| cd $HOME/.vim/bundle | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Execute gnome action as a user | |
| - name: enable middle click | |
| shell: "sudo -u {{ core_username.stdout }} dbus-launch gsettings set org.gnome.settings-daemon.peripherals.mouse middle-button-enabled true" | |
| # Execute Gem Install using RVM | |
| - name: install knife-solo | |
| shell: > | |
| executable=/bin/bash source /etc/profile.d/rvm.sh; | |
| gem install --no-ri --no-rdoc knife-solo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Change the hostname without reboot | |
| # Applies only to debian based OS | |
| # TODO | |
| # Understand common practises in setting hostnames in /etc/hosts | |
| # in a typical production setting. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Script for checking if SSH port is open | |
| # Only checks that port is open. Not that actually SSH connection can occur | |
| counter=0 | |
| result="ssh disabled" | |
| if [ -z "$1" ] | |
| then | |
| echo "hostname argument required. Example ssh_port_checker.sh 10.1.1.1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require 'getoptlong' | |
| require 'rubygems' | |
| require 'snmp' | |
| SNMP_COMMUNITY = 'public' | |
| HOSTNAME_BLACKLIST = [ "that_one_switch_thats_down_but_in_dns" ] | |
| ZONE_FILE = /path/to/dns/zone/file | |
| HOSTNAME_REGEX = /^\s?(switch[0-9]+)/i |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| namespace :db do | |
| desc 'regenerate test and dev db' | |
| task :regenerate do | |
| Rake::Task['db:drop'].invoke | |
| Rake::Task['db:create'].invoke | |
| Rake::Task['db:migrate'].invoke | |
| Rake::Task['db:test:purge'].invoke | |
| Rake::Task['db:test:prepare'].invoke | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # The IP Address Validator accepts the following options | |
| # | |
| # * allow_nil - allows nil values | |
| # * allow_blank - allows blank values | |
| # * allow_cidr - allows /prefixlen CIDR masks in values | |
| # | |
| # the validator will use regular expressions in an attempt to prevent | |
| # malformed IP addresses from being passed to the IPAddr.new initializer | |
| # as this method can be very slow to raise exceptions for malformed input. | |
| class IpAddressValidator < ActiveModel::EachValidator |