S3 Bucket – EC2 Directory Sync using AWS Lambda

Allow only AWS CLI commands for the login user: $visudo ubuntu ALL=(ALL:ALL) /usr/local/bin/aws   Write the lambda function Prepare the deployment package $mkdir /python-packages $virtualenv -p /usr/bin/python /python-packages $source /python-packages/bin/activate $pip install pycrypto $pip install paramiko Deactivate Virtualenv $mkdir /deployment-package $copy the GITHUB URL file here $cp -r /python-packages/lib/python2.7/site-packages/* deployment-package/ $cp -rf /python-packages/lib/python2.7/site-packages/.libs_cffi_backend deployment-package/ $chmod […]

Install Newrelic Agent for PHP in a 1 minute

Install NewRElic PHP Plugin for Amazon LINux Create newrelic account on web and get the License number. sudo rpm -Uvh http://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm sudo yum install newrelic-php5 sudo newrelic-install install vim /etc/php.ini newrelic.license=”4b3abfeda5336ecf68″ /etc/init.d/httpd restart Install System Monitoring NewRelic rpm -Uvh https://yum.newrelic.com/pub/newrelic/el5/x86_64/newrelic-repo-5-3.noarch.rpm yum install newrelic-sysmond nrsysmond-config –set license_key=4b106d772c3115f649 /etc/init.d/newrelic-sysmond start

Install Newrelic Plugin for Redis

[Amazon Linux AMI] Download The Plugin #wget “https://pypi.python.org/packages/source/n/newrelic_plugin_agent/newrelic_plugin_agent-1.2.3.tar.gz” #tar xvzf newrelic_* #sudo easy_install pip #sudo pip install newrelic-plugin-agent #sudo cp /opt/newrelic_plugin_agent/newrelic_plugin_agent.cfg /etc/newrelic/newrelic_plugin_agent.cfg Edit the /etc/newrelic/newrelic_plugin_agent.cfg file and enter the 1.License 2.Uncomment the redis block. for example redis: – name: redis1 host: localhost port: 6379 db_count: 16 The whole portion should inside “Application” ie you have […]

Self-signed SSL wildcard certificate for ELB

Will place each set of SSL files under a directory assigned per domain; at the end you will have a directory that contains the newly created .host, .key, .pem and .info files. #openssl genrsa 2048 > host.key #openssl req -new -x509 -nodes -sha1 -days 3650 -key host.key > host.cert Enter subdomain.domain.com for Common Name. It’s […]

MFA for EC2 Instance

Multifactor Authentication (MFA) Multifactor authentication (MFA) is a security system in which more than one form of authentication is implemented to verify the legitimacy of a transaction. The goal of MFA is to create a layered defense and make it more difficult for an unauthorized person to access a computer system or network. By default, […]