Skip to content

Instantly share code, notes, and snippets.

file = File.read("tuzzio.txt")
while (line = file.gets)
puts line
end
file.close
@erikbuild
erikbuild / Attempt1.ps1
Created January 4, 2012 15:20
VMware / PowerCLI 5 trying to play with iSCSI settings on a ESXi 5 Host
# Launch PowerCLI and login when prompted
Connect-VIServer myserver.com
# PowerCLI now shows "connected to myserver.com as root" at top.
Get-VMHostStorage
# Get-VMHostStorage : 1/4/2012 10:18:20 AM Get-VMHostStorage Object reference not set to an instance of an object.
# At line:1 char:18
# + Get-VMHostStorage <<<<
# + CategoryInfo : NotSpecified: (:) [Get-VMHostStorage], VimException
# + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomation.ViCore.Cmdlets.Commands.Host.GetVMHostStorage
Nginx / Passegener tries to grab the wrong URL for PCRE.
To fix:
cd /home/gitlabhq
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre-8.13.tar.gz && tar xvf pcre-8.13.tar.gz
wget http://nginx.org/download/nginx-1.0.11.tar.gz && tar xvf nginx-1.0.11.tar.gz
Re-run "sudo passenger-install-nginx-module" and choose option 2.
sudo mate yourusername.conf
You will see this:
<Directory "/Users/yourusername/Sites/">
Options Indexes MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
Options +FollowSymlinks
RewriteEngine on
RewriteRule * /?page=$1 [NC]
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: *** Chef 0.10.4 ***
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Setting the run_list to ["enterprise-configure"] from JSON
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Run List is [recipe[enterprise-configure]]
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Run List expands to [enterprise-configure]
[Wed, 02 Nov 2011 03:18:46 +0100] INFO: Starting Chef Run for enterprise-11-10-23-i386
[Wed, 02 Nov 2011 03:18:46 +0100] ERROR: Running exception handlers
[Wed, 02 Nov 2011 03:18:46 +0100] ERROR: Exception handlers complete
[Wed, 02 Nov 2011 03:18:46 +0100] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[Wed, 02 Nov 2011 03:18:46 +0100] FATAL: ArgumentError: wrong number of arguments (0 for 1)
module ApplicationHelper
def markdown(text)
Redcarpet.new(text).to_html.html_safe
end
end
I don't see how this:
if (foo)
{
// something
}
is more readable than this:
if (foo) {
@erikbuild
erikbuild / gist:1179772
Created August 30, 2011 00:19
hg visual studio 2010 gitignore
# use glob syntax
syntax: glob
*.obj
*.exe
*.pdb
*.user
*.aps
*.pch
*.vspscc
require 'rubygems'
require 'prawn'
require 'prawn/core'
require 'prawn/layout'
require 'fastercsv'
require 'awesome_print'
# Parse the CSV
residents = FasterCSV.read("residents.csv")
ap residents