05 October 2021

How to renew your RC at a Karnataka RTO

Note: This was written in October 2021. Please check if the procedures have changed, by the time you are reading this. The floors and counter numbers are specific to Yeshwanthpur RTO, but I assume the procedures should be pretty-much the same everywhere else. I didn't have to do any hypothecation, so there is no info about that in this blog post. 

 

When I went to the Yeshwanthpur RTO on a Monday, I found that everyone was very helpful and efficient. Right from the helpdesk person (who went out of his way to help me), to the mid-level and high-level officers. Everyone was getting work done quickly, and I could feel the atmosphere at the RTO was pleasant everywhere. It was surprisingly good to experience this.

Checklist:

  • RC (Registration Certificate) book or RC smart-card. Original.
  • Vehicle insurance paper photocopy.
  • Aadhaar card photocopy. I tried giving my PAN card photocopy, but they insisted on Aadhaar card.
  • Vehicle's emission test certificate photocopy.
  • Pencil, eraser and sharpener (for taking the pencil print of the chassis number). Pen (these are available in the xerox shops in the RTO building itself).
  •  Umbrella/rain-coat (if it starts raining at the place where the fitness check is done).
  • Water and some snacks or lunch.
  • Change (ten/twenty rupee notes and one or two rupee coins).
  • Be well-dressed and well-groomed. It creates a good impression.

For the above checklist, it's perhaps better to take not just the necessary photocopies, but also the originals, just in case.

I had to renew my bike's RC, so as per the instructions online, I visited the RTO website. In the main menu, hovered the mouse over the word "Parivahan", and clicked "Vehicle related services" in the sub-menu that opened up. In the next page that opened, I selected "Karnataka" as the state. 

Although there's a field for "Enter registration number", I didn't have to enter anything there. Just selected the RTO and clicked "Proceed".

RC menu

Various menu options opened up. Selected the one for "Renewal of registration". 

Online services menu

Then I was asked to enter the vehicle number and the last five digits of the chassis number. An OTP got generated and sent to my mobile phone. Once that was entered, I was shown a page with the latest tax details, insurance details and the fees. I verified that the details were correct. There was a green tax of Rs.250, a smart card fee of Rs. 137, renewal fees of Rs.300 and road safety tax of Rs.500. Total: Rs.1187.

Payment 1

Selected the option to pay online and was redirected to the payment page. Here, I selected the option to pay via SBI e-pay (which does not mean that I'll be paying via my SBI account. It just means that the payment from my bank goes to their SBI account). 

Here a little problem happened. I first selected the option to pay via netbanking. Then I thought I'd pay via debit card, and clicked on "Cancel". I canceled it even before I started the payment process. When I went through all the menu options above and tried making the payment again, I was shown a message that my earlier transaction was still pending, and I was not allowed to start a new transaction. So I clicked the green "Contact us" button on the top right of the screen, and registered a complaint, requesting them to cancel the transaction. I also sent them an email (registering a complaint is better than sending the email).

The complaint was registered, but three days elapsed, and there was no progress. So when I went to the RTO, I was told to go to a counter where the tech person would cancel the transaction. At Yeshwanthpur RTO, the counter is at the 3rd floor. On reaching the 3rd floor, on the left side there's "Block A". I entered there, and the tech person was at counter T17 (the counter number was not visible directly. There was a narrow passage to reach the counter, and it's via this narrow passage that I could see the counter number). This person took a look at my RC and cancelled the transaction in less than a minute. 

Update: Ten days after I had sent the email complaint, they responded that the transaction is already cancelled. Two more days later, they responded to the complaint I had registered. So rather than wait for their response, it is better to got the RTO or maybe call up and get things done quickly.

Then I used my mobile phone to start the transaction afresh, and on reaching the payments page, I was shown a message that debit cards which used Visa, were not accepted. Thankfully, the same page had an option to switch to use netbanking. I selected that and made the payment online. 

After making the payment, when I re-visited the online services menu page, I was shown a pop up that listed out all the details I'd have to take care of, so that my vehicle passes the fitness test. I forgot to take a screenshot, so if anyone could share it, please do. Basically it's about all the electricals of the bike working well, the bike starting easily and being in a well-maintained condition.

Printing the receipt

After making the payment, it's possible to go to the online services menu again and in the horizontal menu on the top, click "Status", and select "Reprint receipt/form". I believe this is what displays the filled form 25. Unfortunately, this option was not showing up for me since I was accessing the website from my mobile phone. It didn't show the option even in the desktop mode of the mobile browser. So I went to the first floor where there were some Xerox shops. They told me exactly what I needed to submit. They opened up the website on their computer, found my filled form 25 and fee receipt, got the necessary printouts, gave me a brown paper file and a green postal envelope. Even the RC card needed to be put into a little plastic pouch in order to attach it to the brown file. Getting most of these things from the RTO itself is probably the safest option. Totally, it cost me Rs.56, because they took colour printouts. Later I found out that black-and-white printouts were enough. You have the option of taking the printouts of the fee receipt and form 25 at home itself. 

If you have trouble with the menu's always redirecting you to some specific page, you can always clear the browser cookies and start afresh.

All these documents; the form 25, the e-fee receipt, the RC in a plastic pouch, the green envelope, the photocopies of the insurance, emission test certificate and Aadhaar card, have to be threaded with the little red thread they give you along with the brown paper file.

Filling details in the form

  • On the green postal envelope, I had to write my name, house address, phone number and vehicle license plate number.
  • On the form 25, I had to enter the date, sign thrice in the area for specimen signatures and sign as the applicant and sign as the owner. So the form 25 ended up having my signature in five places (and that's normal). Since the payment was done online, the form 25 contained all other necessary details of my vehicle. I didn't have to write any of it. There was a space for what seemed like it was meant for sticking a stamp-sized photo, but the official said that sticking a photo was not necessary.

Payment 2

On the third floor, block B, counter 7, the person checked the forms and told me to go to block A to pay Rs.74 more. So at block A, counter T18 (note that this is not the cash counter NT8), I paid the extra Rs.74 in cash, which was for the smart-card. The actual smart-card cost is Rs.137+74, but the additional amount didn't get updated on the website, which is why it didn't get included in the online payment. They give a receipt for this Rs.74, and I had to write my vehicle number on it. The receipt had to be added to the bunch of documents contained in the brown paper file.

Verification

The person at the third floor, block B, counter 7 then verified everything in the brown file and asked me to proceed with the vehicle fitness test.

Vehicle fitness check

When leaving the RTO for the fitness test, I had to pay the parking fee. For the fitness check location, almost everyone talks about going near Mysore Lamps Factory. But when driving toward the place, I didn't see that landmark. After driving for a while along the road shown in the map below, I noticed a small pit-stop that deviated toward the left from the main road. Similar to how there's a small pit-stop at some bus stops, so that the bus does not obstruct traffic. That "pit-stop" is where the fitness check is done.

Fitness check location
 

I was told that the inspector would arrive by 12:30pm, and he did (which is an important point to note. If you go there much earlier than 12:30pm, you'd end up waiting for a long time). The inspector asked to see my form 25, he verified it with my bike's chassis number. Then he asked me to start the vehicle, checked if the lights were working and did a bit more inspection (tyres and general condition of the vehicle). They seem to have a knack of knowing which vehicles are serviced well and in good condition. I think his colleague kept track of which vehicles passed the fitness test. All this lasted only around two or three minutes. For everyone whose vehicles passed the fitness test, he told us to meet him at the RTO at his office at 3:30pm.

One person who came to get his vehicle inspected, had got his bike cleaned and polished so well that it actually looked like a brand new bike. I, on the other hand, had got my bike serviced a few months prior, and just used water and a cloth to clean my bike myself. That was enough for my bike, since it had no rust and was regularly serviced. I had also replaced both the worn out tyres with new ones. Basically, the inspector checks if the vehicle is road-worthy and whether it complies with the rules. Servicing the vehicle via an experienced, knowledgeable mechanic or authorized service center is more than enough. You don't have to go overboard with repairs. A routine servicing to ensure that the vehicle complies with motor vehicle rules is sufficient.

Pencil print

It was not necessary to take the pencil print of the chassis at the place of inspection itself (in-fact, they asked us to move on quickly). So I went back to the RTO, parked the bike there and took the pencil print. On form 25, there's plenty of space at the bottom of the page and at the right side of the page, where the pencil print can be taken. The inspector's assistant had told me to do it at the bottom of the page. I noticed that pressing the pencil tip too hard didn't create a good chassis number impression. Doing it a bit lightly, gave a good result. Some online posts spoke of how difficult it was to get this pencil print, and how they had to use a drop of petrol or oil to get it done. I didn't face any such trouble. 

Taking a pencil print of the engine number was not necessary.

Facilities

  • There is a tiny stall at the ground floor, where one can get biscuits, some other little snacks, tea, soft-drinks and bottled water. If you want a proper meal, there's a restaurant near the flyover named New Sagar.
  • On the ground floor, at the back side of the compound, there's a clean pay-and use toilet. On the third floor, there's a toilet a little away from the B block entrance.
  • There's a reasonable amount of parking space. You can park all around the compound of the RTO. Visiting on a weekday is best, since one can avoid parking congestion and avoid long queues.
  • There's an elevator you can use to visit various floors.
  • There are various shops for notaries, stationery and insurance.

Inspector's office

At 3:30pm, the inspector was at his office. This was at the third floor, office i2. The office of the inspector of motor vehicles. He signed on the form 25 and handed my file to his clerk. The clerk entered my vehicle number into his computer and said that I had to obtain a release from another counter. So I went to counter T14 in block A, and the person did the necessary release in the computer and put a seal on my form. I brought the form back to the inspector's office, and the clerk completed the remaining formalities in his computer. Then he put a seal on my form and asked me to submit it.

Submission

At the third floor, block B, counter 6, the person accepted my file, checked it and gave me a pink receipt as acknowledgement. I was told that the renewed RC would be sent to me by post.

 

While leaving the compound, I had to pay the parking fee again.


Additional note

Since my license plate was old, I was considering replacing it. Near my house, the people who made license plates, were making it using Aluminium, and they were adding a blue logo with a circular pattern of stars and an IND written on it. But I had found out that such a logo was not the actual HSRP license plate that the government mandated. I asked the assistant public information officer at the RTO, and he confirmed that those blue logo license plates were not what we had to use. Vehicles manufactured after 2019, are equipped with proper HSRP license plates. Such license plates were tamper proof, and have a special laser etched number below the IND mark. As of October 2021, Karnataka does not yet have a provision to issue HSRP license plates for older vehicles. So for now, older vehicles just need to follow rules 50 and 51 of the motor vehicles act 1989. Rules and HSRP details are also mentioned on this website. Places like Delhi have an online method of applying for HSRP plates. The officer at the RTO didn't reply to my query of when HSRP would be rolled out for older vehicles in Karnataka. I was however told that the RTO does not issue replacement license plates. I'd have to get it done outside.


Hope the details helped. I've noticed that there's a lot of confusion that people go through when following these procedures. There's a lot of doubt about many details too. This article was meant to clarify those. There's nothing to worry about. It's a simple and efficient procedure. The people at the RTO are a friendly and helpful group of people. It was a simple process that can of course be automated a lot more, but I was happy about the hassle-free experience.

09 September 2021

Capturing the screenshot of a menu

 Sometimes, when making a tutorial or when wanting to send feedback to a company, you may need to take a screenshot of a dropdown menu. But when you press the PrtScn key, the menu disappears. Fortunately, there are some ways to take the screenshot. The trick is simply to invoke the screenshot application by setting an interval of a few seconds during which you open the menu and keep it ready to be "screenshotted".

Shutter:

Shutter used to be available on Ubuntu via apt, but from Ubuntu 20 onward, it's available via snap. So to install it, use either:

sudo apt-get install shutter

or 

snap install shutter


Once you install and start Shutter, just open up the preferences and select the option to capture the screenshot after a delay of x seconds.


Once you capture a screenshot, Shutter also allows you to edit the image within Shutter itself. You can crop it, add arrows and do a lot more. So there's no need of opening a separate application like Gimp. 

Shutter also offers options to automatically upload images to various servers you choose. Truly a versatile tool!

09 August 2021

Understanding and helping people who have eye strain

People experiencing severe eye strain often find themselves grappling for help in a world that does not even begin understanding what they are going through. Moreover, some inexperienced doctors end up thinking that the person is exaggerating, when certain methods aren’t able to cure the person.

Protection of the eyes does not depend on the severity of eye strain. Everyone needs to be protected. Here’s how:

Think of the eye strain like a fractured leg

Do you motivate people with a fractured leg to run a little everyday to recover? Unfortunately, that’s what well-wishers do, when they tell eye strain patients to “do eye exercises everyday”. It’s what employers do when they think that all the employee needs is a little nudge and motivation to “just try working a little longer and get the work completed”. It’s what institutions do when they give short deadlines for assignments. It’s what family members and neighbors do, when they (often unknowingly) create situations that disallow people from getting eight hours of uninterrupted sleep each night.

Strained eyes need sleep and rest for recovery. A lot of rest.

Don’t ask for medical proof

Even during my chronic stages of strain, my eyes were not red. There were no physical manifestations of the severity of the strain (well, perhaps dark circles under the eye would count). Those were years when my extraocular muscles were sore and paining everyday, throughout the day. Doctors couldn’t quantify the strain or even identify the cause, and there’s insufficient research on how sleep and rest can cure fatigue-related strain (probably because it’s hard to measure strain of the extraocular muscles and probably because people don’t see the point of researching something so obvious as rest being the cure for fatigue). Everyone who uses the computer excessively faces eye strain. You don’t need medical proof that sleep and rest are necessary.

Be kind

All of us have been entertained with stories of heroic deeds of people who overcame adversity, people who went through sleep loss and pain and emerged victorious. All of us have had someone lecture us on how important it is to work hard. Often, these words reach us as uncompromising, patronizing, sharp criticism and sarcasm. This mode of speech gets passed on from person to person. Not surprisingly, when someone with eye strain asks for proper sleep and rest, the harsh response gets auto-activated and pours out…in an effort to quell what is perceived as laziness. Be kind to people who are suffering. Allow them to get the rest they need. If there’s urgent work to be done, assign the work to someone else and allow the person suffering from eye strain to switch over to tasks that do not involve too much strain on their eyes. Eye strain does not affect people’s intellect. There are a lot of other skilled tasks they can do.

It’s important to create a culture that allows people to heal.

Rest has to make up for sleep loss

Eye muscles get strained faster when a person has not got sufficient uninterrupted sleep (see the table below to know how much sleep one needs at various age groups). So when a person hasn’t had enough sleep, they should be allowed to take a short nap when sleepy or take more frequent breaks by closing their eyes to rest. It also helps lower their workload for the day.

Don’t force people to eat bad food

If someone wishes to avoid food at an office party or celebratory sweets or cakes and snacks at a birthday celebration or even at a canteen or restaurant or nearby bakery, don’t nudge or force the person to eat the food. The food from many sources are not fully cooked or poorly baked/fried. It results in digestive problems that result in sleep loss and cascades into eye strain.

Avoid unnecessary nudging

When I told an engineering director that I could use the computer only for 6 hours, his conclusion was that I could be persuaded to do so for 8 hours. An ex-employer told me they’d do everything they could to accommodate my eye strain, and ended up giving me enough work that it’d take three people to do it. Many companies that claim to have work-life balance, don’t have it. Good companies will have managers who are competent enough to plan proper timelines, ask for the right budget, assess skills, manpower requirements, create buffers and manage client expectations. This is the value that managers add, and this is why they are paid well. Good managers don’t need to overwork people.

Create a healthy work culture

“Please, sir, I want some more”. The master was a fat, healthy man; but he turned very pale. He gazed in stupefied astonishment on the small rebel for some seconds, and then clung for support to the copper. The assistants were paralyzed with wonder; the boys with fear. — an excerpt from Oliver Twist’s story, where he “dares” to ask for more gruel.

The astonishment of the “master” mentioned in the quote above, is what I saw on the face of an interviewer when I “dared” to tell her that I would not be able to work for longer than the stipulated time even if there’s a deadline. Somehow, most companies take it for granted that they can just make people work long hours. On top of that, there’s the bell curve that’s designed to motivate people, but ends up pitting team members against each other and ruining camaraderie. It’s time we acknowledged the pointlessness of this toxic work culture. It’s time we said no to overtime. There’s more to life than this. Work can be done with goodwill and greater efficiency in a healthy, sensible work culture.

Officially recognize RSI as a health hazard

Repetitive Stress/Strain Injury (RSI) is an injury that can have temporary or permanent effect on the body. In the same way that companies draw yellow safety lines on the floor, have “hard hat” areas and create various policies for safety, it’s necessary to create safety policies to protect people from eye strain, back pain, wrist pain, sleep-loss and any other such RSI’s. Without an official policy, the managers and employees won’t really be able to do much to protect themselves when deadlines approach. Policies also need to be created for schools. Unhealthy practices begin at school and home, eventually cascading into workplaces.

Start early

The problem begins from childhood, when children go to sleep late and are woken early for school. This continues with late-night study during exams, excessive computer use, lack of a well-balanced diet and other dietary problems that result in sleep loss.

Hours of sleep required, as discovered by the National Sleep Foundation. Image attribution: Wikipedia.


 

It would help to create a culture where right from childhood, the need for sleep, periodic rest and proper nutrition is emphasized and followed. At workplaces, ergonomics, periodic rest, proper planning, avoiding overwork and hiring people with an inclination to do the job well, would help.

It’s possible to have a sensible, kind, caring, healthy world. We just aren’t cooperating hard enough to create a heaven on Earth. Some countries are creating such a culture and it’s working well. Let us try too.

 

 

 

 

 

 

 

 

04 August 2021

Sharing a folder between users on the same Linux machine

This method creates a group named sharedFolder, and a folder on root, which can be used by user1 and user2, for sharing files.

First create the group and folder:

sudo groupadd sharedFolder
sudo mkdir /sharedFolder

 

Now set permissions:

sudo chgrp sharedFolder /sharedFolder
sudo chmod 770 /sharedFolder

Ensure that even subdirectories will have the permissions.
sudo chmod +s /sharedFolder

Add the users to the group:
sudo usermod -a -G sharedFolder user1
sudo usermod -a -G sharedFolder user2


This is especially useful after you've got rid of Windows (really, I've given up on Windows now) and need a way to share files without creating a separate NTFS partition which needs to be mounted to be used.

14 July 2021

What to do when Ubuntu's boot time is higher than it should be?

 I've always liked watching the Linux boot messages. So first, we can get rid of the "curtain" or the splash screen that hides those messages.

Execute:

sudo apt install gksu

gksudo gedit /etc/default/grub

In this file, remove the words "quiet splash", but leave the quotes intact.

 

From this:

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

To this:

GRUB_CMDLINE_LINUX_DEFAULT=""

Save and exit.

 

While you are at it, you could also remove the distasteful pink background:

sudo -H gedit /usr/share/plymouth/themes/default.grub

 

Change the color to something like 10,10,10,0.

Save and exit.


sudo update-grub


Now restart the system. In my case, there was a delay of one minute and thirty seconds. I noticed a message "A start job is running for dev-disk-by". 

 


This happens because one of the partitions on the disk has a unique id that does not match the unique id stored in fstab.


On opening fstab (sudo -H gedit /etc/fstab), I noticed that it mentioned a certain UUID for the swap partition. I ran sudo blkid and noticed that the actual UUID mentioned here for the swap partition was different.

So it was a simple matter of taking the UUID from blkid and replacing the UUID mentioned in fstab

Once this was done, the system booted without the long delay.

29 June 2021

Fixing pyaudio installation errors in Ubuntu and Raspberry Pi

I don't understand why developers can't just write a script to automatically detect the OS and install dependencies automatically. When installing pyaudio, there's this error that shows up on Ubuntu:

ERROR: Command errored out with exit status 1:

...blah blah...

src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
    compilation terminated.
    error: command '/usr/bin/gcc' failed with exit code 1

The solution is to install the dependencies. Not all of the below dependencies are required, but it's safe to just copy-paste these one by one to get them installed...just to be sure.

sudo apt-get install -y libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
sudo apt-get install -y ffmpeg libav-tools

And finally...

sudo apt-get install -y python-pyaudio python3-pyaudio

or
sudo pip install pyaudio 

or 

sudo apt-get install -y python3-pyaudio 

or 

sudo apt-get install -y python-pyaudio

or
sudo -s
pip install pyaudio

Sources: source1, source2.

If the problem happens in Raspberry Pi, these are the steps:
Remove the directory PyAudio which is already present in /home/pi and then try these steps:
sudo apt-get install git
sudo git clone http://people.csail.mit.edu/hubert/git/pyaudio.git
sudo apt-get install -y libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev
sudo apt-get install -y python-dev
cd pyaudio
sudo python setup.py install

Thats it! Have fun.

24 June 2021

How to use Jupyter notebook locally (and an intro to Fast AI)

When refreshing my knowledge about which Deep Learning library is currently most popular, I came across a blog which listed PyTorch at the top. Theano was apparently on its way to oblivion, and libraries like Neural Magic and Caffe claimed to offer better performance than TensorFlow. However, Fast AI was a library which had an accompanying course that was gaining popularity quite fast. Their book is available as a free Jupyter notebook, but I wanted to try it offline. Here's how:

You don't need to install Anaconda. Just do:

pip install jupyter

To get Fast AI's book, do:

git clone https://github.com/fastai/fastbook.git

Open a terminal in the cloned folder and type:

jupyter notebook


Your default web browser will open up and the Jupyter environment will be available on localhost as http://localhost:8888/tree.

 

It's that simple. Now just click on the hyperlinks on the page, and the ipynb notebook will be visible. You'll have to wait a few seconds for the notebook to load though. 

Do have a look at Fast AI's course too. Quite good. Although I prefer watching it directly on YouTube, since there are additional video controls there. Lesson 0, lesson1, lesson 2, lesson 3, lesson 4, lesson 5, lesson 6 and lesson 7.


01 June 2021

Using DosBox in Ubuntu

When an Australian who goes by the internet name "Sparcie" decided to review some of my games (I guess he found it via a GitHub search), I noticed he did it on an MS-DOS emulator named DosBox. 

(Sparcie has a treasure of awesome videos on various BASIC programs, games and legacy hardware. Check out his channel and blog)


I thought I'd give it a try too, and although it was a bit hard to understand at first, it's easy once you understand why it was created as such. 

Installing dosbox

To run it on Ubuntu, first install it using:

sudo apt-get install -y dosbox

Then start it by typing "dosbox" (without the quotes) in a terminal. That'll create a config file that you can find in a hidden folder in your home folder, named ".dosbox". 

ls -altrh will show you the folder. In Nautilus (the graphical file manager that's the equivalent of Windows Explorer), you can press Ctrl+H to see the file, since it's a hidden file.

Initial configuration

To be able to access files from Ubuntu on dosbox, you can create a shared folder named DOS. I'll assume you've created the folder in the home folder ~/DOS. The tilde (~) is a shortcut for the home folder in Ubuntu.

The hidden folder is in Ubuntu's home folder, and contains a configuration file named dosbox-<version>.conf.

Similar to the autoexec.bat file in MS-DOS which used to be run on startup (same as startup scripts for Ubuntu), the dosbox conf file has an autoexec section where you can type DOS commands to execute when dosbox starts. So search at the bottom of the conf file to find "[autoexec]", and below it you can type your commands. I typed the following:

[autoexec]

mount C ~/DOS

echo "~/DOS is mounted onto the C drive"

C:


Remember that the folder names are case sensitive. This ensured that the DOS folder was mounted onto the C drive and the current drive was automatically shifted from the default dosbox Z drive to the C drive. 

Now, once you start dosbox from the Ubuntu terminal, you'll see an emulated MS-DOS command prompt from where you can run "dir" and you'll see the files you've placed in the ~/DOS folder. 

Adjusting program execution speed:

If your plan was to run DOS games, you can do so. However, you'll notice that some games run slower than they are supposed to, and some run too fast. To adjust this, you can search the conf file for the line containing "cycles=auto", and do some trial and error with various values like:

cycles=normal 1000

or 

cycles=normal 5000

For a more specific value, see these tables which show which CPU type the values represent.

 

The conf file shows there are a lot of other settings that can be emulated. See the FAQ for more info on dosbox. Wish you a happy trip down the memory lane.


Update:

As Sparcie mentioned in the comments, you can use Ctrl+F11 to reduce the cycles while dosbox is running (the cycle value will be shown at the top of the window. Ctrl+F12 speeds it up). However, if dosbox is using just one core, taking the cycle count too high will simply put one CPU core at 100% and slow down the program in dosbox. Adjusting the core's setting might help, but I haven't tried that yet. Perhaps a simpler option would be to just use a virtualbox with an older version of Windows installed. Or, use one of the modern QBasic interpreters.

Turns out there's an official QBasic for Windows 10, from Microsoft, there's a QBasic64 for Windows, Linux and Mac! (with source code). Nice to see people maintaing QBasic even after all these decades. Similarly, there's even a modern Logo.




13 May 2021

A case for the single password field

We often spend our lives accepting the status quo. There are times however, when it helps to ask what can be done differently. For example, whenever we are asked to create a new password, we are asked to type the password into two fields.

When joining the snapcraft forum however, I noticed that they asked for entering the password only once.

 

Then it struck me...it makes perfect sense! Even if there's a typo in my password, this is a platform that allows sending an email to reset the password. 

If it was a desktop application or an OS login, it'd make sense to request entering the password twice. Web apps like these can do just fine with a single password field.

Good to see the Snap team being thoughtful and unafraid of creating a new path instead of following convention.


12 May 2021

Pushing to GitHub without needing to type the username and password each time

I've already written about doing this on Windows. Here's the Ubuntu version.

In a terminal, type:
ssh-keygen -t rsa

When it asks "Enter file in which to save the key ", just press Enter and type a password. You'll be asked for this password later.

Go to the ~/.ssh folder and open the id_rsa.pub file with a text editor.
Select the entire contents of the file to copy the key.

In your GitHub account, go to the GitHub profile settings (your account's profile setting page. Not a specific project's settings page; go to the GitHub account's settings page).
Select SSH and GPG keys option in the menu on the left.
Click the green "New SSH key" button and paste the key that you copied.

On your local system, type:
git clone git@github.com:yourUserName/yourRepositoryName.git

You may be asked for entering the private key. Type the password you had recently created.

Add these commands to your ~/.bash_aliases file.
alias pushall="git push --all origin"
alias pullall="git pull --all"
alias commit='git add -A && git commit -m '

Save and exit the bash_aliases file.

Type:
source ~/.bash_aliases
to enable the commands you just entered.

Now simply go to the repository you cloned, make some changes to the files, do a commit with:
commit "a small change was made"

and push:
pushall

Tadaaah! Pushing and pulling becomes so much simpler.

23 April 2021

The open sourcing continues...

When most people talk about "contributions to open source", what they mean is that you join an open source project and contribute code to it. However, that's not the only way to contribute to open source.

In 2014, I had written about seven other ways in which you can contribute to open source...to which Noah Slater replied, encouraging people to also promote the spirit of contributing to open source.

Each time you report bugs, help people on the internet and create your own open sourced software, you are indeed an open source contributor. 

Yesterday, I noticed that some of my repositories were being forked. Happy that the programs I developed are of use to the community. 


The file duplicate finder is a program I'd encourage people to use (and from the fact that an issue was reported, it looks like people are finding the project and hopefully finding it useful). Sometimes we have a lot of duplicate files and images lying around in various devices. This program helps identify and consolidate them. 

 

When looking at how often people contribute code:

I just noticed, that my public view of GitHub commits, does not show what is going on in the private repositories (which show a lot more commits). This is something recruiters would benefit from keeping in mind.

Public View

Private View (the actual number of commits)


22 April 2021

WindowsXP image resizer powertoy equivalent for Linux

Windows XP's powertoy for resizing images was so convenient and popular, that people demanded it for future versions of Windows too. Linux however, seemed to lack such a feature, and people used to suggest using a bash script or GIMP to perform batch conversions.

There's a far simpler way now. Bitron software created Nautilus Image Converter which when installed, gives you image resize and rotate options in the right click menu itself. Really handy.

 


Install it using:

sudo apt install imagemagick
sudo apt-get install nautilus-image-converter
nautilus -q

 

The "nautilus -q" is to stop nautilus (the file manager for Ubuntu that's the equivalent of Windows Explorer). You can restart nautilus by just clicking on any folder or the "Files" icon or by opening a terminal with Ctrl+Alt+T and typing "nautilus".

24 March 2021

How to show the commands being executed during Ubuntu startup?

There are times when while booting Ubuntu, it may take a rather long time to boot, and you'd wonder what's holding it up, but the purple splash screen that acts like a curtain, does not show you what's going on in the background.

Here's how you remove it:

sudo gedit /etc/default/grub

Comment out the line which has "quiet splash" and create a new line with an empty string.

#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT=""

Save and exit.

And it's necessary to update grub to retain the changes, else when you restart the system, the changes you made will disappear.

sudo update-grub2

02 February 2021

Changing the colors in Pandas boxplot

 Normally, it's just one Google search that gets you to a good example for plotting any graph using Pandas or Matplotlib. Not so for boxplots. Every example I saw was ordinary and didn't show the advanced options for colouring the plot. So here's a quick demo:


import math
import pandas as pd
import matplotlib
import matplotlib.pyplot as plt
#Named colors: https://matplotlib.org/3.1.0/gallery/color/named_colors.html

data = {"A": [1,2,3,4,10,56,32], "B": [2,4,6,3,2.4,0,0], "C": [1,4,0,10,20,5,2], "D": [2,3,6,2,3,40,-1]}
for k in data.keys():#convert the zeroes to NaN, so that it does not mess up the boxplot
    data[k] = [x if x != 0 else math.nan for x in data[k]]
figWidth = 4; figHeight = 4.1;
boxproperties = dict(linestyle='-', linewidth=1.5)
medianproperties = dict(linestyle='-', linewidth=1.5)
flierproperties = dict(markerfacecolor = 'lightgrey', markeredgecolor = 'lightgrey')
colors = dict(boxes='dimgrey', whiskers='darkgray', medians='yellowgreen', caps='dimgrey')
df = pd.DataFrame(data, columns=list(sorted(data.keys())))
df.plot.box(grid=False, patch_artist=True, showmeans = False,
            sym='.', color = colors, boxprops=boxproperties,
            medianprops=medianproperties, flierprops = flierproperties,
            figsize=(figWidth, figHeight))
plt.title("values")
plt.ylabel("y label")
plt.xlabel("x label")               
plt.savefig('myPlot.eps', format='eps', dpi=1200)
plt.show()   



There are of course more styles that could be presented. Do let me know in the comments if you'd like me to add them or if you have any improvements to suggest.

01 January 2021

What technical pre print repositories accept unpublished research?

In academia, it is very important to be ethical and to ensure your ideas are not copied or scooped before you can prove that you came up with the idea first. To enable this, pre-print repositories like ArXiv were setup to give research work a timestamp when submitted. This could help any researcher prove that they came up with an idea first. Any work found on a pre-print repository is not a credible source of information, since it has not yet been peer-reviewed. However, since ArXiv has a very strict moderation policy that results even in experienced scholars having their papers rejected, ArXiv does not fulfill the purpose of being a pre-print archive. The delay in moderation, the need for endorsement from somebody else and the rejection can just end up allowing time delays that can result in work getting scooped. Many other pre-print repositories have come up, and it's considered ok to upload your research paper to multiple repositories.


Some of these free repositories are:
  • ViXra: This pre-print repository is far more accepting than ArXiv, and was created as a means of allowing genuine research work to get a timestamp. I found their FAQ to be far more insightful and enlightening than any other pre-print's FAQ. I encourage reading their FAQ. It mentions a lot of useful information about what you should and should not do with your pre-prints. I feel ViXra is one of the only pre-print repositories that actually honors the purpose of being a pre-print repository. Hence, this is the only repository I would trust, because I know that when I submit a genuine paper to them, they will give me a timestamp for my work instead of delaying it or rejecting it.
  • TechRxiv: A pre-print repository setup by IEEE. I've found them to be good, but there are chances of a reviewer not accepting a paper and having to appeal to the editor until they allow a re-upload. The whole process can take a few weeks...enough time for getting scooped in some fields.
  • IndiaRxiv: I was pleasantly surprised to find one for India. It's part of OSF, which accepts papers from multiple disciplines.
  • HAL: This is a well known repository with moderation and it is said that they also allow you to transfer your paper from HAL to ArXiv.
  • EngrXiv: This is also part of OSF, and has been gaining traction with researchers.

Some precautions before submitting to a pre-print
 
Remember that there are some journals and conferences that do a double-blind review of your paper, and they will not accept a paper that is uploaded to a pre-print repository. so if you plan to submit to a certain journal or conference, first check their website or write to them asking if they allow papers that are on a pre-print repository.
A quick way to search is by using Google's tools:
site:journalWebsiteName.com arxiv

Careful of predatory journals or conferences

Some journals will offer to get your paper published for free without any peer review process. Avoid such journals. It can lower your academic standing. I was contacted by one such journal which quoted an ISSN number on their website. When I searched, I realized that such an ISSN number didn't even exist!!! Always make sure your work is properly peer reviewed by reputable journals. In the tech world, journals with a Scopus index are safe.


In conclusion
 
Writing research papers is a time-consuming and cumbersome process. All that hard-work should not go for a waste. Pre-print repositories are a very useful means of proving precedence of your idea. They are also meant for inviting comments from colleagues, before you decide to submit it to a conference or journal. Websites like ResearchGate will automatically detect your work on pre-print repositories and link it to your ResearchGate account, making it easy to share your work and to invite comments on ResearchGate, because it automatically notifies the authors you have cited in your paper.
To simplify people's research process and to make available information on research and publications, I've curated a small collection of helpful documents from multiple people.


ps: On a more personal note, I feel that researchers who advance the knowledge of mankind and who are the backbone of the technological capability of society, need more respect and recognition in society. The level of detail they go into, the expertise they acquire in each subject and the rigor of research makes them an elite force. It's unfair that companies and publishers make profits form their ideas but the researchers don't profit from it. How did researchers even agree to such a raw deal? Publish or perish? I dearly wish that the world figures out a way to ensure that researchers are able to monetize their contributions much better than they currently are. If not that, then at least provide them privileges and conveniences that make life easier for them. All the benefits of technology we enjoy are because of them. We must never forget the shoulders we stand on.

24 December 2020

The better way to calculate permutations programmatically

When wanting to calculate factorials and permutations, I was surprised that C++ didn't have a built-in function to do it. Sure, it's a simple function, but cmath could have had one instead of expecting users to write their own function. Anyway, I created a class for it and soon realized that even unsigned long long was unable to hold the large numbers that I was calculating permutations for.

This led me to the online calculators, which did ok for conditions like 81 numbers taken 81 at a time (which gives a huge result: 5797126020747367985879734231578109105412357244731625958745865049716390179693892056256184534249745940480000000000000000000).

However, calculations like 129600 taken 2 at a time, were not supported, so when I searched for which programming language could help, I found that Python was just perfect for this. Turns out, numbers in Python are only limited by the amount of RAM you have. Intelligent people, these people who maintain Python. 

Python does have a limit on how deep your recursion can go, so rather than use recursion to calculate factorials, it's better to use the humble for loop. Here's how it's done:

def factorial(n):
    fac = 1
    if n == 0:
        fac = 1
    else:
        for i in range(n,0,-1):
            fac = fac * i
    return fac

print("To calculate permutations:")
print("n!/(n-r)!")
n = int(input("Enter number of possibilities (n): "))
r = int(input("Enter how many at a time (r): "))
print("Permutations: ", factorial(n)/factorial(n-r))



11 November 2020

The Real Cure for Eye Strain

When faced with eye strain, should you use eye drops, new spectacles, do eye exercises and work harder or should you take rest?  

More people's experiences of severe eye pain: https://nav9.medium.com/the-real-cure-for-eye-strain-more-experiences-7f4c1c552d5a

Consider it this way: when wearing a pair of shoes that’s too tight for you, and each time you walk, it keeps hurting you, would you remove it or would you pour medicines and apply band-aid on your feet and continue walking while the shoe bites into your skin and flesh? The shoes are an analogy to the way we use our eyes without taking rest. The band-aid and medicines are an analogy to how we use spectacles, eye drops, eye exercises, blue light filters etc., hoping that it would cure us.

 (Blue light blocking lenses have shown no evidence of preventing digital eye strain. Ref1, Ref2.).

Sure, some remedies do appear to give a little relief, but they are only treating the symptoms. We should not pretend that it is working. We need to treat the root cause and cure it. I realized after a decade of chronic eye strain, that there’s an obvious, common-sense first-step to the healing process: Removing those “shoes”.

 

Discovering the truth

Doctors tend to focus on intraocular muscles. A less considered fact is how extraocular muscles (shown in red) are affected. I’ve felt excruciating pain in those areas for many years.

In my case, it began with a burning feeling at the front of my eyeballs. Then came the light sensitivity, occasional sharp pains at the sides of the eyeballs, which became sharp stabbing pains all around and behind my eyeballs. I ignored that too and continued working. Then came severe pain all over the eyes, eye muscles twitching, tightness at the cheek muscles that even spread to the forehead muscles. The sharp stabbing pains continued, and my eyes were paining every waking minute of the day. I found it difficult to even keep my eyes open for too long. This is what chronic eye strain feels like. During the next few years, I consulted plenty of doctors (even at highly recommended eye specialty hospitals). They examined my eyes and found no defect other than myopia. No doctor had even heard of such a severe case of eye strain. They tried their genuine best to help, and I could see they felt bad, because they wanted to help me recover (bless them), but they didn’t know how to cure me. Medical science doesn’t seem to have given enough attention to the root causes of fatigue-related eye strain. Practitioners of ancient traditional medicine couldn’t help either.

My eyes just continued aching and burning every single day, throughout the day for six more years, and I continued using the computer for many hours as usual, despite the pain…because I thought I had no other option. Added to that was the mockery from many who thought I was exaggerating.

The persistent pain finally drove me to note down daily experiences. Over a period of few years, multiple experiments, correlations and keen observation, coupled with consultation with a doctor, I finally found the cure and started recovering.

 

The Cure

It’s necessary to follow these three very strictly. Depending on the level of strain, it can take anything from a few weeks to many months to get cured, but this is the only way to cure fatigue-related eye strain. Nothing else works.

  1. Eight hours of uninterrupted sleep every night: This is the foundation. Without this, nothing else will cure the strain. We assume we are getting enough sleep because we feel refreshed when we wake up…and then don’t notice that we still feel sleepy during the day. Before my eye strain became chronic, I hadn’t noticed I was getting only 4 or 6 hours of sleep for many months. During my experiments, I noted that it was only after 8 hours of uninterrupted sleep, that my eyes felt fine. Interruptions in sleep or short duration of sleep does not seem to allow the muscles and tissues to heal. Strain appears to accumulate everyday due to lack of proper sleep. You’ll also notice that you are able to see much clearer than usual, after you get 8 hours of restful sleep. Children need more than 8 hours of sleep, and noise etc. disrupts sleep.
  2. Closing the eyes after 20 minutes of strenuous work: Twenty minutes of work followed by closing the eyes, relaxing the face muscles and neck muscles and waiting until the strain subsides (the way we maintain tension in our muscles is a part of the problem). It helps to install software that reminds you to rest at intervals. Even if you don’t feel strained, stop after 20 minutes and rest. It’s necessary. The “20” is not some random number. It’s from many years of experimentation. There is no work that is more important than your eyes. I’ve tried eye drops, an eye gel, anti-reflective coatings, blue-light filters, eye exercises, washing the eyes, the 20–20–20 rule, expensive eye glasses and all the other advice that doctors and common folk think is a cure for eye strain. Nothing worked. At my level of severity, even minor differences were noticeable. The ONLY way to rest the eyes and get relief from fatigue-related strain, is to keep the eyes closed until the strain subsides.
  3. A well balanced diet of properly cooked food: It’s extremely important to know that when food is not properly cooked or even slightly burnt, it causes discomfort in the digestive system (most of the time you won’t even notice this discomfort) that leads to sleep loss (I’ve mentioned more about this in the paragraphs below). Also, ensure you search the internet and understand what a “well balanced diet” means, and why it’s important. Instead of searching only for foods that can help the eyes, make sure your entire body gets the nutrition it needs. Bodily functions are highly interconnected. When muscles go through strenuous activity, they need a proportional amount of protein (There’s a wide variety of proteins. Chicken meat worked best for me. I have no clue about what protein sources would work for vegetarians). The body also needs natural foods that help with long duration sleep and deep sleep.

 

Eye strain and myopia can be caused by many other factors too. Those are best diagnosed and treated by a qualified ophthalmologist. Everything I’ve mentioned here, is only for eye strain that’s caused by excess fatigue to the eyes and lack of sleep.

 

Precautions and Observations

  • Eye exercises: Tired muscles need rest. Not exercise. When your eyes are strained, do not do eye exercises. Just close your eyes to rest them.
  • Full body exercises: It was of no use in curing or reducing eye strain, and it resulted in better sleep only during the first week. However, full body exercises are very necessary for general health.
  • The “SCREAMING”: The pain/burning/discomfort is basically your eyes screaming at you, begging for rest. Never ignore or delay it.
  • Digital screen settings: It helped a little bit when I reduced my computer and smartphone brightness to the lowest level I was comfortable with, and used the monitor’s preset “warm” setting. Alternatively, the free night-filter/red-shift apps are also good, but these won’t cure strain. What also helped, was positioning the screens in such a way that reflections on the screen did not cause glare. Anti-glare coatings did not reduce my strain even a little bit because digital screens or blue light was not the reason for strain. Strain was caused by the lack of periodic rest and sleep. Don’t forget to drink sufficient water and blink.
  • Rice: Remember this: It is not necessary that rice grains should be separate from each other when cooked. It’s more important that rice is cooked with sufficient water for the right duration (or even boiled with excess water and then drained). Some varieties of rice may need four or five cups of water per cup of rice. I know you’d be shocked if you’ve been taught to use just two cups of water. Do a bit of searching and understand the role of amylose and amylopectin. Freshly cooked rice has reasonably separate grains, and that texture feels good while eating. On cooling, rice will clump up, and that’s normal. Using less water to ensure that cooled rice grains remain separate, is counterproductive. Rice cooked with insufficient water can cause sleep loss.
  • Other problem foods: Burnt particles in food caused digestive discomfort, which led to sleep loss. I now throw off the black, burnt spots from bread toast, barbecued chicken, parathas/rotis (undercooked parathas and rotis also caused issues) etc. Any food that felt like chewing-gum, also resulted in sleep loss (it wasn’t cooked properly). Unripe fruits caused this problem too. Water from certain water filters that left a “layery” feeling in my mouth, coffee and even adulterated consumables caused digestive discomfort that led to sleep loss. Flatulence and loss of appetite can be signs that certain foods caused trouble in the digestive system. Different people respond to various foods differently, so over a period of time, diligently figure out which foods are affecting your sleep. It can be food from a hostel, a restaurant, a stall, a bakery, cafe or a packaged snack or even from somebody at home who does not understand the principles of cooking. Make sure you get well-cooked home-food. Also be careful of H.Pylori at places where hygiene isn’t maintained (the ulcers cause pain, resulting in sleep loss).
  • Incorrect diagnosis: Doctors seem to assume astigmatism, or that the eye power is higher than what it actually is, when patients complain of eye strain (one doctor even jumped to the conclusion that I had dry eyes, even though I didn’t). Strained eyes can result in significant variations in eye power. It does not mean that one needs to immediately switch to new lenses. It’s important to reduce the strain first by getting proper sleep and rest. Doctors even prescribed cylindrical correction lenses which I couldn’t tolerate for even a few minutes. Even computerized eye tests and the pupil dilation test showed astigmatism and the wrong power. Oddly, every doctor gave me a slightly different eye power prescription, and each time, the cylindrical correction angle was different from the previous reading. I started spending most of my days either not wearing spectacles or using spectacles of a lower power (which didn’t cause any issue, by the way. It actually gave more relief), and when I started getting better sleep and rest, the strain reduced. This time, after getting a good night’s sleep, when I went to the doctor with well-rested eyes, my eye power was diagnosed correctly. Three doctors eventually concluded that I don’t have astigmatism. The high level of strain had helped immediately eliminate wrong lenses.
  • “Is this lens better or this one?”: When my eyes are strained, lenses of a power lower than my measured eye power feel a lot more comfortable. As long as the spectacle lenses feel right, that’s the eye power to stop at (for driving etc. 20/20 vision is obviously required. Use commonsense). When my eye power was -4.25, and the doctor added another lens to make it -4.5 and asked whether the higher power was better, it appeared clearer and sharper to me (I didn’t realize it was too powerful), so I chose -4.5. I shouldn’t have done that. -4.25 was the correct power. When using the computer, I switch to -2.0 power ordinary glass lens spectacles without any coatings, and I’ve had absolutely no problem (spectacles purchased in 1998). Some doctors recommend wearing spectacles even if it feels uncomfortable or if it gives a headache, saying that the eyes would adjust after a few weeks. That’s very wrong advice. There are two scenarios I know of that causes this. 1. The lens power prescribed is wrong, or 2. The lenses are not aligned correctly, as shown in the image below. In both situations, I learned not to wear those spectacles. It caused more strain.
Spectacle lens fitted at wrong angle

Sometimes, the spectacle lens ends up being fitted at a slightly incorrect angle. This image shows one axis. The bad fit can happen along other axes too. This caused my eyes to get strained faster. Unprofessional opticians will tell people to adjust to it. Instead of “adjusting”, demand that the optician fit the lens correctly. There are a lot of measurements that need to be done accurately when selecting the focal point and fitting the lens to the frame. Many opticians don’t bother doing these measurements. We end up suffering.



  • Low power prescriptions: I’m hearing of a lot of people being prescribed -0.25 or -0.5 prescriptions for one eye or both eyes. Please consider that these powers may just be a result of excess strain or lack of sleep. Couldn't wearing spectacles constantly prevent them from recovering to normal sight?
  • Bad habits from childhood: For goodness sake, please don’t mess up children’s sleep cycle. Not even for exams. Hard work is good, but losing sleep repeatedly to do hard work is foolish. Right from childhood, we have been taught to ignore discomfort and persevere, but we should have also been taught to recognize when we should stop and give our body the rest it needs.
  • Work environments: Even in the most well-meaning work environments, bosses are pushed to deliver results quickly. But that doesn’t mean you need to damage your health in the process. Six hours of computer use a day is what I’d say is the safe-limit (eight hours may work for you, but never skip the rest breaks). When recovering from chronic eye strain though, not more than 4 hours is what I found is best. The entire world is realizing this necessary truth, and you shouldn’t be ashamed to take rest. Being a responsible person who gives their body the rest it needs is one thing. Laziness is an entirely different thing. Any sensible boss or colleague will know the difference.
  • Online classes and smartphone/TV use: Teachers and parents need to ensure that students get some necessary breaks during online classes, smartphone use or while watching TV. Kids by nature won’t listen, but please ensure they get their rest, sleep and nutrition. Their disappointment at not being able to play video-games for long, is tiny compared to the disappointment of having to wear spectacles lifelong. The need to wear spectacles itself shows that the eyes are seriously affected. Don’t make it worse. Better still, don’t even allow it to reach a stage where anyone needs spectacles. Protect the eyes.
  • Daytime sleep: If you couldn’t get proper sleep at night, you will feel sleepy during daytime. It is extremely important to take that nap. It gives some very essential rest for the eyes that’s even more effective than just keeping the eyes closed.
  • Coffee/tea: When the body badly needs rest and you feel sleepy, you should sleep. Drinking coffee or tea to remain awake is a silly thing to do.
  • The angle: If you extend your hand in front of you and hold a dumbbell for long, your muscles will start aching after a while. When it starts aching, if you raise your hand to hold the dumbbell above your head, some of your arm muscles will be spared of the weight of the dumbbell and get a chance to relax. The extraocular muscles holding the eyeball, are like the arms holding the dumbbell. Closing your eyes and lying down facing the ceiling helps those muscles relax a little bit (it gives just a teensy bit of relief).
  • Spectacles are not a cure: Some people assume that if they constantly wear spectacles or contact lenses for a few years, they will get cured to normal sight. It won’t.
  • Glass lenses were better: I find this strange myself, but during my chronic levels of strain, plastic lenses always caused my eyes to get strained quicker than when I used glass lenses. Now that I’ve recovered a lot, I feel that difference a slight bit lesser, but there seems to be some reality to it. Perhaps glass offers better visual acuity. I hope researchers could look into this. Of course there’s a safety benefit to plastic lenses, but while sitting in front of a computer, I prefer glass lenses. Some opticians may lie, saying that glass lenses are not available. They are available and are cheaper than plastic lenses.

As for everyone who knowingly or un-knowingly deprive people of sleep and rest right from childhood, please realise the seriousness of the matter and establish processes that help create a nation of healthy people.

The human eye was not evolved to handle this kind of strain. Too many people are getting incorrect advice and hurting their eyes. Please tell more people about getting proper sleep and rest. There are not enough doctors telling them.


CAUTION

In the same way that antibiotics should not be discontinued before the full course is completed, even the procedure for rest, sleep and proper nutrition should not be discontinued. It can take several weeks/months to recover from acute strain, and it takes several months/years to recover from chronic strain. I initially took a 15 day vacation to check if it would cure the strain. When it didn’t, I assumed that taking rest was of no use. I didn’t realize that my strain was chronic and I had severe sleep loss. The strain had built up to such a severe stage that longer periods of rest and sleep were required. The right thing to have done would have been to take a sabbatical for a year to ensure I got rest. Due to ignorance and bad advice, I continued working, and the problem persisted for several years. This applies even to conditions like back pain etc. When the body needs rest, give it rest. Any other work can wait. Else, you’ll end up with a severe burnout that will prevent you from working anyway.

 

Like someone once said: 

If you do not give time for wellness, you will be forced to make time for illness”.

 

 

Keywords: computer eye strain, eye strain glasses, eye strain headache, reduce eye strain, eye strain causes, digital eye strain, eye strain from computer, glasses for eye strain, eye strain relief, eye strain in one eye, what causes eye strain, eye muscle strain, how long does eye strain last, why do my eyes hurt, eye drops for eye strain, glasses for computer eye strain, how to get rid of eye strain, burning eyes, eye drops for burning eyes, pain in eye, pain behind eye, right eye pain, left eye pain, headache eye pain, sharp eye pain, eye pain causes, sharp pain behind right eye, pain relieving eye drops, home remedies for eye pain, eyes hurt, pain above right eye, pain in eyeball, pain over left eye, how to relieve eye pain, how to stop eye pain, reason for eye pain, medicine for eye pain, eye pain home remedies, eye strain symptoms, headache and eye pain, eye socket pain, stabbing pain in eye.


02 October 2020

Install PyEnv if you want various Python versions on Ubuntu

One of the major issues with installing new versions of Python is that if you try removing it or try removing the existing version, it'll cause problems with the working of the operating system, because Ubuntu uses Python for many of its system functions.

As an alternative, people suggest using Anaconda or Miniconda. When I tried it, I ran into errors where the package versions installed with Anaconda conflicted with the system Python versions. At my wit's end, I finally gave PyEnv a try and it worked beautifully.

  1. sudo apt-get install openssl libssl-dev
  2. sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev python-openssl
  3. sudo apt-get install -y curl
  4. curl https://pyenv.run | bash
  5. Follow the instructions shown on the terminal to add commands to bashrc. If you see any warning messages, follow the advice mentioned in the message. Close terminal. Open a new one. 
  6. sudo apt-get install -y gcc make zlib1g-dev libreadline-dev libreadline8 sqlite3 libsqlite3-dev libbz2-dev python-tk python3-tk tk-dev
  7. pyenv install --list to see the latest versions of python available.
  8. pyenv install -v 3.8.3  (or install one of the latest versions 3.9 or any other)
  9. pyenv global 3.8.3
Useful commands:
  • To see which versions of pyEnv are installed: ls ~/.pyenv/versions/ or pyenv versions
  • To remove any version: pyenv uninstall 2.7.15 or rm -rf ~/.pyenv/versions/2.7.15
  • Check which is the system default version: python -V
  • To revert back to the default system python: pyenv global system
  • Commands available with pyenv: pyenv commands
  • Getting help for any of those commands: pyenv shims --help
  • Check if pip is installed: pyenv which pip
  • Set a global version: pyenv global 3.6.8
  • Set a local version for a specific application's directory: pyenv local 2.7.15
The most impressive parts of PyEnv are the ability to switch between Python versions and have separate local and global versions.
Although the next step would be to install a virtual environment using pipEnv, I didn't like it because the updates portion is poorly implemented. There's also venv you could try.

05 September 2020

Keyboard cleaning

The good thing about freelancing is that one gets a good amount of spare time to relax the eyes and go for a digital detox. Add to that a global pandemic, and you get to learn some new things.
I decided to open my keyboard which had been gathering dirt for many years. Here's the "before" picture.


Opening it up showed how much dirt had accumulated over the years. But I also noticed that the reason that the keys didn't have a smooth movement when pressed down was not the dirt. It was because they had to slide down the plastic, and there was no lubrication.


This is the membrane the keys push down. It's a "dome switch" which completes the circuit when the finger presses it down.


The circuitry under the domes. I was surprised at how minimalist it is.


A word of caution. When removing the key caps, don't use a compass or an object that exerts force at a single point, because it'll cut a groove in the plastic, as shown in the image below. It's better to use an old debit card or a professional key cap remover or even make one yourself using metal wires.


After cleaning and drying, the keyboard looks good as new!!! I wanted to apply some grease too, but some forums and comments warned against using grease or oil without first checking how it'd affect the plastic.


Don't forget to take a photo of the keyboard before opening it up. It'll help when you are putting back the key-caps.
Next time I'd go for either an ergonomic mechanical keyboard or a buckling-spring keyboard.