Posts

Showing posts with the label Amazon

Digital Marketing

How to create LVM in Amazon AWS EC2 / CentOS

LVM stands for Logical Volume Manager. With LVM, we can create logical partitions that can span across one or more physical hard drives. First, the hard drives are divided into physical volumes, then those physical volumes are combined together to create the volume group and finally the logical volumes are created from volume group. To create a LVM, we need to run through the following steps. Select the physical storage devices for LVM Create the Volume Group from Physical Volumes Create Logical Volumes from Volume Group You create your new volume from the "Volumes" menu in your EC2 management console. You attach your new volume to your ec2 instance by right clicking the new volume and choose attach. From the "Attachment Information", you can see where it is being attached, such as "/dev/sdf". Or you can then see your new volume inside your EC2 instance: $ cat /proc/partitions major minor  #blocks  name 202        1    8388608...

How to set up Amazon AWS S3 Static Website Hosting - Enable permission

To enable permission for Amazon AWS S3 Static Website Hosting: After you enable Static Website Hosting for your S3 bucket, you need to give the objects   s3:GetObject permission for it to work. For example, the following allow everyone to have  s3:GetObject  permission to bucket  goyun.info ,  which is very common for public static hosting. { "Version" : "2008-10-17" , "Id" : "Policy1407788858888" , "Statement" : [ { "Sid" : "Stmt1407788848888" , "Effect" : "Allow" , "Principal" : { "AWS" : "*" }, "Action" : "s3:GetObject" , "Resource" : "arn:aws:s3::: goyun.info /*" } ] } Also grant everyone List and View permissions in properties.

Amazon SES sendEmail example

public class AWSeMailService { public static void send ( AmazonSimpleEmailService ses , String from , String to , String subject , String body ) throws IOException { /* * Before you can send email via Amazon SES, you need to verify that you * own the email address from which you'll be sending email. This will * trigger a verification email, which will contain a link that you can * click on to complete the verification process. */ verifyEmailAddress(ses, from); // RETERN_PATH is optional SendEmailRequest sendEmailRequest = new SendEmailRequest () .withSource(from) . withReturnPath( RETERN_PATH ); List toAddresses = new ArrayList<> (); toAddresses . add(to); Destination destination = new Destination () .withToAddresses(toAddresses); sendEmailRequest . setDestination(destination); com.amazonaws.services.simpleemail.model . Message message = new com.amazonaws.services.simpleemail.model . Message ( new ...

Java Email Example Using Amazon SES

package ca . i88 . example ; import java.util.Properties ; import javax.mail.Message ; import javax.mail.MessagingException ; import javax.mail.Session ; import javax.mail.Transport ; import javax.mail.internet.InternetAddress ; import javax.mail.internet.MimeMessage ; /** * @author goyun.info * @link https:// goyun.info */ public class AmazonSESExampleByJavaMail { static final String FROM = "noreply@ goyun.info " ; // Replace with your "From" address. This address must be verified. static final String TO = "noreply@ goyun.info " ; // Replace with a "To" address. If you have not yet requested // production access, this address must be verified. static final String BODY = "This email was sent through the Amazon SES SMTP interface by https:// goyun.info ." ; static final String SUBJECT = "Amazon SES test (SMTP interface accessed using Java)" ; // Supply your SMTP credentials...

How to mount AWS FSx in /etc/fstab

Example: fs-09accab1db95b56a6.fsx.us-east-1.amazonaws.com@tcp:/6omu7bmv /mnt lustre defaults,_netdev,noatime,flock 0 0 Mounting FSx using /etc/fstab: https://github.com/awsdocs/amazon-fsx-lustre-user-guide/blob/master/doc_source/mount-fs-auto-mount-onreboot.md In summary, we can use the layout "file_system_dns_name@tcp:/mountname /mnt/fsx lustre defaults,noatime,flock,_netdev 0 0" to add our FSx resource to our fstab file, and ensure that it mounts correctly using mount -a.

Attach extra EBS volume to your AWS EC2 instance

You create your new volume from the "Volumes" menu in your EC2 management console. You attach your new volume to your ec2 instance by right clicking the new volume and choose attach. From the "Attachment Information", you can see where it is being attached, such as "/dev/sdf". Or you can then see your new volume inside your EC2 instance: $ cat /proc/partitions  major minor  #blocks  name  202        1    8388608 xvda1  202       80   20971520 xvdf Use the lsblk command to view your available disk devices and their mount points (if applicable) to help you determine the correct device name to use. $ lsblk NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT nvme1n1       259:0    0  100G  0 disk  nvme0n1       259:1    0    8G  0 disk  ├─nvme0n1p1   259:2    0    8G...

Amazon DynamoDB vs Amazon SimpleDB

Both DynamoDB and SimpleDB are non-relational databases that remove the work of database administration. Amazon DynamoDB focuses on providing seamless scalability and fast, predictable performance. It runs on solid state disks (SSDs) for low-latency response times, and there are no limits on the request capacity or storage size for a given table. This is because Amazon DynamoDB automatically partitions your data and workload over a sufficient number of servers to meet the scale requirements you provide. In contrast, a table in Amazon SimpleDB has a strict storage limitation of 10 GB and is limited in the request capacity it can achieve (typically under 25 writes/second); it is up to you to manage the partitioning and re-partitioning of your data over additional SimpleDB tables if you need additional scale. While SimpleDB has scaling limitations, it may be a good fit for smaller workloads that require query flexibility. Amazon SimpleDB automatically indexes all item attributes and thus...

How to configure the Nginx reverse proxy on AWS Elastic Beanstalk

AWS Elastic Beanstalk   simplify the process of configuring the Nginx reverse proxy that runs on the web tier. You can place annginx.conf file in the .ebextensions/nginx folder to override the Nginx configuration. You can also place configuration files in the .ebextensions/nginx/conf.d folder in order to have them included in the Nginx configuration provided by the platform. .ebextensions/nginx/nginx.conf – Overrides the Nginx configuration for the platform. .ebextensions/nginx/conf.d – Files are included in the Nginx configuration provided by the platform.  For more information, see  Configuring the Reverse Proxy .

How to install AWS Command Line Interface awscli

sudo yum -y install gcc python-devel python-setuptools sudo easy_install -U pip sudo pip install awscli To upgrade, simply use the --upgrade option. sudo pip install --upgrade awscli To ensure that the AWS CLI is installed and set up correctly, type the following AWS CLI command at a command prompt: aws help To configure: aws configure

How to copy files from Amazon AWS EC2 to S3 from command line

$ aws s3 cp myfolder s3://mybucket/myfolder --recursive $ aws s3 cp myfile s3://i88-ca-backup/ You need  AWS Command Line Interface And configure it with $ aws configure

Comparison of pricing: Google Cloud SQL vs AWS RDS

A direct comparison of pricing shows that AWS RDS is cheaper than corresponding Google Cloud SQL pay-per-hour options, but other costs such as data storage and transfer fees, etc needs to be considered. Google Cloud SQL supports instances up to 500GB in size while Amazon RDS goes up to 3TB. Google's MySQL database is also general available, offering more storage and SLA-backed uptime. Amazon RDS comes as a first choice, with competitive pricing and a whole range of features. You can easily build a high availability database yourself, with automated replication and lots of monitoring options. Google Cloud SQL provides an impressive offering, but can be a bit harder to set up. It helps if you are already familiar with the Google Cloud. They used the experience gained from running Google search to build their infrastructure, so it’s proven and fast. But you do pay the price for it.