Parse URL parameters using JavaScript

I recently found myself in a situation where I had very limited access to remote content and needed to perform specific actions conditionally. I wanted a quick and clean way to parse URL query parameters inline. var vars = {};   window.location.search.replace(/(?:^\??|&)([^&=]*)=?([^&]*)/g, function(i, j, k) { if (j) vars[j] = k; }); Given the URL:…

Add taxonomy terms to WordPress posts

Using core WordPress functions is ideal when possible for modifying any content. However, when you have hundreds of thousands of posts, updating post content such as taxonomy terms on many items at once can be quite slow. Use SQL statements to quickly update your content only if you know you aren’t going to need any…

Dovecot on Ubuntu 12.04

Having a local mail daemon is great for development and debugging without having to waste resources or depend on external configurations. Dovecot is a simple mail server for IMAP and POP support. Postfix is the established standard for Linux mail server support. apt-get install postfix apt-get install dovecot-postfix Installs: dovecot-core dovecot-imapd dovecot-managesieved dovecot-pop3d dovecot-sieve mail-stack-delivery…

ImageMagick 3.1.0 with WordPress 3.4.1

I installed ImageMagick for fun on a site I am building to see what differences it would make.  The image quality of resized thumbnails was drastically improved and immediately noticeable.  As expected, CPU utilization during image resizing was significantly higher, but I think it’s totally worth it! Installing the ImageMagick PHP module on Ubuntu Server 12.04 64-bit was super…

Updated Server

WordPress 3.4.1 has been installed with the following components: Ubuntu Server 12.04 AMI Nginx 1.2.1 config PHP-FPM 5.3.10 phpinfo() MariaDB 5.5.25

OpenSwan on Ubuntu 11.10

Openswan lets you set up IPSec VPNs. This guide was created on the Ubuntu 11.10 virtual machine image within Amazon EC2. Install utilities required for compilation: apt-get update apt-get install build-essential libgmp3-dev bison flex Fetch Openswan: wget http://www.openswan.org/download/openswan-2.6.37.tar.gz tar -zxf openswan-2.6.37.tar.gz cd openswan-2.6.37/ Compile and Install Openswan: make programs sudo make install Install L2TP sudo…

Varnish 3.0.0 on Ubuntu 11.04

Varnish 3.0.0 has some great new features. Varnish maintainers only provide Ubuntu repository for the LTS builds. Currently, Ubuntu 10.04 Lucid is the most recent LTS. However, I am running Ubuntu 11.04 Natty in my environment. My options to try the new build are to build Varnish from source or use the Lucid Varnish package.…

Install Request Tracker 4 with Nginx

Install spawn-fcgi:apt-get install spawn-fcgi Create init script (/etc/init.d/rt): #!/bin/sh RTPATH=/opt/rt4/RTUSER=www-data case $1 instart)echo -n “Starting RT: “spawn-fcgi -F 3 -u www-data -g www-data -a 127.0.0.1 -p 9000 \– /opt/rt4/sbin/rt-server.fcgiecho;; stop)echo -n “Stopping RT: “PIDS=`ps axww | awk ‘/[r]t-server.fcgi/ { print $1}’`if [ -n "$PIDS" ]thenecho -n kill -TERM $PIDSkill $PIDSechoelseecho RT not runningfi;; restart|force-reload)$0 stop$0…

Updated Nginx on Ubuntu 11.04

Get root: sudo -i Install apt-add-repository command: apt-get install python-software-properties Add official Nginx PPA repository: add-apt-repository ppa:nginx/stable Update repositories, upgrade or install module: apt-get update apt-get install nginx / apt-get upgrade