Skip to main content

Posts

Forward Proxy Using Apache

There are many scenarios where we need some kind of proxy. We will consider one scenario from all where we need to use the forward proxy. Case : Suppose there is a service which is available for certain IP/ IPs only (These are mostly secured services). In this case, you have to forward the service requests through that specific.  Take an example : Entities playing role, Hosting App On Google App Engine ( Dynamic IP) White Listed Server ( X.X.X.X ) Resource Server ( Y.Y.Y.Y ) Here  Resource    Server ( Y.Y.Y.Y ) will just respond to the request come from the White Listed IP  Server   ( X.X.X.X ). So if we want to request   Resource   Server (Y.Y.Y.Y) we have to send it to the way Server feel like they have come from White Listed Server IP (X.X.X.X). Here Proxy server comes in the play. Proxy server takes the request and forwards it as they are initiated by itself. So what we have to do is we have to put a proxy ser...

word count tool | wordcounter

I have to write a post for Alibaba cloud platform. I come to know that the post has to be 1300-1500 word long. So I write a post and that searched for a word counter tool.  In the search result, i found two site wordcounter.net wordcounter.io wordcounter . net wordcounter.net is the best site I found. It gives more details than just count of the word.  It gives the information of  characters words sentence  p aragraphs  word density have been written.  In additions, it also provides information like, Reading level Reading time speaking time wordcounter.net

datastore remove index

Cloud Datastore imposes limits on the number and overall size of index entries that can be associated with a single entity. These limits are large, and most applications are not affected. However, there are circumstances in which you might encounter the limits. Types of Datastore index Datastore composite indices Built-in indexes By default, Cloud Datastore automatically predefines an index for each property of each entity kind. These single property indexes are suitable for simple types of queries. Composite indexes Composite indexes index multiple property values per indexed entity. Composite indexes support complex queries and are defined in an index configuration file (index.yaml). Cost Counting for Datastore write In the current pricing model, inserting a new entity costs 2 write operations for the entity + 2 write operations per index. here index may be the composite index or built-in index ( single property index). You can remove ...

Host secured laravel 5.x appliaction on ubuntu 16.04 vps with apache

Aim   The aim of this tutorial is to show how to migrate the local laravel 5.x project to the Ubuntu 16.04 vps. We will see how to setup the vps for hosting from scratch. We also see the ways you can copy your laravel project to the vps and at last we will see how to secure your project with ssl using the lets encrypt. we will also add a cron job to auto update the ssl certificate.   Prerequisites   To follow this guide along you will require this  Ubuntu vps with 16.04  laravel  project you want to host ssh client For windows you can use putty For Mac you can use terminal sftp client For windows you can use winscp For Mac you can use cyberduck Git Remote Git repository ( optional ) Steps Now after gathering the required elements you can follow these steps to host your laravel 5.x project. Prepare the vps for the web hosting Install Php Install Mysql  Install Apache Install Git Copy and setup the loc...

use hilite me for code sharing on your site

I have seen many sites which are sharing the code snippets having a good look. Like having the sublime like format. One example is laravel-news.com. In my early posts, I was used to putting the code as it as without any formatting other than making the code in italic. After certain posts, I started to use GitHub gist for sharing. But the gist was not the actually for what I was looking. Though it was quite good for code sharing thing is that it was not giving the look I was wanting. After searching for certain days I find hilite.me which is actually I was looking for. A site/service that takes programming language code as input makes the syntax highlight and puts in the box of CSS we have defined. It actually provides HTML-CSS code which can paste on the blog to share the code with specific highlight and format. Here is my favorite CSS for the box ( Code for the box below you are seeing is also generated with hilite.me ) background ...

Use Cli based Utilties and application with golang

Actually, this post is about " use cli based utilities and application with golang", but I will explain it using the example of the 7zip. The best way I found for zip extraction is using the 7zip cli. This is just sample how you can use any cli based application with your golang project. I will explain it using the example of 7zip cli. ( I am assuming that you have basic knowledge of golang ) What we are going to do is we will make cli command calls from our golang app using the os/exec package For details of os/exec package please visit this official doc. Let's see the code of unzipping of the archive using cli and golang cmd := exec.Command( "7z" , "e" , "path-to-file" ) err := cmd.Run() if err != nil { fmt.Println( "error during extraction:" ,err.Error()) continue } In this code first, we are getting the command struct for our cli based process. Here Command takes the name of cl...

golang oauth2 facebook example

Todays most sites are integrated with social platforms like twitter, facebook, google plus for one or other purpose. I am writing this post to show how you can integrate Facebook with your golang app using facebook oauth2. Just Some Word About OAuth2 OAuth 2  is an authorization framework that enables applications to obtain limited access to user accounts on an HTTP service, such as Facebook, GitHub, and DigitalOcean. For More information read this article ReadMore Create App For Facebook To integrate Facebook with your golang app, first of all, you have to need a facebook app_id and app_secret. Those are app identifiers for facebook.  To create an app on facebook you should have an account on Facebook ( and ( think you might have already ). Using your Facebook account login on developer.facebook.com   developer facebook portal  After login click on MyApps dropdown and click on Add a New App Button Create a new Facebook app  C...