Skip to main content

Posts

Showing posts from 2019

Encode or decode date in 3 characters

I have developed a new way to encode/decode dates within 3 characters by using base-36 format. What is a base 36 format? Base 36 or hexatridecimal is a positional numeral system using 36 as the radix. The choice of 36 is convenient in that the digits can be represented using the Arabic numerals 0-9 and the Latin letters A-Z. In simple language, base-36 format refers to series of 0-9 followed by A-Z characters, i.e., 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ; where each character refers to the position index in series. The concept can also be represents as shown in the below table Series Character Series Character Series Character Series Character 0 0 10 A 20 K 30 U 1 1 11 B 21 L 31 V 2 2 12 C 22 M 32 W 3 3 13 D 23 N 33 X 4 4 14 E 24 O 34 Y 5 5 15 F 25 P

How to create mirrored repositories and keep it synced?

To mirror the existing git repository (i.e, src-repo ) into another git repository (i.e., dest-repo ), follow the steps given below: Create a bash file and name it as mirror-sync-repo.sh Copy the below code and paste it in your bash file #!/usr/bin/bash SourceRepositoryURL=http://src-repo.gitserver1.domain DestinationRepositoryURL=http://dest-repo.gitserver2.domain SourceRepositoryDir=src-repo.git if [ ! -d $SourceRepositoryDir ] then git clone --mirror $SourceRepositoryURL cd $SourceRepositoryDir git remote add --mirror=fetch secondary $DestinationRepositoryURL cd .. fi cd $SourceRepositoryDir git fetch origin git push secondary --all Modify the code by replacing pseudocode with the actual repository names and links Save the bash file Open the Terminal app and go to that folder where this bash file is present Execute the bash file on Terminal using sh mirror-sync-repo.sh command, you'll be asked to enter the username and password for both the repositories

How to located the installed & cache directory path for Deno?

Recently, I had installed the Deno v0.18.0 using brew on macOS . Then tried couple of samples given there. I was amazed to see, how closely it behaves like Golang . When we run the script for the first time, Deno downloads all the dependencies provided in the import statement that is required to run the script. When I ran the same script next time then it doesn't download any dependency. So that means it caches all those dependencies and uses the same next time. Now I was eager to see the cache , but can't find it at the usual locations but after some time with the help of Google , I was able to find the correct location. So I thought it would be pretty useful to put it in blog for ready reckoner. So here is the sample path on all major platforms Platform / Location Binary Cache Windows C:\Users\me\AppData\Roaming\deno\ C:\Users\me\AppData\Local\deno\ macOS /Users/me/.local/bin/ /Users/me/Library/Caches/deno/ Linux /home/me/.lo

Protect your Android app from reverse engineering & plagiarism

Few years back, we faced a hard technical problem while working in IoT project. We were having a mobile app to control smart electronic appliances that consumes our web-service. A third party somehow managed to use our mobile app with their service. We assume that they had reverse engineered to crack the services. So we had to protect our mobile app which was cordova based cross platform app I have been allocated to analyse this issue and propose a solution. So during my initial analysis I found that first we should secure the mobile application installer because Android's .apk installation file usually packaged together all the resource files used in the hybrid project. Crackers could reverse engineer it to get those files. I know that we can ensure protection only by increasing the level of security. So I minified all the files, bundled together and applied obfuscation over it; which made hybrid portion bit more secure. After this I used Arxan to protect the mobile app at b

Remotely accessing macOS through Windows using VNC

Open System Preferences on your macOS. Go to Sharing section, mark Screen Sharing and Remote Login as checked. Click on Computer Settings... button. Mark VNC viewers may control screen with password: as checked. Fill in your unique password in the input box and click on OK button to save it. Now note down the URL to access this system which is actually an internet IP. Later on whenever you connect the device to internet, you can find it or lookup from your WiFi router's admin portal. Open the https://www.tightvnc.com/download.php on your Windows. Download the relevant installer based on 64-bit / 32-bit processor. Install it on your Windows system in Typical settings. You may refer this short video tutorial for this. Open TightVNC Viewer app, enter just IP of the VNC URL of  macOS to access the system. Now click on Connect button to start accessing remote system via screen-sharing. Finally, you just need to make sure that b

GitHub repository workflow using gitflow mechanism

This workflow will describe all the necessary steps that you need to follow to release a project. It is targeted for those projects where more than one members are contributing in the project because that will require a standard workflow that will keep the quality in check at each level. So try to follow the steps as mentioned below, where a repository have been taken for sample. First you need to setup the codebase on your local machine Create a clone of the repository git clone " project-repository-git-url " Get inside the repository folder cd " project-repository-path " Refer this article https://gist.github.com/ribbon-abku/10d3fc1cff5c35a2df401196678e258a to learn more about the gitflow mechanism of handling a project Enable git flow mechanism on the current repository git flow init -d It is required to be done by each contributor on their respective clones Check out develop branch git checkout develop Copy & paste all the code in

Aryabhatta didn't invented zero but propagated

A frustrated student asked his Maths teacher, "if Zero was invented by Aryabhatt and he was born in the Kalyug, then in the past in Satyug, who counted 100 Kauravas and Ravana's 10 heads and how?" Teacher resigned and went back to Vedic education but is still not able to find the answer. Joke apart but the point needs to noted. P.S. Got the above message as joke but any reply for that? An expert's answer: Let me start with just 1 reference from Vedas and 1 from Puranas (to keep this answer short - we will not have enough space if we want to document all such references). 1. Vedic Reference (Yajur veda) The Rishi Medhātithi, after preparing bricks for a Vedic ritual, prays to the Lord of fire, Agni. Imā me Agna istakā dhenava Santvekā ća desa ća satam ća Sahasram ćāyutam ća niyutam ća Prayutam ćārbudam ća nyarbudam ća Samudrasća madhyam ćāntasća Parārdhasćaita me agna ishtakā Dhenavasantvamutrāmushmimlloke . The mantra recited is in vogue for s