All Categories

  • How to Setting up DynamoDB Locally

    12/13/2020 -
    AWS DynamoDB is a document database that provides single-digit millisecond performance, it is a serverless database, which means you can focus on use applications to access the DynamoDB and AWS will manage the server for you. It's also available in multiple AWS regions and has built-in Cache DAX.  Another good reason to use DynamoDB is the free tier provided by DynamoDB. up to 25 GB storage, 25 write capacity units, and 25 read capacity units are free. Compare to MongoDB, depend on the MongoDB cloud provider it might be 500MB storage if you try to look for a free tier.  Now, in this blog I'll show how to set up DynamoDB locally, also show a few simple codes to access local DynamoDB. Download DynamoDB Go to this link from AWS to download DynamoDB, the different region has different DynamoDB file, so choose the region you'll be using for DynamoDB. After unzipping the file, run the following command.
  • How to Increase AWS EBS Volume Size

    12/12/2020 -
    This quick note shows how to increase AWS EC2 Linux's EBS volume size. First, log in to AWS, and select the target EBS, update the size. The volume size will update right away, but you'll do the following. Next, ssh into the EC2 Linux instance, we would check the current Linux size. After ssh into the EC2, type the following command so we'll know does the increased volume had changed or not. lsblk Following is the sample result when you type lsblk. Here we'll know that you have size as 16G but current EBS only has 8G. nvme1n1 30G nvme0n1 16G |-----nvme0n1p1 8G Now, the following command will change the size to use maximum size base on the above sample result. After you run the command, your EBS should be 16G now.
  • How to Use C# Enum Flag

    12/12/2020 -
    A quick code snippet to show use enum flag by using the power of two. So you can define your enum and set the value as following, this will make the combine flag be unique. public enum MyType : uint { Undefined = 0, Type1 = 1, Type2 = 2, Type3 = 4, Type4 = 8, Type5 = 16 } Or you can use the bit shift if you don't want to count the number. public enum MyType2 : uint { Undefined = 0, Type1 = 1, Type2 = 2 << 0, Type3 = 2 << 1, Type4 = 2 << 2, Type5 = 2 << 3 } Following are few way how to use this enum. // set value var myvalue = MyType.Type1 | MyType.Type2; Console.WriteLine(myvalue); var myvalue2 = MyType2.Type1 | MyType2.Type2; Console.WriteLine(myvalue2); // check value if ((myvalue2 & MyType2.Type1) == MyType2.Type1) { Console.
  • Angular2 Master/Detail Page Example

    12/11/2020 -
    This blog demo how to build angualr2 master/detail page, following is the template page for now. Anything under here will code which make above things happen.   package.json { "name": "news-app2", "version": "0.0.0", "license": "MIT", "angular-cli": {}, "scripts": { "start": "ng server", "postinstall": "typings install", "pree2e": "webdriver-manager update", "e2e": "protractor" }, "private": true, "dependencies": { "@angular/common": "2.0.0-rc.4", "@angular/compiler": "2.0.0-rc.4", "@angular/core": "2.0.0-rc.
    Angular2 Angular