This file contains 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
# this is a partial of a script that does my setup-routing. I needed to modify it to accept parameters. | |
# performs round-robin like link assignment | |
# args processing | |
function echo_usage { | |
echo "Usage: `basename $0` [link]* (defaults to last run params if exists, or ppp101 ppp102)" | |
} | |
if [ "$1" == "-h" ] | |
echo_usage |
This file contains 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 | |
#helpful page: | |
# http://www.ruby-doc.org/docs/ruby-doc-bundle/Manual/man-1.4/IO.html | |
# | |
# This program tests the ability of ruby to know what stdout is. | |
# Its useful in the case below when I don't want a newline at the end if I am | |
# piping to something | |
def print_things |
This file contains 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
class YMech < WWW::Mechanize | |
private_class_method :new | |
def YMech.create | |
#do some stuff, define a global variable | |
# | |
# so my question is, how do I pass a block that I can also then pass to `new`? | |
# example of how you normally pass a block to new | |
#a = WWW::Mechanize.new { |agent| | |
# agent.follow_meta_refresh = true |
This file contains 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
~/.profile | |
... | |
########## | |
# http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/ | |
# Less Colors for Man Pages | |
export LESS_TERMCAP_mb=$'\E[01;31m' # begin blinking | |
#export LESS_TERMCAP_md=$'\E[01;38;5;74m' # begin bold | |
#bold colors don't work well in OSX Terminal. These changes add red keywords, with blue 'option' words (not sure precise term) | |
export LESS_TERMCAP_md=$'\E[00;31;2;74m' # begin bold | |
export LESS_TERMCAP_me=$'\E[0m' # end mode |
This file contains 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
class Myclass | |
#do some stuff | |
end | |
exit # I want to load this file into irb, but not actually run the below code. but exit quits irb | |
foo = Myclass.new | |
foo.poop |
This file contains 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 | |
#already installed? start service and exit | |
if ! [ -f /usr/bin/srvadmin-services.sh ] | |
echo "srvadmin utils not installed. installing" | |
else | |
echo "srvadmin utils installed" | |
/usr/bin/srvadmin-services.sh start |
This file contains 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 | |
#already installed? start service and exit | |
if ! [ -f /usr/bin/srvadmin-services.sh ] | |
echo "srvadmin utils not installed. installing" | |
else | |
echo "srvadmin utils installed" | |
/usr/bin/srvadmin-services.sh start |
This file contains 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
startup_message off | |
shell -$SHELL | |
term "screen-256color" | |
shelltitle '$ |bash' | |
# not sure why I have to do this! | |
# cat ~/.screen.d/shell => ${SHELL} --login | |
#shell /Users/bhenderson/.screen.d/shell | |
#caption always "%?%F%{gk}%:%{rk}%?%n(%t) : %{g}[%{b}%l%{g}]" | |
defscrollback 100000 | |
bind j focus down |
This file contains 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
$ [[ $TERM =~ "screen" ]] && echo true | |
true | |
$ [[ -t 0 && "*screen*" = $TERM ]] && echo true | |
$ |
This file contains 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
require "minitest/autorun" | |
require "post_stats" | |
class PostStats | |
class << self | |
attr_accessor :client | |
end | |
end | |
class Net::HTTP |
OlderNewer