The Problem Staring at screens every day has been gradually affecting my eyes. Reducing screen time seems unattainable, Pomodoro technique is hard to follow consistently everyday, so I decided take regular screen breaks with the 20-20-20 rule. 20-20-20 concept: taking a 20-second break every 20 minutes to focus on an object 20 feet away I tried using Time Out app on my Mac, which displays an…
Enabling SSL certificates with automated renewals for Traefik in my Homelab setup turned out to be quite straightforward. All I had to do was configure Let’s Encrypt as the Certificate Authority (CA) with Cloudflare as the DNS provider in Traefik’s config files, and then activate it for services in the Docker Compose file. Once all the configurations were in place, Let’s Encrypt…
It has been slightly more than a year since I got hooked on book reading. This year I preferred lightweight reads and tried multiple genres. Of the 23 books I read in 2022 , these 5 are my favorites. Project Hail Mary by Andy Weir #ScienceFiction Reason for choosing book by Andy Weir was the Martian movie, and I loved it! Project Hail Mary is a space mission to save humanity from an alien microbe…
This post shows how to quickly run Squid proxy server on a DigitalOcean droplet via command line interface. TLDR; Create droplet: $ doctl compute droplet create ubuntu-squid-proxy \ --image ubuntu-20-04-x64 \ --region sfo2 \ --size s-1vcpu-1gb \ --ssh-keys 01234567,12345678 \ --tag-names test,proxy,squid,cli \ --user-data-file user-data.yml \ --wait where user-data.yml has content of this gist Use…
Ubuntu is discontinuing support for the Debian-installer based classic server installer from 20.04 LTS (Focal Fossa) making the way for subiquity server installer. This post shows how the Packer build config vary for both installers. Ubuntu 20.04 live server has only subiquity support. For debian-installer you can use legacy server version. TLDR; Check Packer config examples here:…
PostgreSQL databases can be migrated without doing database dump-and-restore. Here are the steps to migrate from Postgres 9.6 to 12 in Ubuntu 18.04 Existing PostgreSQL 9.6 Let’s first check the list of installed postgres related packages, service status and the running cluster details. Packages list: $ dpkg -l | grep postgres pgdg-keyring 2018.2 all keyring for apt.postgresql.org…
Problem The scenario is where docker containers are running on a host system with Ubuntu, which is connected in an air gapped network, with the router configured with a list of local DNS servers. The host doesn’t have any manual DNS entries, though it is able to make DNS queries via the LAN’s upstream DNS servers. Containers running on Bridge mode, on the other hand, are trying to…
Since the introduction of a new router to our home premises the previous one was lying around unused - it is TP-Link Archer C2 AC750 Wireless Dual Band Gigabit Router. I changed it to run as a Repeater, so that it can strengthen WiFi signal to the weak spots; Here is a note on how to do that. TLDR: Since Archer C2 was running as a router earlier, I did a factory reset first. Then configured it in…
I was in a Mosh session on a remote server and tried to do scroll using trackpad. Surprisingly instead of getting the scrolled content of the remote shell, it showed buffered content of my system’s shell! I opened up tmux inside the mosh session thinking may be it would help. Nope the same issue. Local tmux as well has the same issue. The scoll mode ( ctrl B [ ) in tmux with keyboard…
There had been many scenarios where I wished if mobile phone could be used as a development machine. Scenarios such as quick SSHing to servers or pushing a hotfix to Github while on the roads, testing out a snippet which just popped in mind while jogging, etc. I tried to make Nexus 5 as a pocket development machine. I was able to set it up, but with some limitations. Here is what all I did:
AWS adds an SSH key on every EC2 instance creation, either by adding a new key-pair or using the existing one based on the user’s choice. This gets a bit annoying while distributing a sealed (content-protected) AMI. Any user who has access to this AMI for deployment could create an instance by adding their key, thus gets access to the protected content residing inside the instance. How EC2…
I haven’t been using tmux since I’m a happy user of iTerm2 . Eventhough tmux had been used in servers I used to work with, I preferred avoiding it because of the fallacious assumption that it would be hard to remember all those scary key-shortcuts. I gave it a try today, and totally regret for not learning it earlier. Why tmux Installation Usage Managing Sessions Configuration file Why…
This article gives a walk through setting up of HTTPS protocol for localhost using NGINX in OSX (10.11.5). Prerequisites: 1. openssl OSX by default comes with openssl . $ openssl version OpenSSL 0.9.8zh 14 Jan 2016 2. nginx Install: $ brew install nginx $ nginx -v nginx version: nginx/1.10.1 3. a local server Start your local development server. (For eg: this can be just an index.html file with…
I have been thinking of playing around Twitter APIs since a long time, but never sat down patiently to get it done. Procrastination is at its highest 😥 Anyways, I did it finally, with Twick - an Angular app to fetch and display Twitter data . Getting Authorization header Twitter has a good documentation on how to authorize a request . Lets take an example request: GET…
Ever since I dabbled around css blend modes , I wanted to look into the math behind it. Compositing in CSS Compositing is combining separate visual elements into a single image . There have been 2 types of compositing techniques used in CSS so far. Simple Alpha Compositing Porter-Duff Compositing Mixing effect is obtained by overlapping of transparent layers Colors are mixed by blending functions…
Here is a quick reference for CSS data types: data type description, values/units, remark, example <angle> degree of rotation deg, rad, grad, turn 360 deg = 400 grad = 2π radian = 1 turn transform: rotate(45deg) <basic-shape> functions to define shapes inset(), polygon(), circle(), ellipse() inset(<shape-arg>{1,4} [round <border-radius>]?) polygon([<fill-rule>,]? [<shape-arg> <shape-arg>]#)…
2015 has almost reached EOL. It had been a neutral year for me. In short, year of realizations. Not so eventful but a positive gradual increment. As a developer: Shifted my focus from design/CSS to javascript. And within no time, I totally fell in love with javascript. Learned Angular, APIs with promises are so awesome! Node <3 ES6 More structured development process Unit tests & CI - a savior for…
I’m definitely late to the party! though it is better than not to show up at all 😎 There are a ton of articles on internet about the moderately latest CSS properties such as filter , background-blend-mode and mix-blend-mode . Neglecting the fact that it is not possible to use these features in production apps in near future (due to lack of old browsers support), I just wanted to look how it…
Processes such as redis and mongodb have to be started manually each time after system restart on Mac and they occupy a terminal instance each. Daemonizing them will make the process to start automatically & without the need for a dedicated terminal. There are two ways to daemonize a process in osx: Agents Daemons Both of which are managed by Launchd process running on osx. The main difference…
This is about a serendipity that happened recently for me :P. I had kept a bit of salt water in a glass for 3-4 days and forgotten about it. When I finally noticed it and checked something amazing happened. There were these beautiful salt crystals formed inside it. I wanted to test the formation again so I tried it with a saturated salt solution on a dish for again for 3 days, and bam! the…
The 22 Immutable Laws of Marketing [ 1 ] is a book written by Al Ries and Jack Trout , with simple yet powerful tips for Marketing. I had postponed reading the book at least for a year now just because I thought marketing was not an interesting topic for me. Well, I was wrong! Marketing is a strategic planning based on the predictions we make of future. A well-designed, well-executed,…
I participated in Djangothon on 22-23 August - a 24hr hackathon organized by HackerEarth as a part of 10 year anniversary celebrations of Django web framework. I got the awesome team partner Sharat MR and also Devyani Kota . The core idea of hackathon was to contribute back to Django framework. I was very excited, it was the first time for me to be in an offline hackathon as a participant. We had…
Currently I’m reading “ Ogilvy on Advertising ”, book written by the business advertizing wizard David Ogilvy , the most successful Ad-man of all the time. In the second chapter he has mentioned the steps on creating succesfull ads which sells. These steps are equally well applicable to web design , so I thought of listing out them here. Do your homework Study the product you are…
Today I have been trying to figure out installation of OpenCV (a computer vision library) in my laptop. This article explain how I did the setup of OpenCV in Mac OSX (Mavericks). Pre-requisite: Install CMake Download CMake build system from the official CMake website . I downloaded it from here: http://www.cmake.org/files/v3.2/cmake-3.2.2-Darwin-x86_64.dmg Install the dmg package and launch it…
This article explains the importance of video compression through some interesting figures. Video comprises of collection of picture frames, picture is composed of pixels (aka picture elements). So let’s start from pixels. A pixel is the unit of display screen. Typically pixel is represented by RGB plus an alpha value, RGB (red, green, blue) values changing from 0-255 and alpha value on a…
Recently I have read about the basic internal working of web browsers. Here is a brief note on it. Web browsers are the application softwares intended to request web resources from the server and display it on client machine screen. Web resources can be markup documets, pdf or image files. They are located on the internet using URI . A browser have the following main parts: User interface window…
CSS box model is a stack of 2-dimensional layers in which the default behaviour is: Each child element is on top of parent element For sibling elements, current node appear on top of previous one Every element in a document is stacked up with the base root element. It is well known that we can alter this stacking bahaviour with change of any of these default properties: z-index: auto , position:…
Though we have studied RSA algorithm in college, it was just for the sake of theory examination. I never had thought about its practical implementation and how it is successfully existing over these many years. Here is an attempt to implement RSA encryption/decryption using python: Step 1: Generate 2 distinct random prime numbers p and q p = generate_prime () while True : q = generate_prime () if…
I have been trying to get my Huawei E303C 3G datacard to be working in MacBook Pro (15" retina i7 with OSX 10.8.3). Device showed a blinking green light, otherwise there was no sign of a connected USB device. Downloaded Huawei Mobile Partner client for Mac System preferences > Network > (checked for Huawei service), but it wasn’t there. Checked for disk filesystems: $ df -h , it didn’t…
I have started using Raspberry Pi today, and I can’t control myself from saying that it is AWESOME! RPi has got a ARM1176JZF-S 700 MHz processor with 512MB RAM. I have attached a 8GB class 10 SD card to it. Setting up RPi in Windows 7 Preparing SD Card: Download the SD Formatting Tool from https://www.sdcard.org/downloads/formatter_4/eula_windows/ install and run select SD card drive, from…
This year’s Droidcon India was the most memorable HasGeek event since I joined HasGeek one year ago. The sleepless nights extending over a month have come to an end. Had lots of fun during conference and hackathon. Met some interesting people, helped with logistics and video recording, coding late nights without bean bag, completed Intel’s image re-shuffle game, travelled in a tempo…
Time has come to get rid of the complexity of layouting with float and position properties, its the turn for flexbox. We are able to create more complex layouts with float, position properties, plus a little bit of javascript. But the complexity to implement it in the wide variety of browsers is also awful. Flexible box or in short, flexbox is the property in CSS which make the layout model much…
I have a Windows7 PC with XAMPP installed in it. Whenever I need to setup multiple sites in my machine, I used to put the site folders under C:\xampp\htdocs\ folder, which is the default localhost directory. The reason is that dynamically linked files need a host to run perfectly. An alternative way or the perfect solution to this method is to use the Virtual Hosts. Through this way we are able to…
fig 1: 3D chess pattern Do you think it is difficult to make 3 dimensional patterns like this one? then you are wrong. Its absolutely not! The basic line pattern of this chess pattern is as shown below: fig 2: mesh pattern Such line patterns can be easily generated using this simple Matlab script: function pattern ( angle ) lower = 2 ; upper = 12 ; stepvalue = 0.2 ; lastindex = ( upper - lower ) *…
The fundamental concept behind animation is ‘Persistence of vision’. An animated film is fundamentally a bunch of images changing rapidly on-screen, at a fixed frame rate- usually above 12fps. For making your own animation you don’t need to buy expensive and professional photographic or processing hardware or software, all you need is the following: A PC A webcam or a set of images Linux OS (I…
This small piece of code lets you know the top 10 most-used commands in terminal. $ history | awk ‘ { print $2 } ’ | sort | uniq -c | sort -rn | head -10 We can also do the same using the following code: $ cut -d \ -f 1 ~/.bash_history | sort | uniq -c | sort -rn | head -n 10 | sed ‘s/.*/ & /g’
The easiest way to setup a website and to test it before publishing to web is using XAMPP and WordPress. XAMPP combines many different sofware packages like Apache, MySQL, PHP, Perl, FileZilla FTP server etc. into a single package. WordPress is a tool with which we can create a beautiful website or blog. To download xampp, click here . Xampp is available as installer and zip file. a. In the case…
Wanted to deal with audio files in linux? sox (Sound Exchange) is a powerful command for you. Here is some examples for sox command. Let’s combine two audio files with a single command line, $ sox -m first.wav second.wav combined.wav with -m flag, sox mixes two input files together to produce output file. here first.wav and second.wav are input files and combine.wav is the output file. If you…
To see the river.. just to enrich mind with its unique beauty… That was my aim. Walked.. alone. Green grasses smiled hugging each footstep. Drops of water remained after drizzling rain of yesterday night are still there in sprouts. Splendid sunlight gave them the ability to shine as diamonds, which felt me like a world of illusion.. Beyond that I could see grazing cattle; herons were with…
One of my favourite hobbies during the summer vacation is bird watching. The world of winged friends is really amazing, I can’t express through words that how much it give pleasure to me. Their wide variety of colours, sweet voices, cute beaks, soft feathers, and above all, their wings which enable them to fly over the sky… everything make me so jealous of them. Jungle Babbler, Indian…