Archive for the ‘aws’ Category

apach configuration

January 22, 2015 Leave a comment

Categories: apache, aws, cakePhp, linux, php, Web

install php mysql apache and secure mysql at ec2 instance

October 14, 2014 Leave a comment

Categories: aws, linux, MYSQL, php, Web

how to check the expiry of your certificate at linux

i updated my old SSL certificate with newer one. now need to know what is the expiry date of this certificate. 

lets see how to check expiry date of SSL certificate.

suppose you even don't know the path to certificate. 

# grep -r "^SSLCertificateFile" /etc/httpd/conf*

this output will tell you the path to your certificate file (in my case /etc/pki/tls/certs/mycertificate.file.crt)

# cd /etc/pki/tls/certs (or the path you found above)
# openssl x509 -in mycertificate.file.crt -noout -enddate

output might be like this 
notAfter=May 16 07:43:06 2015 GMT
Categories: aws, linux, network, SSL certificate, Web

Amazon Web Services : Cloud Watch API

July 18, 2012 Leave a comment

get_metric_statistics :  sdk php 1.5.10

  1. $cw = new AmazonCloudWatch();
  2. $instance_id1 = “x-xxxxxx”;  // give you instance id for which you want to fetch statistics
  3. $instance_id1 = “x-xxxxxx”;  // give you instance id for which you want to fetch statistics
  4. $opts = array(“Dimensions” => array());
  5. $member = array(“Name” => “InstanceId”,”Value” => $instance_id1);
  6. array_push($opts[“Dimensions”], $member);
  7. $member = array(“Name” => “InstanceId”,”Value” => $instance_id2);
  8. array_push($opts[“Dimensions”], $member);
  9. $data = $cw->get_metric_statistics(‘AWS/EC2’, ‘CPUUtilization’, ‘-1 day’, ‘now’, ‘300’, array(‘Average’), ‘Percent’ ,$opts);