How can I tell if my server is serving GZipped content?

It looks like one possible answer is, unsurprisingly, curl: $ curl http://example.com/ –silent –write-out “%{size_download}\n” –output /dev/null 31032 $ curl http://example.com/ –silent -H “Accept-Encoding: gzip,deflate” –write-out “%{size_download}\n” –output /dev/null 2553 In the second case the client tells the server that it supports content encoding and you can see that the response was indeed shorter, compressed.

JavaScript implementation of Gzip [closed]

Edit There appears to be a better LZW solution that handles Unicode strings correctly at http://pieroxy.net/blog/pages/lz-string/index.html (Thanks to pieroxy in the comments). I don’t know of any gzip implementations, but the jsolait library (the site seems to have gone away) has functions for LZW compression/decompression. The code is covered under the LGPL. // LZW-compress a … Read more

Why use deflate instead of gzip for text files served by Apache?

Why use deflate instead of gzip for text files served by Apache? The simple answer is don’t. RFC 2616 defines deflate as: deflate The “zlib” format defined in RFC 1950 in combination with the “deflate” compression mechanism described in RFC 1951 The zlib format is defined in RFC 1950 as : 0 1 +—+—+ |CMF|FLG| … Read more

Enable IIS7 gzip

Configuration You can enable GZIP compression entirely in your Web.config file. This is particularly useful if you’re on shared hosting and can’t configure IIS directly, or you want your config to carry between all environments you target. <system.webServer> <httpCompression directory=”%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files”> <scheme name=”gzip” dll=”%Windir%\system32\inetsrv\gzip.dll”/> <dynamicTypes> <add mimeType=”text/*” enabled=”true”/> <add mimeType=”message/*” enabled=”true”/> <add mimeType=”application/javascript” … Read more

TypeError: ‘str’ does not support the buffer interface

If you use Python3x then string is not the same type as for Python 2.x, you must cast it to bytes (encode it). plaintext = input(“Please enter the text you want to compress”) filename = input(“Please enter the desired filename”) with gzip.open(filename + “.gz”, “wb”) as outfile: outfile.write(bytes(plaintext, ‘UTF-8’)) Also do not use variable names … Read more

Command Line Tool – Error – xcrun: error: unable to find utility “xcodebuild”, not a developer tool or in PATH

I solved that problem by setting the Command Line Tools in Xcode. Go to: Xcode > Preferences > Locations And select the command line tool from the dropdown. If you have only one version of Xcode installed, there should be only one option. If you have several versions of Xcode, then you must choose the … Read more

How do I tar a directory of files and folders without including the directory itself?

Use the -C switch of tar: tar -czvf my_directory.tar.gz -C my_directory . The -C my_directory tells tar to change the current directory to my_directory, and then . means “add the entire current directory” (including hidden files and sub-directories). Make sure you do -C my_directory before you do . or else you’ll get the files in … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)