Pure ruby stream compression library?

Anybody know of one? Compression speed or ratio is not important. Need
to do in-memory compression/decompression of strings. No dependency to C
libraries (zlib, libbzip2, lzo, etc) nor external commands (zip/unzip,
gzip, etc).

···


dave

No I don’t, but I’m interested in this problem:

  • Why do you not want external libraries?
  • Does it have to be a stream compression library?
    You could get better results if you allow the data to be read in chunks.

Daniel.

···

On Mon, May 05, 2003 at 04:03:31PM +0900, David Garamond wrote:

Anybody know of one? Compression speed or ratio is not important. Need
to do in-memory compression/decompression of strings. No dependency to C
libraries (zlib, libbzip2, lzo, etc) nor external commands (zip/unzip,
gzip, etc).


dave


Daniel Carrera
Graduate Teaching Assistant. Math Dept.
University of Maryland. (301) 405-5137

Oh, and one more question, do you only need it to work on Ruby strings?
Or does it have to be generic data?

Daniel.

···

On Tue, May 06, 2003 at 04:30:12AM +0900, Daniel Carrera wrote:

No I don’t, but I’m interested in this problem:

  • Why do you not want external libraries?
  • Does it have to be a stream compression library?
    You could get better results if you allow the data to be read in chunks.

Daniel.

Daniel Carrera wrote:

No I don’t, but I’m interested in this problem:

  • Why do you not want external libraries?

The application is to likely be deployed on a shared hosting server
where I can’t control the environment. It’s good enough that Ruby is
provided.

Btw, come to think of it, zlib library should be common enough that when
ruby is there very good chances is zlib is also there.

  • Does it have to be a stream compression library?
    You could get better results if you allow the data to be read in chunks.

What I meant was stream-oriented, the way zlib or tar works. Contrast
this with, say, zip or rar, which is file-oriented (you can’t pipe a
data onto zip to compress it, for instance). So chunk processing is an
orthogonal issue.

Oh, and one more question, do you only need it to work on Ruby strings?
Or does it have to be generic data?

Ruby strings is sufficient. I can load and unload the data to Ruby
strings first.

···


dave

If it’s a shared hosting server that lets you upload Ruby scripts, then I
don’t suppose they could stop you uploading or compiling your own copy of
zlib (or if the compilers have been removed, uploading your own copy of gcc
first :slight_smile:

If you don’t have shell access, try uploading this:

#!/usr/local/bin/ruby
require ‘cgi’
c = CGI::new
print c.header
puts “Enter command: ”
if c[‘command’][0]
puts “


$stdout.flush
system “#{c[‘command’][0]} 2>&1”
$stdout.flush
puts “

end

Suggestion: use .htaccess to prevent the whole world seeing this script, if
you don’t want to incur your webmaster’s wrath…

Cheers,

Brian.

···

On Tue, May 06, 2003 at 10:53:44PM +0900, David Garamond wrote:

Daniel Carrera wrote:

No I don’t, but I’m interested in this problem:

  • Why do you not want external libraries?

The application is to likely be deployed on a shared hosting server
where I can’t control the environment. It’s good enough that Ruby is
provided.

Btw, come to think of it, zlib library should be common enough that when
ruby is there very good chances is zlib is also there.

Saluton!

If you don’t have shell access, try uploading this:
system “#{c[‘command’][0]} 2>&1”

With server setup done properly that will not work. Not because this
is blocked but because you are in a jail without compilers and the
like.

Besides that running arbitrary commands may violate the terms of use
of your provider.

Just my 0.02 questionmarks (that is a running gag in Europe - many
systems display the euro symbol identical to a question mark).

Gis,

Josef ‘Jupp’ Schugt

···


e-mails that do not contain plain text, are larger than 50 KiB, are
unsolicited, or contain binarys are ignored unless payment from your
side or technical reasons give rise to a non-standard treatment.

If you don’t have shell access, try uploading this:
system “#{c[‘command’][0]} 2>&1”

With server setup done properly that will not work. Not because this
is blocked but because you are in a jail without compilers and the
like.

So, compile whatever you want on another box and upload it. Shared libraries
missing? Upload them, or link your binaries statically.

If you have rights to upload code and execute it, this is equivalent rights
to full shell access - within your chroot jail if configured, but that
doesn’t matter. If you want a Ruby extension which uses zlib.a/zlib.so but
it’s not on the system, technically you can upload your own.

Besides that running arbitrary commands may violate the terms of use
of your provider.

I don’t disagree there. I should have put
raise “don’t run this”
as the first line of that script :slight_smile:

Cheers,

Brian.

···

On Wed, May 07, 2003 at 09:32:17AM +0900, Josef ‘Jupp’ Schugt wrote: