« first day (580 days earlier)      last day (2675 days later) » 

00:29
:D
Debian right?
01:11
Yes, Debian. I converted the box to RAID 1, and had a little argument with the boot sequence, which was still trying to mount the previous, non-raid root partition.
Booting linux used to be so very simple. The BIOS ran the boot sector which ran the LILO boot loader which loaded the kernel, which runs the main process. Done. Then came initramfs, so now the boot loader loads the ramdisk and runs its init program, and that program loads the kernel, which runs the main process. Then grub replaced lilo, so that now the boot sector loads grub stage 1 which loads grub stage 2 which loads the ramdisk which loads the kernel which runs the main process. Whew!
still simple, isn't it?
01:33
If you say so :D
 
1 hour later…
02:47
so apparently #!/usr/bin/env ruby.exe is bad? App worked on Heroku for 20 pushes, and just stopped because of that line that I'm pretty sure was always there...
 
1 hour later…
03:54
howdy folks
 
2 hours later…
05:56
Hi all
 
5 hours later…
10:40
@CuddleBunny Try #!/usr/bin/env ruby (without the .exe)
@AtulKhanduri Hello, welcome.
Hi @Kitler. How's your day going?
Quite good, and yours? ^^
I'm glad to hear it. My day isn't really started. Feral cat woke me up (why do cats hate me so much?)... I'll try to go back to sleep in a bit.
surround your door with catnip
11:41
> Passing

A route can punt processing to the next matching route using pass:
punt being the scientific word
Anonymous
morning. First one in the office :P
13:20
@WayneConrad that makes more sense. I ended up sort of figuring out what was wrong. I had installed a PhantomJS buildpack a couple versions back and then Heroku started interpreting my entire app as PhantomJS instead of Ruby so I replaced it with the Ruby buildpack and it worked.
Anonymous
Anyone have a better idea to store the following hash? Would it be an array? Some other object class?
Anonymous
# Will be LS-ing directories, diff them, and compare dates modified of files
@files = {
  server => {
    dir => {
      file => date
    }
  }
}
@files[server][dir][file] = date
Depends what you're going to be using the hash for
Anonymous
if @files[server1] == @files[server2]
  next
else
  # ...
end
Anonymous
13:36
Something like that. I want to see if the filename/date in each directory of each server matches. If not, then I will compare the date of each file, and keep (cp to backup`) only the most recently updated versions of the file
Anonymous
I am not using an array because if sort was called, then the indexes would be messed up. At least a hash is like a dictionary, key/value pairs.
Anonymous
IDK if other classes would suit me. What other ways can you store multi-layered data like this?
I'd have to know more about the use case.

From my perspective, it looks ... backwards?
@files = [{
    file => {
        server,
        dir,
        date
    }
}, ... ]
Anonymous
oh, my, god
Anonymous
But that means it cannot have a file with the same info.
Anonymous
13:46
Can a key only have 1 value?
Do you need a key? I was thinking using indexes
Anonymous
Given 2 servers, with nearly identical directories (assume under ~/), I need to diff all subdirectories and files under there, from each of the 2 servers. And seeing if ~/dir/file from server A has the same, older, or newer modification date than from server B
Based on the name of the file?
Anonymous
No, I am doing ls --full-time to check the date it was modified. Given 2 servers, but the same dir/file, I need to see which server has the newer version of the file
@HunterStevens could you keep two tables and just diff those? Might be faster
Anonymous
13:50
How do you make tables in ruby?
Oh, okay
Anonymous
Not rails
you can keep a SQLite file or even a docdb equivalent
Anonymous
(my program worked, until I was told that I need to check a directory tree, not just a dir)
Anonymous
I do not think they want something saved, because this will run every minute, and must be faster than a minute to complete
13:52
@HunterStevens Just as a quick sanity check, if you're just after a tool to accomplish this, rsync is what you want, not a hand-built Ruby thing
maybe a tree? I don't know what tree-ish structures exist in Ruby but I've done something similar and waaaay smaller scale in Windows/C#
On the other hand, if you're just trying to learn Ruby, disregard that :)
Anonymous
@meagar We use rsync and gluster now, but apparently the two together do not work with large number of files, which we have
No idea what gluster is
I can't imagine doing an manual iteration and compare is oging to be faster
13:55
But rsync will work on any number of files
Anonymous
I have no clue, guys. I just want this to work
Anonymous
:-(
You could rsync terabytes of data around, it's one of the oldest most well tested and bomb-proof pieces of software I can think of
Maybe gluster and rsync are just running at the same time and stepping on feet?
Anonymous
@CuddleBunny I think so..?
13:57
Could be, I don't know how either program does it's job but maybe just giving them each some breathing room would fix the problem?
@HunterStevens have you seen this? blog.gluster.org/category/rsync
Anonymous
So rsync + gluster is too slow for us.
Anonymous
So somehow, doing it manually is faster
Anonymous
> rsync is single threaded
We need it to be multithreaded, in which it captures the filetrees in a different thread per server
Anonymous
14:17
I got it:
@meagar When file systems get very large, rsync can take a long time to decide what to transfer... I've seen on the order of 10 minutes before. glusterfs is for when it can be intolerable for the two file systems to be 10 minutes apart.
Anonymous
directories = Dir.glob '**/*'
files = Array.new
directories.each { |x| files.push(x) unless File.directory? dir }

@files = {
  CLIENT => {}
}

# ls operation for date

@files[CLIENT][filepath] = [date]

# Now the entire path, relative to where the client is mounted, is stored in the hash!
I've never thought of running glusterfs + rsync in parallel. I wouldn't imagine any good coming out of it. glusterfs is a little sensitive... it's easy to hurt its feelings and have it decide not to transfer files anymore.
Just like it says on the rsync page, you should probably add a skip in for directories named .glusterfs
 
1 hour later…
Anonymous
15:47
How do I ssh into a server, and change directory? I found the net/ssh gem but am having issues using it. I want to
1. ssh into server
2. `Dir.chdir` to something
3. call a method that requires `Dir.glob(**/*)` for the current working directory (see #2)
@HunterStevens I think net/ssh has an exec method to use
 
1 hour later…
Anonymous
17:01
I tried but IDK if I am doing it right :-/
could be causing it to lose state between steps 2 and 3 without them.
Anonymous
ls_threads = SERVERS.map do |server|
  Thread.new do
    case server
    when CLIENT
      Dir.chdir CLIENT_PATH
      grab_filenames_and_dates(server)
    when 'volume'
      Dir.chdir VOLUME_PATH
      grab_filenames_and_dates(server)
    else
      Net::SSH.start(server, USER) do |ssh|
        ssh.exec! Dir.chdir(BRICK_PATH)
        ssh.exec! grab_filenames_and_dates(server)
      end
    end
  end
end
ls_threads.each(&:join)

# method does an ls --full-time of the cd'd directory.
You should be able to ssh into any directory
One moment
Dir.chdir only changes local directory, not remote.
I believe doing ssh user@url cd some/place/you/want/to/go;<command> would do it
Alternatively, I think ssh user@url:/some/place/to/go might work
I've done this before, don't remember what I did
Anonymous
17:16
@WayneConrad Yep method not found.
I mean, if the server has ruby installed, you could put a script on the server and call it
Anonymous
Thing is, I need it in two steps. Doing the glob is exactly what I need, whereas doing ssh user@host cd path/to/something ls --full-time **/* is not the format i need.
Anonymous
:o it does have ruby!
I keep reading that starred message as 9" women can't make a baby in one month
Anonymous
lol
17:22
I guess that's true, too.
Anonymous
Wayne, any advice?
Anonymous
@CuddleBunny these docs are great! Do they apply to v2 as well?
@HunterStevens no idea, I've never actually used it :) Just done similar things in C#
Anonymous
17:38
Okay I am reading the docs. They seem helpful so far -- I understand how to initiate a session.
@HunterStevens No, Sorry.
I basically tackle all of my Ruby issues by throwing a "Ruby equivalent of C# <thing>" in Bing. Great for everything but deployment so far...
Anonymous
How is C#? I am interested in the free edX course by Microsoft.
Do you know Java?
Anonymous
i learned it but forgot it all
Anonymous
17:42
(except public static void)
Okay, it is pretty much the same. But with 100% less lameness. :)
Anonymous
is it as annoying? Everyone either hates (most) or love (few) java
Not nearly
It is my favorite by far, doesn't hurt that ASP.NET MVC is great, Azure is easy to use, and all of Microsoft's tooling, training, and documentation is spot on.
Anonymous
microsoft technologies are popular in NJ
C# is a better Java. I say that both to denegrate, and praise C# :) It's actually a much better Java.
But the language family is really, really old technology. Statically typed languages without type inference are annoying.
Java is the second best language for wearing out keyboards. Cobol comes first, I think.
Anonymous
17:53
lol
Anonymous
meh I feel sick
I thought C# had type inference?
@JanDvorak it does, sort of. They are inferred at compile time and not runtime mostly
Haskell doesn't even have RTTI, IIRC
there are anonymous types though
17:56
<3 Haskell's type system
Anonymous
@JanDvorak are you familiar with net-ssh?
Anonymous
ok
Anonymous
I need to do an ssh in ruby that requires multiple lines of bash
Anonymous
or whatever you call command line stuff
18:06
I believe I've done that with a subshell, and lots of very careful quoting. Something like ssh somebox "( do_a && do_b || do_c ; do_d )"
Sorry about the language opinions. The "maybe nobody really cares about your stupid opinion" circuit in my brain, which is usually pretty reliable, misfired.
Hey! My application.js is not compressing. here are the related files gist.github.com/anonymous/14614e9176d7659209c1
Anonymous
I just realized what I could do, possibly
18:23
@SonaliGupta looks like Smathy is helping you ;)
Jonathan: still getting nowhere. ;)
Just be patient, he's solid. I feel your pain though, lol.
Jonathan: okay! Let me see then
@SonaliGupta Hello, welcome.
wayne thanks!
18:54
If anyone has the time - gist.github.com/jonathanmusso/0d0bbdb53731a64583e1 - I have a major mental block going on here. I am not successful in displaying the contents of :notes as a string in the View. I've even created a double loop inside the view and the information is displayed exactly the same as .pluck.
19:09
@WayneConrad I think it is safe to hate Java anywhere :P
Java, the enemy that unites us? Heh.
That would be PHP
@JonathanMusso I don't understand show.html.erb... Why does it have inspected Ruby variables in it?
@WayneConrad That is the what is being displayed in the view...I can make a Screenshot if that helps
I feel kind of lost not seeing the actual view.
19:15
Do you mean full code view or pic?
Double looping inside the view displays that as well, looping in the method displays the full hash.
What I mean is that the gist doesn't show me the code...the source... to show.html.erb
Understood, added. Should be fine to refresh.
Anonymous
@JonathanMusso please comment (in the files) where the issues lie.
@HunterStevens ok
Anonymous
19:34
no clue how to handle it
alright, thank you for looking
Anonymous
20:04
0
Q: Executing a Ruby method inside a Net::SSH session

Hunter StevensRuby 1.9.3, net-ssh 2.9.2 I am working on a project, in which I need to diff the same directory (and its subdirectories) on two different servers (local and remote). From there, I need to copy the newest/recently modified files to the correct server, and delete from the remote if a file is not p...

Anonymous
I gave up -- looking for all of SO to help me :-/
20:22
The Tin Man is channeling @meager. Or the other way around.
This doesn't help, but I solved my issue....nothing wrong with my method, data got corrupted from switching to strong params in the controller. Went from shoveling Strings to Hashes...
Anonymous
LOL ikr?
Anonymous
I edited the Q to include why I cannot use rsync. @WayneConrad feel free to edit my explanation, since you know the struggle as well. (I feel like I did not explain it well.)

« first day (580 days earlier)      last day (2675 days later) »