Google Cloud Series: App Engine in Action

Objectives:

Deploy an application with a custom environment to Google Cloud

Prerequisites:

Folk and clone this repo: https://github.com/hangnhat57/compute-engine-101/

Open Terminal and cd to the folder you’ve just cloned

First, let’s try to run the app on a local machine to verify it has worked:

Open your browser and navigate to http://localhost:8080, you’ll see something like this:

This application is serving inside a container which was customized from scratch:

To deploy a custom container to App Engine, we have to use Google App Engine Flex – Custom Environment. By default, App Engine will serve container application in port 8080, so remember when you create an image.
App.yaml file will look like this :

Now, on the terminal, start a command:

If this is the first time you using App Engine for the current project, Google will ask you for the region of App Engine service:

Select the region you want and wait until it finishes. Then use this command to view your app on the public:

A browser would automatically open and navigate to your app:

Have you read the previous post of the Google Cloud Series? Make sure you check it right now

Comment below or email us via contact@twentyci.asia  if you have any question or want to have free consultation!

                                                                                                                                                                                                                                                                                                                                        Nhat Nguyen                    

Storing Data on the Blockchain (p3)

Any supporting platforms?

There are few projects that focus on data storage right now. Most are built around decentralized file storage, which includes documents.

One project that is focused specifically on documents, particularly signed documents, is Blocksign. This uses the hash method. A user will sign the document and send it to Blocksign, where it is then hashed, and the hash is stored on the Bitcoin blockchain. We must warn users that Blocksign has not recently updated their site, and we would encourage further research before use.

Two cryptocurrency projects designed for decentralized storage more generally are Siacoin and Storj.

Siacoin does not use a blockchain for any form of storage. Instead, their distributed network stores an encrypted version of your document. The Siacoin network is comprised of hosts who provide and clients who desire storage. Clients and hosts agree upon contracts detailing the commitments made by the storage providers. Sia’s own proof of work blockchain stores these contracts.

Storj, on the other hand, is closer to the hash model. A hash of the document is stored within a hash table on-chain. Additionally, its distributed network also stores your document. Unlike Sia, however, Storj runs atop the Ethereum blockchain rather than its own.

Cryptyk, an enterprise-focused platform to store documents, uses a blockchain more distantly than all of the above. You do not store any documents or hashes on-chain. Instead, a distributed cloud system stores the documents. The platform only uses a blockchain to manage and referee document access and sharing.

Document blockchain storage is a sector of this industry moving forward steadily. Right now, we are waiting to see what role blockchains will play in storing documents. Fortunately, the competition among projects is furthering our understanding of this promising use case.

Please share your thought with us in the comment below

Hung Le

Magento Audit – Core Hacked or Not? 

When you get a new project from a partner/client (a maintenance project), how do you know the quality of the new project’s code? Has there been a core hack or not? Verifying whether the core code of Magento has changed or not is a part of the Audit code task. Here, I will write the steps which I do to check whether the code of Core Magento has been changed or not.

First of all, we need to know why we have to verify whether the core of Magento is changed or not.

As you know, Magento changes a lot, and Magento release new versions frequently to update functions, fix bugs, improve security, etc. So each time Magento releases a new version we have to update our projects to the latest version of Magento to get the latest features and improve the security of our web site.

Each update of the Magento core is likely to change the code, and changes will be overridden when we update Magento to a new version. This could cause the site to lose functions which we made by changing the previous code in Magento’s core.

To avoid this happening we have to make sure that the core is not changed before we start implementing new functions/features for a maintenance project.

To verify the core code we need to compare the core code of a fresh Magento version (an original version downloaded from Magento) and the core code of our maintenance project.

First, we have to check the Magento version of maintenance project. In this article, I will use Magento 2 as a demo to show verify steps. 

  • Step 1: Get a used version of Magento – To get a version of Magento 2 you just need to check composer.json in the web root of the project: 

  • Step 2: Get fresh Magento version from Magento site: Go to https://magento.com/tech-resources/download then select ‘Release Archive’ then choose used version. In my case, it’s version 2.2.3. I download then extract to /var/www/html/magento223 
  • Step 3: Get code of maintenance the project to your local: In my case, I place the code of maintenance project at /var/www/html/my-maintain-project 
  • Step 4: Compare the core code of fresh Magento 2.2.3 with my-maintain-project using Beyond Compare 
    • A note about Beyond Compare – this is comparing tool which helps you detects different points between two files or two directories
    • Open Beyond Compare then select ‘Folder Compare’ function: 

    • Then select vendor/magento directory of two fresh Magento and your project as below:

It will show different things between the two directories vendor/magento.

    • One thing we need to update for Beyond Compare to make it show more clearly what’s different between two directories as below
      • Click on the Home icon of Beyond Compare then right click on your item in session as below:

      • Then select Comparision tab and select some options as below:

      •  Now you will see a much better result in two directories:

  

With this result, we can see whether the core of the maintenance project is hacked or not so we will have to find a solution to fix it before we start adding new functions.

In my case, I see my project has some changes in Magento core files. So I have to check these changes then migrate them to a custom module to keep the changed functionality and then revert the core files to the original code.

You can apply the same for Magento 1 when you do an audit for a Magento 1 project.

Thanks for reading. Please leave a comment below if you have any question.

Vong Tran

Omnichannel Marketing – Our top 5 tips

At TwentyCi, we recognize the importance of omnichannel programmes as an extremely important marketing approach. And as a concept that is likely to only continue to grow in the coming years. With this significance in mind, Paul Hickey, our COO, was recently asked to provide his best tips for omnichannel marketing. Read on for this top five.


1) Ensure your customer data is correct and up to date

Recency of data is of the utmost importance and it should be factual, not inferred if you want to ensure your communications are fully on point.

2) Make your content relevant

Ensure communications are contextually relevant in terms of both timings and messaging to optimize their impact.

3) Understand your customer journey

In omnichannel the consumer journey is no longer linear so you need an understanding of where your customers are so that you reach them in the right way.

4) Have a 360° view of your customers

Take a holistic view of your customers rather than looking at what they are doing in isolation. Only then can you make fully informed decisions about offers, messaging and timing.

5) Don’t be creepy!

Data enables us to gain a rich understanding of the people we are targeting, but be careful how you use it. The approach will depend on the brand and the product/service being promoted. A homemover will undoubtedly be in the market for new furniture, carpets or DIY products and will be grateful for the communication. However, make sure you use your knowledge to be relevant with a tone that is not intrusive. For instance, we would never advocate saying ‘we know you are having a baby’!

 

To find out more about how TwentyCi can help you prepare for some of these challenges and opportunities, including putting the consumer into context with our homemover data please leave a comment below or email contact@twentyci.asia