Archive for the ‘Web’ 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

MAP REDUCE using couchdb

February 18, 2014 Leave a comment

  • If you don’t use the key field in the map function, you are probably doing it wrong.
  • If you are trying to make a list of values unique in the reduce functions, you are probably doing it wrong.
  • If you don’t reduce your values to a single scalar value or a small fixed-sized object or array with a fixed number of scalar values of small sizes, you are probably doing it wrong.

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

AWS: pcre lib conflict with

July 27, 2012 Leave a comment

Severity: Warning –> preg_match(): Compilation failed: unknown option bit(s) set at offset 0
restarted apache

upgraded “*php*”

and rebooted the instance



Please make sure you are using the latest version of pcre with the latest version of PHP. You can ensure both are up to date by running

sudo yum upgrade '*php*' pcre

Once everything has been updated please restart you web server through the init script for Apache HTTPD this can be done by doing

sudo service httpd restart
Categories: php, Software Engineering, Web Tags: , ,

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);

RUBY ON RAILS : usefull Functions

date formating .

<%= myclassobj.close_date.strftime(“%m/%d/%Y”) %>

<%=qest.created_at.strftime(“%B  %d, %Y”)%>

css applaying at text field

<%= f.text_area :description , :class=>”myclass”  %>



alternate style sheets

<tr    bgcolor=”<%=cycle(“#e6e7e8”, “#fff”)%>”  >