Skip to main content

Posts

Bash: Using websocketd as web-terminal

Recently, I have got a work that requires a control over remote machine along with few challenges like that machine can be accessed via Remote Desktop via VPN that goes via corporate Firewall. Now that made it very slow because each incoming or outgoing message packet have to cover the circumference of Earth to reach my system. So I tried lot many tools out there that could solve my problem. I want to eradicate the use of Remote Desktop to expedite the communication. Since the remote system is a Windows machine, so I tried using SSH via freesshd  and found it pretty good. But I want something that could run over browser as web-app. Finally I found this great tool that is available for converting any command-line program into web-application using WebSocket. The tool is websocketd , a WebSocket daemon that takes care of handling the WebSocket connections, launching your programs to handle the WebSockets, and passing messages between programs and web-browser. There ar...

Bash: Running local web-server on your system

To run a local web-server at a directory, you can use either python , ruby , node.js or php . You can choose your suitable way out of the below provided options. Using python To run the server, go to the directory & execute this command with  Python 2 python -m SimpleHTTPServer 8000 or with  Python 3 python -m http.server 8000 Using ruby First, install the ruby gem named 'serve' sudo gem install serve To run the server, go to the directory & execute this command serve 8000 Using node.js First, install the app named 'http-server' npm install http-server -g To run the server, go to the directory & execute this command http-server ./ -p 8000 You can use any other node based servers as well like  puer Using php To run the server, go to the directory & execute this command php -S 0.0.0.0:8000 Note : Press Ctrl-C to quit any of the above listed server

Bash: Automating the cloning of repository

Create this bash file to clone your repository excluding .git, etc. directory or files. #!/usr/bin/bash ROOT_DIR="/Users/username/Documents/" rsync -avzh --delete $ROOT_DIR"/project1/" $ROOT_DIR"/project2" --exclude '.git' --exclude 'README.md' --exclude 'LICENSE' --exclude '.gitignore' echo "Done!"

How to setup Robot Framework on development machine?

Here, I have shared the steps to setup the  Robot Framework  on a development machine  preferrably  on  MacOSX .   Steps to setup Download and install  Python  from  here   Windows  users should target  Python v2.7  due to  Selenium  compatibility while  MacOS  users can target  v2.7  as well as  v3.0  or above   After installation, add it's path in  Environment Variables   Verify it on terminal  $ python -V   Install  Robot Framework  as instructed  here   Use  pip install  robotframework  as preferred installer on terminal   Verify it on terminal  $ robot --version   Install  Selenium2Library  as instructed  here   Use  pip install robotframework-selenium2library  as preferred installer on terminal   No dependency related erro...

How to generate git diff patch?

To understand the process involved in it, we need to first understand the terminologies that is being used in the git. Suppose you have committed your code in Git repository. Now when you select the particular commit, then you will see something like this TK-34164 e2e test cases added Commit: 96f17e85e5b76cff8a6a0332c4f22d10aca3aec6 [96f17e8] Parents: 56a575c5b8 Author: Abhishek Kumar Date: 3 January 2017 at 18:52:06 IST Labels: HEAD -> feature/TK-34164-configure-robot-framework-into Here at line  #1  is custom message for the commit, after that at line  #2  you see a commit-id which is 40 characters long hexadecimal string (SHA-1) and it's short version in square bracket which is 7 characters long.  SHA-1  (Secure Hash Algorithm 1) produces a 160-bit (20-byte) hash value known as a message digest. A SHA-1 hash value is typically rendered as a hexadecimal number, 40 digits long. This  commit-id  is 160-bit SHA-1 hash, uniquely rep...

App: Hex-base64 encrypt/decrypt tool

Hex-base64 encrypt/decrypt tool  helps to convert provided text first to base64 then to hexadecimal code and vice-versa. This technique of double encoding/decoding is used to make sure that no special characters present in the final message to avoid further conversion when it is transmitted over internet. Generally, when a message is transmitted over internet; it gets URI encoded. So this technique will avoid that. Disclaimer: It is an online gadget for quick conversion and do not store anything as the conversion takes place at client-side and do not involve server in that.