Skip to content

Instantly share code, notes, and snippets.

View drusellers's full-sized avatar

Dru Sellers drusellers

View GitHub Profile
function OnServer($serverName, $action)
{
$currentServerName = [System.Environment]::MachineName
if($currentServerName -eq $serverName)
{
Write-Host "On Server '$currentServerName'"
&$action
}
else
{
subst g: %windir%\assembly
$sc = Get-Service -name MSDTC
if($sc.Status -eq "Running")
{
Write-Host "The MSDTC is running. Good"
}
else
{
Write-Error "The MSDTC must be running and is currently $sc.Status"
}
<ExtentionMethod()> _
Public Sub DuringTheDay(ByVal crit As ICriteria, ByVal dateToUse As DateTime)
Dim min As DateTime = New DateTime(dateToUse.Year, dateToUse.Month, dateToUse.Day, 0, 0, 0)
Dim max As DateTime = New DateTime(dateToUse.Year, dateToUse.Month, dateToUse.Day, 23, 59, 59)
crit.Add(Expression.Between("DatePublished", min, max))
End Sub
Gem unavailable - trying to install
Successfully installed nunit-2.5.5.10112
Copy From: C:/Ruby191/lib/ruby/gems/1.9.1/gems/nunit-2.5.5.10112/lib
Copy To: C:/development/test/lib/nunit
drusellers@ubuntu:~$ sudo gem install passenger
Building native extensions. This could take a while...
ERROR: Error installing passenger:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
extconf.rb:8:in `require': no such file to load -- mkmf (LoadError)
from extconf.rb:8
drusellers@ubuntu:~$ sudo gem install pg
Building native extensions. This could take a while...
ERROR: Error installing pg:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.8 extconf.rb
checking for pg_config... no
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
# /home/drusellers/dev/gemcutter/app/models/download.rb in most_downloaded_today
#
20.
21. def self.for(what)
22. $redis[key(what)].to_i
23. end
24.
25. def self.most_downloaded_today
26. items = $redis.zrevrange(TODAY_KEY, 0, 4, :with_scores => true)
development:
adapter: postgresql
database: gemcutter_development
pool: 5
timeout: 5000
test: &TEST
adapter: postgresql
database: gemcutter_test
root@gems1:/var/www/gems.codebetter.com/gemcutter# rails s -e=production
=> Booting WEBrick
=> Rails 3.0.0.beta4 application starting in =production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Exiting
/usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': =production database is not configured (ActiveRecord::AdapterNotSpecified)
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
from /usr/lib/ruby/gems/1.8/gems/activerecord-3.0.0.beta4/lib/active_record/railtie.rb:55
from /usr/lib/ruby/gems/1.8/gems/activesupport-3.0.0.beta4/lib/active_support/lazy_load_hooks.rb:17:in `instance_eval'