Checking the cause of a high TTFB (Time To First Byte) can be time consuming. And pinpointing the issue requires multiple tests against even the smallest changes. Enter Apache’s Benchmarking Tool ab to help with quick testing. ab -n 100 http://www.website.com/ The above command will execute 100 tests against the website entered. The results are… Continue reading Quickly Testing TTFB (Time To First Byte) with Apache Benchmarking Tool
Pushing Large Git Repository
Pushing a large Git Repository can cause issues; time-outs, disconnects or general freezing tend to happen with especially large Git Repos. The best way to handle pushing those large git repos is to break the pushes down into commit chunks. Using git log you can decide how far back and how many chunks you would… Continue reading Pushing Large Git Repository
Create Git Archive From Specific Commit Range
git archive -o ~/Desktop/update.zip HEAD $(git diff –name-only f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a –diff-filter=ACMRTUXB) The above command will create a zip archive from your git repo from commit ‘f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a’ to your latest commit being the HEAD. The –diff-filter=ACMRTUXB will prevent an error if you’ve deleted files between ‘f0ae46ac15a3d420c08de8ab440b4eb80b66bf7a’ and HEAD. The above example will produce a zip file on… Continue reading Create Git Archive From Specific Commit Range
OpenX – PHP 5.4.34 Upgrade Error Fix
If your OpenX installation is printing-out the following: Strict Standards: Non-static method PEAR::setErrorHandling() should not be called statically in /home/user/directory/lib/Max.php on line 222 Strict Standards: Non-static method OA::debug() should not be called statically, assuming $this from incompatible context in /home/user/directory/lib/max/ErrorHandler.php on line 134 Strict Standards: Non-static method Log::singleton() should not be called statically, assuming $this… Continue reading OpenX – PHP 5.4.34 Upgrade Error Fix
Why To Use LZMA Compression
There are always times when you zip, gzip and bzip2 files and directories to try and gain the highest compression ratio you can. But, have you tried LZMA compression? LZMA compression routinely obtains the highest compression ratio for any file type or directory of files. If you haven’t tried it, give it a try in… Continue reading Why To Use LZMA Compression
Prevent Ampersand Issues in Javascript on WordPress Pages & Posts
Ampersands in WordPress Posts and Pages are always encoded into either their numeric (&) or name (&) html entity. This can become troublesome if you are including javascript into the page or post. Using the ampersand’s unicode code point value (0026) is the best way around this issue. So writing ampersand would be done by… Continue reading Prevent Ampersand Issues in Javascript on WordPress Pages & Posts
Quickly Run A HTTP Server From Any Directory
Python makes it easy to run a simple http server from any directory on your system. From command line execute the following command from the directory you would like the server to run from: $ python -m SimpleHTTPServer 8080 A simple http server will be running with the root being whatever directory you executed the… Continue reading Quickly Run A HTTP Server From Any Directory
Debug and Inspect Webpages on AVD (Android Emulator) Browsers
There is a lot of documentation on the web on ways to debug websites for Android using their AVD (Android Virtual Device/Emulator). But I thought to make a simple step-by-step instruction to get a web debugger up and running for an AVD. Weinre is the debugger that I use. You can download weinre build from… Continue reading Debug and Inspect Webpages on AVD (Android Emulator) Browsers
SD Card Backup Image – Raspberry Pi Disk Clone
To make a backup / clone of an SD card from within OS X, open Terminal and run $ sudo dd if=/dev/disk2 bs=1m | gzip > ~/Desktop/raspberry_clone.gz (If you’re not sure what /dev/disk the SD card is, run $ diskutil list and you’ll see where the SD Card is mounted). It can take a while… Continue reading SD Card Backup Image – Raspberry Pi Disk Clone
Batch Rename files in 1 Shell Command
i=0; for x in *.jpg; do cp $x “image_$i.jpg”; i=$(($i+1)); done The above command will copy all jpeg files in a directory and give them a new name with an iterating numerical value. So if you had five images in a directory: bird.jpg, cat.jpg, dog.jpg, fish.jpg and hamster.jpg Executing the above command in the directory… Continue reading Batch Rename files in 1 Shell Command