Skip to content

Instantly share code, notes, and snippets.

@eLafo
Created November 29, 2011 16:48
Show Gist options
  • Save eLafo/1405485 to your computer and use it in GitHub Desktop.
Save eLafo/1405485 to your computer and use it in GitHub Desktop.
get the ports assigned to sphinx
#!/usr/bin/env ruby
#Instructions: ruby < <(wget -nv -O - <link_to_raw_file>)
#where link_to_raw_file is the raw url of this file
require 'yaml'
puts(Dir.glob('/home/*/app/current/config/sphinx.yml').inject([]) do |a, file|
a << [YAML.load_file(file)['production']['port'], file]
end.sort_by{|a| a[0]}.map{|a| a.join(' -> ')})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment