Skip to main content

Posts

copy datastore from one project to another project example

copy datastore from one google project to another google project Its actually happens that we need to copy datastore values from one project to another project of google cloud platform. Requirements : Gcloud SDK on the local machine This process goes through 4 steps. Export datastore from origin project Give default service user of target project the legacy storage read role over the bucket  Transfer bucket data to target project's bucket  Import datastore file  Step 1  Export Datastore  From Feb 2019, you will not be able to use datastore admin as Google is going stop that support. So you have to use cloud datastore import-export for it. Cloud datastore import-export exports data in you specified storage bucket. To see how to setup automated datastore import-export refer this post. Step 2 Give default service user of targe projet the legacy storage read role over the bucket  Here we are giving read r...

Hyperldeger Fabric Composer : Essential ACLs

hyperledger composer essential acls  If you don't know how to setup hyperledger composer read this post . I almost gave 5 days 😅  to add an asset via participants other than Admin. As I get an error about some permission for that kind of participant I was adding that resource permission to that participants ACL. .. .. And I have almost given 8 system permissions including network and asset registry resources. Actually, I don't find a solution on any blog or documentation, but  (guess what? 😳) I found a solution on someone's GitHub sample project. That I am sharing here. Essentials ACL's that has to be applied [ at least in case you are going to use composer-rest-server ] // Give NetworkAdmin User Full Access To Every Resouces // rule NetworkAdminUser {     description: "network administrators full access to user resources"     participant: "org.hyperledger.composer.system.NetworkAdmin"     operation: ALL...

Host Multiple Web Sites of Go Using Reverse Proxy Example

Go supports built-in server. But there is a limitation that you can host only one site at once with one port. Though you can host multiple sites with the domain name using gorilla mux then all site will come with one app that will be very hard to maintain and update.  Another option is you can host your site with different ports and then use the reverse proxy to map to map the domain name to the port Explanation Scenario  I have two sites running on my vultr vps . All of them are website that means request will be come in with  domain name and going to be arrived on the port 80 . If  I assing one program [ site ] to listen to the port 80 others will not be able to listen on port 80.  Condition Requirement is that requests should be listend on port 80 and handled by the app to which it relates. After struggling for 3 days i got this 😂 silly solution. Source Code ( solution I got ) 1 2 3 4 5 6 7 8 9 10 11 1...

use elasticmail api with golang example

I am not going describe anything about elasticmail itself. You can look at the elasticmails site for details about it. I am writing this post to show you how to use it with your GoLang application. First Create a template in the elastic mail panel. I Don't know why but when I tried to send an email as complete HTML string. It was returning the 404 error. But when using small pieces of HTML tags like just passing <h2> Hello </h2> it was working. So instead of struggling with it, I found another way, Create Custome template on the elasticmails site panel Use the template for mail with passing necessary details[fields] during the API call Create A Template with placeholders Elastic Mail Template Designer Highlighted elements from the left side Templets menu Templet Name / Id Example Placeholders GoLang Code  function to send the email through ElasticMail with the template shown in the image with ...

Setup development environment for Hyperledger composer on windows

There is no direct best ( or at least I don’t know ) way to create a good development environment for the hyper ledger composer on windows. I have installed hyper ledger on windows and it’s also not working satisfactorily. I want to develop in windows while want to run it smoothly like in Ubuntu. So the way I found is virtual box and ssh. Vagrant is kind of the thing that gives this readymade. But .box file we need to download is very slow in speed [ 150 kbps] and for me, it was disconnecting continuously. So I left the vagrant and find another way to get the facility provided by the vagrant. I am going to show the way I created my development environment. You Need  Virtual Box ISO of ubuntu server 16.04 LTS OR Ubuntu Virtual Box  Machine That's it. If you have this two things you are ready to go. Prepare Ubuntu Server Virtual Box Machine Either install ubuntu 16.04 on the virtual box or import the ub...

setup scheduled export on google appe

If you are using the google app engine you might get this message from the google. Hello Cloud Datastore Customer, We're writing to let you know that the Datastore Admin backup feature is being phased out as of February 28, 2018, in favour of the generally available managed export and import for Cloud Datastore . Please migrate to the managed export and import functionality at your earliest convenience. To help you make the transition, Datastore Admin will continue to be available over the next 12 months prior to the shutdown date of February 28, 2019.  I am writing this post to show how to set schedule export. [ I am showing the steps described by the google at this link.  Scheduled-export  ] Enable the billing for google cloud service Ensure that you are using a billable account for your GCP project. Only GCP projects with billable accounts can use the export and import functionality.  You can Set your billing details at...

HTTPS for custom domain on blogger

HTTPS For custom domain is made available for the users by Google. You just have to enable the HTTPS and your blog will have the HTTPS: You don't need to purchase SSL certificate. When you select yes all setup will be done by the google to provided HTTPS on your blog HTTPS for a custom domain on Google blogger It will good to redirect all your secured and non-secured traffic to the secured site. So Select yes on HTTPS redirect Redirect all traffic to the secured version of your blog If you are using google blogger and haven't done it yet do it.