Posts

Proxy.pac generator

· Linux, Networking, Software, www

I made a simple bash script that generates a proxy auto configuration file.

The PAC file generated redirects all matching rules through the proxy.

The only issue at the moment, is that, once the list gets big, it’s not very performance-friendly. Something I’ll try to fix in the coming days.

I’m using this script to generate a proxy.pac file at work to redirect blocked content in China through the proxy for our employees currently in China.

Compile wget on Mac OS X

· Apple, Software, www

There's a precompiled wget available on the net, but it's not automatically accepting StartSSL's certificates. And as it seems, there's a wget update available that did.

This is what I had to do to compile it on my Macbook Pro;

  • Install Xcode, if you haven't, and be sure to select UNIX Dev Support.

Or you'll get this error:

configure: error: C compiler cannot create executables
  • Export Xcode's gcc PATH:
PATH=/Developer/usr/bin/:$PATH
  • Download wget
  • In Terminal: untar it
tar xvzf wget-latest.*
  • And compile it
cd wget directory
./configure
make
sudo make install
  • In case you had an old (precompiled) wget installed;
    remove that version first (/usr/bin/wget probably).
    By default, this one will install itself in /usr/local/bin/wget which should be in your $PATH as well (in case it's not, make a symlink from the old /usr/bin/wget to /usr/local/bin/wget, or recompile with other installation directories).

How to get rid of spambots on WP?

· www

Simple, start using SSL.

Not entirely sure why this keeps spambots away, but a drop from ~100 spam comments/day (1/2) to at most 4 seems pretty cool.

Edit: seems like they just do a POST request to an old URL (http://blog.tuinslak.org/some-post), which results in this reply:

HTTP/1.1 301 Moved Permanently
Server: nginx/0.9.4
Date: Tue, 22 Feb 2011 07:10:24 GMT
Content-Type: text/html
Content-Length: 184
Connection: close
Location: https://blog.tuinslak.org/

I’m guessing once they rescan the new URLs they’ll be spamming again. Just a matter of time for them to update their “bookmarks”. ;)