Serverles.yml Property Description service Will have the properties which describe the service for which the YAML file is for, properties like name, arn… app Name of the app you create service for. App should be created in serverless and name can be found in serverless.com dashboard org Multiple organizations can be created in serverless and this property indicates the organization for which the service is created package Include/Exclude fi...

What is AppSync? AWS AppSync helps you create a flexible API to securely access, manipulate, and combine data from one or more data sources.AppSync uses GraphQL. AppSync can be used along with Amazon services like Lambda, DynamoDB, etc.. What is GraphQL? GraphQL is a language for APIs that enables you to query and manipulate data easily through an intuitive and flexible syntax. GraphQL provides a syntax to describe data requirements and interact...

This tutorial aims at providing basic steps required to create a Lambda which will provide a Presigned URL that can be used to upload an object to the AWS S3 bucket. Upload is tested here with Postman. What is s3 ? Amazon S3 or Amazon Simple Storage Service is a service offered by Amazon Web Services that provides object storage. An object consists of a file and optionally any metadata that describes that file. S3 helps to store the objects in ...

In this tutorial, we will learn to  Create an AWS Lambda function with Node.js as the Runtime environment. Import the function into AWS Cloud9(Cloud9 IDE is an Online IDE). Initialize npm, add dependency moment.js and deploy it.   Step 1 – Create a Lambda. Goto services->Lambda and click Create function Choose Author from scratch, Node.js as Runtime, provide a function name and click Create function [crayon-5f2ad6e723ea5904565420/]...

This tutorial aims at explaining how to read data from the AWS DynamoDB table. AWS SDK has a class AWS.DynamoDB.DocumentClient, which has methods scan, get and query, that are used to read data from the AWS DynamoDB table.  Documentation on various methods provided by the class is available from the following link AWS.DynamoDB.DocumentClient – Documentation.   Table structure primary partition key – name sort key – age tab...

Here are the steps to create an EC2(Amazon Elastic Compute Cloud), set up your Git remote repository in EC2 and connect to the remote repo from your local machine. Some explanations are provided for better understanding. AWS Elastic Compute Service(EC2) is IaaS(Infrastructure as a Service).   PART 1 – Creating and connecting to AWS EC2 Virtual Machine instance.   STEP 1  – Go to AWS console. STEP 2 – goto services, ...



Sending a multipart/form-data or file upload from PHP server side to remote URL

Requirement to send Form data/file to another external API from A PHP server ?. Imagine a story to upload an image to an external file upload API from a PHP server( Can be a CMS like  WordPress). This task can be achieved using CURL. PHP now has a class CurlFile which is now is available in the PHP versions PHP 5 >= 5.5.0, PHP 7. The following is the snippet to use CurlFile.   [crayon-5f2ad6e70ba92158543279/] You can use Ajax t...

Creating a Node.js Application with IBM Cloud Foundry platform : For beginners

Read about Cloud Foundry here https://www.cloudfoundry.org/ Read about IBM Cloud Foundry here https://www.ibm.com/cloud/cloud-foundry   Cloud Foundry is the industry-standard open-source cloud application platform for developing and deploying enterprise cloud applications. This article will provide a basic understanding of how to work with  IBM Cloud Foundry platform- the Cloud Foundry on IBM Cloud, the tools that can be used in...

Basic steps for creating an IBM cloud Function (Node.js Runtime) that writes to IBM Object Storage Bucket

This is a simple tutorial which helps to understand the basic of IBM Cloud functions and Object Storage. For actual development purposes, things including architecture, security factors should be addressed.     step1: Choose a Function Namespace and create Action Namespaces contain entities (e.g. actions and triggers) and belong to a resource group. actions imply the code that can be invoked with HTTP requests. Navigate to Fun...

Understanding Linting, getting started with ESLint for Node.js development with IDE Visual Studio Code

Node.js application developers usually come across the requirement to adhere to linting rules during the development phase. In this article we will understand the importance of following linting rules and how to set up ESLint with Node.js. We will also see how to easily identify and fix linting errors with Visual Studio Code.     Linting Linting is static code analysis, which helps to identify errors, coding style issues, inse...

Changing permalink settings, throwing 404 error in localhost? Solution for Ubuntu with Apache

Changing the permalink settings from plane to other options like Month and name/Other can cause a 404 error while you are running your WordPress in Ubuntu with Apache localhost.  This error can be quite annoying and here are the changes you should make to get rid of this error. To change permalink navigate to settings->permalinks.     We are running your WordPress site from folder /var/www/html/testfolder/wptest     ...

Modify wpDiscuz plugin, limit registered user to comment once and limit number of comments, in a post

  Navigate to  wp-content/plugins/wpdiscuz/templates/comment/comment-form.php Find line [crayon-5f2ad6e70cec8220301373/] Put the following condition to limit the number of user comments to one and limit total comments. [crayon-5f2ad6e70cecd666562881/] Read more about the functions used here https://truetocode.com/disable-wordpress-comment-box-on-reaching-a-specific-number-of-comments-or-if-user-already-posted-a-comment/...

Disable WordPress comment box, on reaching a specific number of comments or if user already posted specific number of comments.

Imagine a use case in which the comment box has to be disabled On reaching a specific number of comments in WordPress post If the user already posted a comment For applying these conditions, the following data are needed Number of comments in a post Number of comments of a User in a WordPress Post   Obtain the number of comments in a WordPress Post To obtain the number of comments in a post, the following built-in function  get_co...

Understanding serverless.yml file, properties with simple explanation, variables in serverless.yml – Serverless Framework and aws

Serverles.yml Property Description service Will have the properties which describe the service for which the YAML file is for, properties like name, arn… app Name of the app you create service for. App should be created in serverless and name can be found in serverless.com dashboard org Multiple organizations can be created in serverless and this property indicates the organization for which the service is created package Include/...

AppSync/GraphQL : Pagination on DynamoDB data: Curser based pagination

What is AppSync? AWS AppSync helps you create a flexible API to securely access, manipulate, and combine data from one or more data sources.AppSync uses GraphQL. AppSync can be used along with Amazon services like Lambda, DynamoDB, etc.. What is GraphQL? GraphQL is a language for APIs that enables you to query and manipulate data easily through an intuitive and flexible syntax. GraphQL provides a syntax to describe data requirements an...