Jump to content

badp

Active Members
  • Posts

    10
  • Joined

  • Last visited

Everything posted by badp

  1. I installed the FasterCSV class and used it instead. For those who care, here's the new code that doesn't choke: #!/usr/bin/ruby # CSV 2 splunk # Converts a CSV file to a splunk-readable format require 'fastercsv' print "CSV file to read: " input_file = gets.chomp print "File to write to: " output_file = gets.chomp puts "Opening CSV file..." csvfile = File.open(input_file) {|f| f.read} puts "CSV file opened." puts "Parsing CSV file..." csv = FasterCSV::parse(csvfile) fields = csv.shift puts "Writing file..." File.open(output_file, 'w') do |f| csv.each do |record| for i in 0..(fields.length - 1) f.print "#{fields[i]}="#{record[i]}", " end f.print "n" end end # End file block - close file puts "Contents of #{input_file} written to #{output_file}."
  2. I've got a nice little Ruby script designed to take a CSV file and convert it to a particular format. It works flawlessly, until I feed it a ~50MB CSV file. It opens the file but when it goes to parse, Ruby throws and Visual Studio catches an exception: "An unhandled win32 exception occurred in ruby.exe [3040]." Then it goes on with the generic debugging message. The Ruby script is below. I adapted it from an open source CSV-to-XML script. Also, as the comments indicate, the point of all this is to get a CSV file into a format that splunk will process correctly (it processed the CSV values, but does not get the fields right and refuses to learn them properly.) The script: #!/usr/bin/ruby # CSV 2 splunk # Converts a CSV file to a splunk-readable format require 'csv' print "CSV file to read: " input_file = gets.chomp print "File to write to: " output_file = gets.chomp puts "Opening CSV file..." csvfile = File.open(input_file) {|f| f.read} puts "CSV file opened." puts "Parsing CSV file..." csv = CSV::parse(csvfile) fields = csv.shift puts "Writing file..." File.open(output_file, 'w') do |f| csv.each do |record| for i in 0..(fields.length - 1) f.print "#{fields[i]}="#{record[i]}", " end f.print "n" end end # End file block - close file puts "Contents of #{input_file} written to #{output_file}." CSV::Parse(csvfile) is where it seems to choke. Any ideas?
  3. You may want to look at a different band. 900 MHz is very susceptible to getting stepped on by old cordless phones. If you're near an airport that's another problem. Who are your customers going to be?
  4. Small, small. Less than 10 computers, one office.
  5. I'm very partial to a VPLS style service. In the event that is not cost effective, wouldn't it work to set up a site-to-site VPN as long as I have an appropriately configured DNS server in the same segment as my AD clients?
  6. My CEO wants all our infrastructure to reside outside the offices. Moreover, he wants someone else (like Intermedia) to host our servers for us. Only problem is, I don't know of anyone who will remotely host Active Directory. Does anyone even do this? It sounds like a solution looking for a problem. I don't really see the value in doing it this way, but I figured I'd at least give it a look.
  7. I don't know if it will work but you might try Spinrite (http://www.grc.com/sr/spinrite.htm .. and sadly, no, I don't get a commission)
  8. Hak.5 is for GEEKS, not nerds. And Jonathan isn't white!
×
×
  • Create New...