This file contains 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
On the last machine in the chain: | |
nc -l 1234 | pigz -d | tar xvf - | |
On each intermediate machine, you use a fifo to copy the data to the next machine as well as decompressing. | |
mkfifo myfifo | |
nc $NEXT_SERVER 1234 <myfifo & | |
nc -l 1234 | tee myfifo | pigz -d | tar xvf - |
This file contains 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
# Not the most efficient method... | |
File.open('track1/albumData1.txt').each do |line| | |
album, artist, *genres = split_and_filter(line) | |
genres.map! { |g| Genre.find(g) } | |
Album.create! :id => album, :artist_id => artist, :genres => genres | |
end |
This file contains 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 'active_record' | |
class Album < ActiveRecord::Base | |
belongs_to :artist | |
has_many :tracks | |
has_and_belongs_to_many :genres | |
attr_accessible :id, :artist_id, :genres | |
def to_s |
NewerOlder