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

AWS EC2 Amazon Linux AMI change timezone

AWS (Amazon Web Services) EC2 Amazon Linux AMI timezone will most likely be different than your local machines’ timezone. To remedy this issue on Amazon’s Linux machine image, ssh in and type the following commands in prompt: sudo su become root user ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime Choose your time zone ( in this example Toronto… Continue reading AWS EC2 Amazon Linux AMI change timezone

Solving WordPress’s White Screen of Death

WordPress has an issue that can be dumbfounding to say the least. An occurrence called the “White Screen of Death” can happen for really any issue; incompatible plugin, theme bug, an update to a file, etc. But it’s the blank screen with no information that is the difficult part of solving the blank screens cause.… Continue reading Solving WordPress’s White Screen of Death

How to Get The Domain and TLD from a URL using PHP and Regular Expression

How to get a domain and it’s TLD from a URL string using PHP and Regular Expression: preg_match(“/[a-z0-9\-]{1,63}\.[a-z\.]{2,6}$/”, parse_url($_url_string, PHP_URL_HOST), $_domain_tld); echo $_domain_tld[0]; This is particularly useful for dealing with country TLD’s, like co.uk, on.gc along with the general .com, .net, etc. It is also capable of ruling-out multiple subdomains like: http://i83tr.cdn-2.delivery.net/homepage/sprite.png so you end… Continue reading How to Get The Domain and TLD from a URL using PHP and Regular Expression