Category Archives: Sysadmin

Reverse Proxying to WordPress.com

I wanted to do a reverse proxy to wordpress.com in order to integrate an existing wordpress.com blog into an existing site. This turned out to be a little trickier than I’d thought due to wordpress.com’s usage of gzip deflation of their output.

Figured this out thanks to sound advice here and here:

  ...

  <Proxy *>
        Allow from .mysite.com
  </Proxy>
  ProxyPass / myblog.wordpress.com
  ProxyPassReverse / http://myblog.wordpress.com/
  ProxyHTMLURLMap http://myblog.wordpress.com/ /
  <Location />
    SetOutputFilter proxy-html
    # get rid of Content-Encoding at wordpress end
    # To use this you'll need to do (on debian) a2enmod headers
    RequestHeader unset  Accept-Encoding

    # Alternative method: inflate then deflate again ... (requires more effort at our end)
    # Could NOT get this to work (though suggested by both reference sites!)
    # SetOutputFilter INFLATE;proxy-html;DEFLATE
  </Location>

  ....

Subversion Hacks

Automatically Adding or Removing Files

Especially useful when, for example, versioning /etc/:

Files to remove:

svn stat -q | grep '^!' svn stat -q | grep '^!' | sed -e 's/^!\s*//' | xargs | svn rm

Files to add:

svn stat | grep '^?' svn stat -q | grep '^?' | sed -e 's/^?\s*//' | xargs | svn rm

find . -name 'dpkg-old' -exec rm -i {} \;