Snippets
I’ve done this a couple of times now so it needs recording. Every now and then someone manages to sneak a load of spam into my mailqueue which does nasty things to my server. Its a matter of identifying the spam and deleting it from the queue. Sometimes I also create a firewall filter for [...]
Working with other developers on projects has often resulted in large manual merges of parallel work. At the beginning this is straightforward as there are a small number of files and a short history. Things change as projects progress and I’ve sometimes spent hours on small updates.
Here is a git recipe for merging in those [...]
We were trying to track our Magento installs in git. I’d noticed that our source project contained more files than the clone
diff -rq [source] [clone] | grep -v git
Turns out that Magento has a lot of empty directories around. Easy way to fix that
find . -type d -empty -exec touch {}/.gitignore \;
via stackoverflow.com
Using ffmpeg we can quickly composite stills into a movie.
ffmpeg -f image2 -r 25 -i ./%d.jpg -b 1000k outfile.mp4
Where
-f is the input format. Always image2 when we are sequencing.
-r is the frame rate. PAL video is 25fps.
-i are the input files. The %d means sequentially numeric. This inputs files ending in jpg
-b bitrate
and lastly the [...]
SFTP is all well and good. Rsync is better. But when you have thousands of small files it can really drag. This snippet uses tar to bundle the files together and bring them over as a lump.
ssh remotehost “( cd /somewhere ; tar cf – something ) ” | tar xf -
Via http://www.koopman.me/2008/11/tar-pipe-ssh/
This is an example of the Issuu PDF flash viewer. For a low cost House of Laudanum can provide your website with an advertisement free version in which to showcase your PDF’s.
Open publication – Free publishing – More viewer
So I’ve never had to create a boot job that didn’t suit the defaults but today I did. And it took ages to figure out the `right` way to do it. Mostly because I was not correctly removing the previous entry.
Refresher. Create a boot job with the defaults
$ sudo update-rc.d bloodbath defaults
Ok. It’s not clear [...]
You can quickly install matching packages using this method.
List the packages installed
dpkg -l | awk ‘{print $2}’ > installed-packages.txt
Use the list to install on the target machine
sudo apt-get install `cat installed_packages.txt`
Browsers cache (temporarily store) lots of files used to display websites you’ve recently visited. This can be difficult when you’re developing websites as you can often be looking at old versions of parts of the page.
Notoriously difficult to refresh are CSS (styles), javascript (behaviours) and Flash movies.
There are lots of tricks – holding the Shift [...]
In order to use some pear libraries and also use sessions properly in php you might need to create a vhosts.conf file for your mediatemple install.
To get it all working in a subdomain I had to create a vhost.conf file in the subdomains/[subname]/conf/vhosts.conf file too. Here is the contents of mine. You’ll need to be [...]