Working with a WordPress site…

Working with a WordPress site where you have a lot of hardcoded image URLs, but the actual images aren’t in your repository.

One way to deal with the broken images is to use an nginx rule to rewrite the images url to a remote staging site.

Here’s my nginx configuration file, located at vagrant/www/{my-site}/provision/vvv-nginx.conf.tmpl:

server {
    listen       80;
    listen       443 ssl;
    server_name  {{DOMAINS_HERE}};
    root         {vvv_path_to_site}/public_html;

    error_log    {vvv_path_to_site}/log/error.log;
    access_log   {vvv_path_to_site}/log/access.log;

    set          $upstream {upstream};

    include      /etc/nginx/nginx-wp-common.conf;

	location ~* \.(gif|jpg|jpeg|png)$ {
		if ($uri ~ "^/wp-content/uploads/[^/]*/.*$"){
			set $rule_0 1$rule_0;
		if ($rule_0 = "1"){
			rewrite ^/(.*)$$1 last;

Note that the .tmpl file is used rather than the .conf file, and that the `location` block is within the server block.



Every company needs it’s own…

Every company needs it’s own special VVV configuration, and so far, it’s been a bitch to set it up every time. However, I succeeded, after several hours. Tom J Nowell helped me out with the last detail –

First day at As…

First day at As usual, there’s a lot of software to install. First is Thunderbird, so I can enjoy a nice separation between work and personal email.

Next, pritunnel for vpn’ing.

Git is hard

I keep on coming back to this SO answer:

How to check out a remote branc:

Get urls out of href



Strip classes out of html



Slurp up all text between two tags

<footer class="entry-footer">(\s*.*\s*)<\/footer>