Over this past weekend I decided it would be a good idea to try to install Microsoft Windows 8 to my desktop computer. The University I attend recently acquired a Microsoft Dreamspark Premium subscription so it seemed like a good idea to give it a try. I had already set aside 25% of free space on my SSD when I reinstalled Windows 7 earlier last month, so I thought the process would go smoothly. Long story short, somehow I managed to accidentally format my entire data hard drive (over 750 GB worth of information). I did not realize what had happened until I booted into Windows 8. To make matters worse, Windows 8 automatically formatted and placed files on the drive – making chances of recovery even less likely. I frantically shut down my computer and came up with a plan to hopefully get my data back. I had a copy of Redo Backup burned to a CD that I used to access TestDisk, a partition and data recovery tool. Using TestDisk, I was able to locate the partition on my data hard drive and re-write it to the partition table on the disk. The next step was to run a chkdsk scan of the disk, which Windows performed automatically when I restarted the computer. The quick chkdsk run corrected lots of index errors on the drive and all seemed to be working ok. Just to ensure everything would be safe, I scheduled a more thorough chkdsk on the drive and let that run for a few hours. Thahnkfully, I was able to recover my partition and all of my data. I was fortunate enough to have a recent backup of the most important data, but I still would have lost all of my Music, Downloads, Pictures, and Eclipse Workspace Projects.
Amazon S3 cPanel Backup Script
This script is the same script we use at dewPixel Hosting to backup all of the accounts on our cPanel server. It is able to retain both daily and weekly backups (as configured by cPanel’s built-in backup configuration in the Web Host Manager (WHM)). FIrst, you will need to install and configure s3cmd. s3cmd is a command line tool for uploading and downloading data from Amazon S3. Once you’ve got s3cmd setup, you will need to login to your server as the root user. Once in your server, execute the commands below, which creates and marks executable the postcpbackup script. cPanel automatically runs this script after the backup process has finished.
touch /scripts/postcpbackup chmod +x /scripts/postcpbackup |
Once you have executed the command, edit the file using your favorite editor (vim, nano, pico, etc) and paste the following into the file:
#!/bin/sh echo "---------[ S3 Backup Begin - `date` ]---------" /usr/bin/s3cmd sync --delete-removed -r /backup/cpbackup/daily/ s3://{BUCKE_NAME}/cpbackup/daily/ /usr/bin/s3cmd sync --delete-removed -r /backup/cpbackup/weekly/ s3://{BUCKE_NAME}/cpbackup/weekly/ echo "---------[ S3 Backup Complete - `date` ]---------" |
Be sure to change the {BUCKET_NAME} to the S3 bucket you wish the backups to be uploaded to. If you do not want to do daily backups, then just remove the line that uploads the daily folder.
After that, configure cPanel backup from within WHM, and voila you now have a fully automated S3 backup script.
The Joys of Sending Mail to Hotmail
Microsoft Hotmail’s Smartscreen spam prevention service is quite possibly one of the most difficult filters to deal with as a web host. At dewPixel Hosting we have recently been having an issue sending emails to Hotmail, Live, and Outlook users because the server IP address got on Microsoft’s internal blacklist. Despite not being on any of the other DNSBL black lists, using SPF, and having a PTR record, Microsoft somehow found the need to add our IP address to their blocklist. Having been in the web hosting business for a few years I’ve had to deal with Microsoft’s spam filter quite a few times between different server upgrades and transfers.
The most effective way I have found to resolve issues sending to Hotmail is to create a ticket with the Hotmail Delivery Issue Submission form. Normally this isn’t very hard to find, but for some reason Microsoft decided to change the URL to the form. The form used to be located at https://support.msn.com/eform.aspx?productKey=edfsmsbl&ct=eformts but has now moved to https://support.msn.com/eform.aspx?productKey=edfsmsbl2&ct=eformts. Trying to find this new URL was not an easy task, as even posts on the official Microsoft forums referred to the old URL, which redirects you to the main MSN support page with no links to the proper form.
Special thanks for the new link goes to http://foxpa.ws/2012/09/12/e-mails-to-hotmail-bounce-550-sc-001-part-of-your-network-is-on-our-block-list/.
Research Project Introduction
Throughout my Spring 2013 semester at the University of Akron I will be posting information that I will be compiling together as part of my Honors Research Project, a requirement for graduating from the Honors College at the University of Akron. My research project will focus on analyzing a multitude of PHP frameworks and comparing them based on performance, design and implementation, and security. For each framework I will build a straightforward example application such as a simple blog or movie library of some sort. All example code will be posted and it will be open source. Tentatively I plan on investigating the following frameworks as part of my research:
- Code Igniter
- Symphony 2
- Yii
- CakePHP
- Zend
- PRADO
As I investigate these frameworks I will be posting my analysis of them as they are completed.
WordPress Shell Update Script
Hello everyone, today I am going to share with you a shell script I have been using to easily update my WordPress blog installation (and can easily be expanded to upgrade multiple blogs as well). The script I wrote automatically downloads the latest version of WordPress, extracts it, and updates your blog files. In order to run this script you will need SSH access and the ability to run shell scripts. This script was written to work with my host which runs on cPanel, but it can easily be altered to work on other systems as well by modify the directories. Below are instructions on how you can go about using this shell script to easily upgrade your blog.
- Login to SSH with your cPanel username and password
- Create a directory called upgrade_blog/ in your home directory (mkdir ~/upgrade_blog)
- Navigate to the upgrade_blog directory (cd ~/upgrade_blog)
- Create a new file called “run.sh” using your text editor of choice (I use nano)
- Paste the following code into the run.sh file:
rm -rdf ~/upgrade_blog/latest.zip ~/upgrade_blog/wordpress/ wget http://wordpress.org/latest.zip unzip latest.zip cp -r ~/upgrade_blog/wordpress/* ~/public_html/blog/
- Save the file
- To update your blog just simply navigate to the upgrade_blog/ directory in SSH and execute the run.sh file (sh run.sh)
- The script automatically downloads the latest version of WordPress and updates your blog accordingly.
- Once the script has finished executing open up your blog and go to your admin. WordPress will ask you to upgrade your database if it is needed.
- If you want to upgrade multiple blogs just copy the last line from the script and change the directory it copies the WordPress files to.
- Note: This script is based off of of the assumption that your blog is located in public_html/blog if your blog is located elsewhere change it.
And that’s all there is to it. Enjoy.
Purely CSS-Based Dropdown Menu
Here is a purely CSS-based dropdown menu that I threw together real quick for my blog. It doesn’t use any javascript and works in the latest versions of all major browsers.
If you have any issues or questions leave them in a comment below.
Please Note: This is just a simple example for you to base your own menus off of. It does not take into account browser screen width or height (to prevent opening menus off-screen) because that would require Javascript, maybe in the future I will create another post about how to make a JavaScript based dropdown menu that uses Javascript to make sure the menus don’t appear off-screen.
Dynamic PHP Font Generator
This is a little script I expanded upon that I found from one of my previous clients. The original script was created by Stewart Rosenberger. The WP Now website uses this script to dynamically generate testimonial signatures.
Continue reading