Skip to main content

Posts

mailgun forward incoming mail

Mailgun is email service provider. For detail infomration about mailgun you can visit its site mailgun.com . Untill my last project( blogger-editor.xyz ) i was just using mailgun sending mails. There was no need to receive emails on that domain. But in blogger-editor.xyz , I need to have a domain based email address on which i should send and receive email. Its quite straight forward setup to receive email through mailgun. Just you have to do these two things : Make sure your mx record points to mailgun. [ It should be ticked verfied on mailgun dns verification ] Setup route on mailgun MX Record setup with Domain Registrar In domain verification and Dns section of mailgun you will find that you have to setup two mx record with your domain service provider. mxb.mailgun.org ( priority 10 ) mxb.mailgun.org ( priority 10 ) During creation of mx record you will be asked for host. Host value for your record is the @ if you are using root domain with mailgun , and it w...

Find count of day differance between two dates

In golang there is no direct way [ atleast i don't know ] to find count of differance in days between two days. So, I do it the way might every one does [ except who has already faced this ]. Partial Solution What I does is just find out duration differance of two dates using sub function. differance := time.Now().Sub( startTime ) daysCount := int(differance.Hours() / 24.0) It might seem ok. But, there is a problem with this solution.  Let assume, startTime is 2018-02-02 23:59:59 .   In this case daysCount will be 0 on next day [ 2018-02-03 ] until time is 2018-02-03 23:59:59. Perfect Solution Simple solution is just normalize startTime to starting of that date . normalizedTime := time.Date(startTime .Year(),startTime .Month(),startTime .Day(), 0, 0, 0, 0, time.Local) differance := time.Now().Sub( normalizedTime ) daysCount := int(differance.Hours() / 24.0) normalizedTime is startTime but at starting of date. So, Now we are subs...

Setup forward proxy in apache2

Proxy word is noramally used for forward proxy. It forwards requst to other server and pass downs the response to the client. This post is not supposed to describe the differneace between forward and revsers proxy.  But if you want to find out exact differance you can refer this stackoverflow post.   https://stackoverflow.com/questions/224664/difference-between-proxy-server-and-reverse-proxy-server To setup forward proxy on your apahce2. you have to install [ if you are on linux ] / enable [ if you are using windows ] modules mod_proxy.so mod_proxy_ajp.so mod_proxy_balancer.so mod_proxy_connect.so mod_proxy_http.so mod_slotmem_shm.so mod_ssl.so [ If I am includeing any extra please corrent me. But I had to eanble all this modules. ] You have to make virtual host for proxy forward < VirtualHost *: XX  > ProxyRequests On ProxyVia On < Proxy * >   Require all granted < /Proxy > </VirtualHost...

Packfolder : archive your resource of sciter based application

Packfolder packfolder is utility provided as part  sciter-sdk . It compresses resources folder under a single file of the format of your choice ( should support by packfolder ).  Currently, the supported output formats are Syntex, [path]\packfolder.exe [resource-folder] [resource-file].[ext] -V [name-of-variable] -[output-format] For example, Windows PowerShell Copyright (C) Microsoft Corporation. All rights reserved. PS 08-packfolderIntro> .\packfolder.exe res res.go -v resources -go Source Code   08-packfolderIntro

Use packfolder to archive your resource

In commit 25d8ed42e0bb4c4acb742de9f148f6902d32ff41 go-sciter SDK has added one new facility which automatically resolves file path for archived data . Now you can use archived data from the archive and it will resolve import by itself, as it does for c & c++. Packfolder packfolder is utility provided as part sciter-sdk. It compresses resources folder under a single file of the format of your choice ( should support by packfolder ). Currently, supported output format files are bin ( normal binary file ) an array of bytes in c, go, d and rust language.  Syntex is , [path]\packfolder.exe [resource-folder] [resource-file].[ext] -V [name-of-variable] -[output-format] path = full / relative path to packfolder.exe to execute command resource-folder = full/relative path to the folder inside which your resouce is contained resource-file  = name of the file you want as your output file  name-of-variable = it will the name of the varilble that will iniated with the a...

Remove console screen for your gui application written in go

Remove console screen for your gui application written in go Images of appliaction used as example is notepad plus minus. I writen as example. To get details of this program you can visit post " Simple document based application with golang " You write a GUI application and it runs with a console screen behind. It looks pretty weird, right! I mean what is the meaning of a console when console actually not going to interact with the user.  GoLang Gui Application with Console Screen Don't know how this works on Mac or Linux as I have not done this on either Mac or Linux. But for windows, I find a way to compile console-less GUI application for golang.  Just build the application with this argument. go build -ldflags "-H=windowsgui" ldflags used to set build time variable. Now. in the upper statement we are saying golang that current application we are building is windowsgui application so don't create the console with it. J...

Simple Documnet Based Appliaction With Sciter and Golang

document base application with golang and sciter You might need to create a document based application with Sciter. Here the main question is how to get input from the user, how to store it during processing. Then how to store it to a file ( with existing or your own extension ), and at the end how to reopen that file again for editing or updating it. Here I am going with a very simple example of a document-based application. Notepad-plus-minus ( no rights reserved 😀 )It'sts a very simple notepad even simple then notepad. You can think of as a sticky note which allows you to save it as a file. Demo First GUI File In gui we need a menubar [ created with CSS obviously ] which provided options for open, save, exit and new. It also has to have an input area where we can write. So let's get started with creating menu first. <html>     <style>         .top-menu{             position: absolute;        ...