compression

Deleting files after adding to tar archive

牧云@^-^@ 提交于 2019-12-02 19:59:22
Can GNU tar add many files to an archive, deleting each one as it is added? This is useful when there is not enough disk space to hold both the entire tar archive and the original files - and therefore it is not possible to simply manually delete the files after creating an archive in the usual way. Fred Foo With GNU tar, use the option --remove-files . Cristopher Plasma I had a task - archive files and then remove into OS installed "tar" without GNU-options. Method: Use "xargs" Suppose, we are have a directory with files. Need move all files, over the week into tar and remove it. I do one

CSS/JS GZip Compression with Asp.Net

こ雲淡風輕ζ 提交于 2019-12-02 19:38:43
I am currently on a hosted Virtual Server, I want to enable GZip compression for my Asp.Net 3.5 site, how do I go about starting? I have tried using 'packed' JS files, but they don't work, I am assuming it's because they are not handled correctly...? GZIP should be handled by IIS , what version of IIS are you running? The client is responsible for asking the server for a GZiped version. The server will be looking for two things, the request is http 1.1, and a header of Accept-Encoding: gzip. An easy way to look for these headers is to use firebug IIS6 - GZip can be enabled with the iis snap-in

What is the fastest way to extract 1 file from a zip file which contain a lot of file?

流过昼夜 提交于 2019-12-02 19:31:33
I tried the java.util.zip package, it is too slow. Then I found LZMA SDK and 7z jbinding but they are also lacking something. The LZMA SDK does not provide a kind of documentation/tutorial of how-to-use, it is very frustrating. No javadoc. While the 7z jbinding does not provide a simple way to extract only 1 file, however, it only provide way to extract all the content of the zip file. Moreover, it does not provide a way to specify a location to place the unzipped file. Any idea please??? What does your code with java.util.zip look like and how big of a zip file are you dealing with? I'm able

Are there any agressive CSS Minification tools?

放肆的年华 提交于 2019-12-02 19:29:52
I'm wondering if anyone knows of a tool that will aggressively rewrite CSS to compress styles more efficiently. e.g. I'd like: .foo { color : red; font-size: 16px; height: 20px; } .bar { color : red; font-size: 16px; height: 30px; } to be compressed to: .foo, .bar { color : red; font-size : 16px; } .foo { height : 20px; } .bar { height : 30px; } To be clear, all the minifiers I know of, like YUI Compressor, only remove white-space and possibly join a few properties (like font-family and font-size into font ). I'm looking for something that's willing to do a complete re-write of the structure

How to compare two tarball's content

偶尔善良 提交于 2019-12-02 18:54:11
I want to tell whether two tarball files contain identical files, in terms of file name and file content, not including meta-data like date, user, group. However, There are some restrictions: first, I have no control of whether the meta-data is included when making the tar file, actually, the tar file always contains meta-data, so directly diff the two tar files doesn't work. Second, since some tar files are so large that I cannot afford to untar them in to a temp directory and diff the contained files one by one. (I know if I can untar file1.tar into file1/, I can compare them by invoking

asp.net mvc compress stream and remove whitespace

心已入冬 提交于 2019-12-02 18:34:36
So I am compressing my output stream via an action filter: var response = filterContext.HttpContext.Response; response.Filter = new DeflateStream(response.Filter), CompressionMode.Compress); Which works great. Now, I would also like to remove the excess whitespace present. I found Mads Kristensen's http module http://madskristensen.net/post/A-whitespace-removal-HTTP-module-for-ASPNET-20.aspx . public class WhitespaceFilter : Stream { // using Mads Kristensen httpModule // http://madskristensen.net/post/A-whitespace-removal-HTTP-module-for-ASPNET-20.aspx private Stream os; private static Regex

Compress Python Object in Memory

痞子三分冷 提交于 2019-12-02 18:30:56
Most tutorials on compressing a file in Python involve immediately writing that file to disk with no intervening compressed python object. I want to know how to pickle and then compress a python object in memory without ever writing to or reading from disk. I use this to save memory in one place: import cPickle import zlib # Compress: compressed = zlib.compress(cPickle.dumps(obj)) # Get it back: obj = cPickle.loads(zlib.decompress(compressed)) If obj has references to a number of small objects, this can reduce the amount of memory used by a lot. A lot of small objects in Python add up because

Enabling gzip compression for Jboss

帅比萌擦擦* 提交于 2019-12-02 18:30:38
How is gzip compression for Jboss 5.1.0 enabled? Within the tomcat http connector right? I cant remember where this file is stored, server.xml? The file is under server.xml and you are correct in stating that you have to updated the http connector. Following link is info for tomcat, but same applies to JBoss except location of server.xml file. I believe you need to update the server.xml under deploy\jbossweb.sar\ http://viralpatel.net/blogs/2008/11/enable-gzip-compression-in-tomcat.html James Clarke edit jboss\server\default\deploy\jbossweb.sar\server.xml Edit this: <Connector protocol="HTTP/1

How to compress files

早过忘川 提交于 2019-12-02 18:22:23
I want to compress a file and a directory in C#. I found some solution in Internet but they are so complex and I couldn't run them in my project. Can anybody suggest me a clear and effective solution? You could use GZipStream in the System.IO.Compression namespace .NET 2.0. public static void CompressFile(string path) { FileStream sourceFile = File.OpenRead(path); FileStream destinationFile = File.Create(path + ".gz"); byte[] buffer = new byte[sourceFile.Length]; sourceFile.Read(buffer, 0, buffer.Length); using (GZipStream output = new GZipStream(destinationFile, CompressionMode.Compress)) {

Zip-file that contains nothing but itself?

戏子无情 提交于 2019-12-02 17:58:17
Just out of curiosity, does there exist a valid zip-file (according to format spec) that, contains nothing but itself? Put another way, does the function implemented by unzip have a fix-point? Can I write a program to search for such a fix-point in a intelligent (not-exhaustive) way? I've thought about the opposite as well, i.e. if zip has a fix-point, but presumably a file can be compressed in different ways (different algorithms, different levels of compression and so on), thus whether or not f = zip(f) holds for some file f is probably implementation dependent. Since the zip-compression is