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
class OldMapserver < Formula | |
desc "Publish spatial data and interactive mapping apps to the web" | |
homepage "http://mapserver.org/" | |
url "http://download.osgeo.org/mapserver/mapserver-6.2.2.tar.gz" | |
sha256 "79b81286dde030704f59a668a19e5b01af27bb35d05b3daf91cefe06ca29ffd9" | |
bottle do | |
cellar :any | |
sha256 "8bfa96a50ee83117bd929afc4ed1c6ce3e9e82a7e6da6328e4ca500c4fbb096d" => :yosemite | |
sha256 "7ed6da72cbb724c1dfe92cc701bf292ddac02788dc7976f7a81e5e367b472262" => :mavericks |
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
alias rdbm='bin/rake db:migrate db:test:clone' | |
alias rdbmt='bin/rake db:migrate RAILS_ENV=test' | |
alias rdbr='bin/rake db:rollback' | |
alias spec_all='bin/spring rspec spec' | |
spec_model() { bin/spring rspec spec/models/"$1"_spec.rb } | |
spec_controller() { bin/spring rspec spec/controllers/"$1"_controller_spec.rb } | |
spec_views() { bin/spring rspec spec/views/"$1"/*_spec.rb } | |
alias devlog='tail -f log/development.log' |
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
sudo su postgres | |
psql | |
update pg_database set datistemplate=false where datname='template1'; | |
drop database Template1; | |
create database template1 with owner=postgres encoding='UTF-8' | |
lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0; | |
update pg_database set datistemplate=true where datname='template1'; |
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
# Thanks to http://rubysource.com/build-a-port-scanner-in-ruby | |
require 'celluloid' | |
require 'socket' | |
class ScanPort | |
include Celluloid | |
def initialize(start_port, end_port, host) | |
@start_port = start_port |
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
# Thanks to http://rubysource.com/build-a-port-scanner-in-ruby | |
require 'celluloid' | |
require 'socket' | |
class ScanPort | |
include Celluloid | |
def initialize(start_port, end_port, host) | |
@start_port = start_port |
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
# PhonyRails + Faker | |
1000.times do | |
num = PhonyRails.normalize_number(Faker::PhoneNumber.short_phone_number, country_code: 'US') | |
sizes << num.size | |
end | |
sizes.count { |s| s == 9 } # => 22 | |
sizes.count { |s| s == 10 } # => 180 | |
sizes.count { |s| s == 11 } # => 797 |
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
require 'formula' | |
class Libav < Formula | |
homepage 'http://libav.org/' | |
url 'http://libav.org/releases/libav-9.6.tar.xz' | |
sha1 '7c66e9776e83b13910eae960d63b7b86ad229dfe' | |
head 'git://git.libav.org/libav.git' | |
option "without-x264", "Disable H264 encoder" |
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
require 'test-unit' | |
require 'rspec/mocks' | |
class Test::Unit::TestCase | |
def setup | |
RSpec::Mocks::setup(self) | |
end | |
def teardown |
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
require 'winrm' | |
require 'kconv' | |
endpoint = 'http://192.168.33.10:5985/wsman' | |
winrm = WinRM::WinRMWebService.new(endpoint, :plaintext, :user => 'Vagrant', :pass => 'vagrant') | |
shell = winrm.open_shell | |
output = winrm.run_command shell, 'dir' | |
result = winrm.get_command_output(shell, output) | |
=begin |
NewerOlder