Monthly Archives: January 2014

A nice article of how set up a backup of your website with rysnc and centos 6

This article provides a quick way to backup the most common things in a typical web hosting scenario: website files and database data. We will setup a full daily backup of a website folder and a copying of this data to a remote server (this can also work for another VPS). We will also set up a rsync example to just copy the incremental changes. Finally, we’ll set up backup of a MySQL database. The procedures described use a few simple Bash commands, rsync and cron to schedule backups. For example data, we can install WordPress as per this tutorial. It will place WordPress in /var/www/wordpress directory and a MySQL database wordpress and we now want to take a backup of all the data.

Read more at: https://www.digitalocean.com/community/articles/how-to-create-an-off-site-backup-of-your-site-with-rsync-on-centos-6

HOORAY! for Digital Ocean!

YET another Cloud vs Dedicated vs Colocation comparison

SUMMARY: The answer will surprise you. Colocation can be a much better option than cloud for certain types of applications. Read on to see why

Colocation, which means buying your own hardware up front and running and managing it in a third-party site,  is not usually seen as a cheaper alternative to cloud. But, oddly enough, it can be.

Last week I compared cloud instances against dedicated servers showing that for long running uses such as databases, it’s significantly cheaper if you go with dedicated servers, but that’s not the end of it. Since you are still paying for those server resources every month, if you project the costs out 1 or 3 years, you end up paying much more than if you had just bought the hardware outright. This is where buying your own hardware and colocating it becomes a better option.

Continuing the comparison with the same specs for a long running database instance, If we price a basic Dell R415 with x2 processors each with 8 cores, 32GB RAM, a 500GB SATA system drive and a 400GB SSD, then the one-time list price is around $4000 – more than half the price of the SoftLayer server at $9,468/year we came up with in our previous analysis.

Remember, again, that this is a database server so while with Rackspace, Amazon and SoftLayer you pay that price every year, after the first year with colocation the annual cost drops to $1932 because you already own the hardware. Further, the hardware can also be considered an asset which has tax benefits.

Source: http://gigaom.com/2013/12/07/want-to-reduce-your-cloud-costs-70-percent-heres-how/

Add or edit a post to wordpress with PHP

Since 2010 that I’m using this script to post content on some of my 10s blogs.
I got it from WORDPRESS XMLRPC – POSTING CONTENT FROM OUTSIDE WORDPRESS ADMIN.

Add a post to wordpress with PHP

<?php

require_once("IXR_Library.php.inc");
$client->debug = true; //Set it to false in Production Environment

$title="Blog Title"; // $title variable will insert your blog title
$body="Blog Content"; // $body will insert your blog content (article content)
$category="category1, category2"; // Comma seperated pre existing categories. Ensure that these categories exists in your blog.
$keywords="keyword1, keyword2, keyword3";
$customfields=array('key'=>'Author-bio', 'value'=>'Autor Bio Here'); // Insert your custom values like this in Key, Value format

$title = htmlentities($title,ENT_NOQUOTES,$encoding);
$keywords = htmlentities($keywords,ENT_NOQUOTES,$encoding);

$content = array(
'title'=>$title,
'description'=>$body,
'mt_allow_comments'=>0, // 1 to allow comments
'mt_allow_pings'=>0, // 1 to allow trackbacks
'post_type'=>'post',
'mt_keywords'=>$keywords,
'categories'=>array($category),
'custom_fields' => array($customfields)
);

// Create the client object
$client = new IXR_Client('Your Blog Path/xmlrpc.php');
$username = "USERNAME";
$password = "PASSWORD";

$params = array(0,$username,$password,$content,true); // Last parameter is 'true' which means post immediately, to save as draft set it as 'false'

// Run a query for PHP if (!$client->query('metaWeblog.newPost', $params)) {
die('Something went wrong - '.$client->getErrorCode().' : '.$client->getErrorMessage());
} else { echo "Article Posted Successfully"; } ?>

Edit a post in wordpress with PHP

Continue reading Add or edit a post to wordpress with PHP

NSA’s ANT Division Catalog of Exploits for Nearly Every Major Software/Hardware/Firmware

After years of speculation that electronics can be accessed by intelligence agencies through a back door, an internal NSA catalog reveals that such methods already exist for numerous end-user devices.

(…)

A document viewed by SPIEGEL resembling a product catalog reveals that an NSA division called ANT has burrowed its way into nearly all the security architecture made by the major players in the industryincluding American global market leader Cisco and its Chinese competitor Huawei, but also producers of mass-market goods, such as US computer-maker Dell and Apple’s iPhoneSee: Cisco / Dell /Apple Comments Re: NSA Backdoors

Read more at http://leaksource.wordpress.com/2013/12/30/nsas-ant-division-catalog-of-exploits-for-nearly-every-major-software-hardware-firmware/

 

HipHop-Vagrant-VM

HipHop for PHP (shortened as HipHop) describes a series of PHP execution engines and improvements created by Facebook. The original motivation of HipHop was to save resources on Facebook servers, given the large PHP codebase of facebook.com. As development of HipHop progressed, it was realized that HipHop could substantially increase the speed of PHP applications in general. Increases in web page generation throughput by factors of up to 6 have been observed over Zend PHP.

Source: http://en.wikipedia.org/wiki/HipHop_for_PHP

 

Setup a test environment for HipHop VM.
The final VM will contain HHVM, Nginx, PHP, MySQL, ab.

Some graphs comparing PHP 5.3, PHP 5.5 and HHVM.
https://blog.liip.ch/archive/2013/10/29/hhvm-and-symfony2.html