Ubuntu 18.04 - UpWork Screenshot Error

Today was going to be the first day I would use Ubuntu 18.04 for work. Been a freelancer working through UpWork it is important that the UpWork tracker would work. It installed fine but when I used it this morning I noticed that there were no images in the screen shots taken. Some thing was wrong. I logged in to UpWork and my suspicions were proved when it red “Screenshot coming soon”.

The issue couldn’t have been due to a dependency. If it was, then UpWork wouldn’t install at all. Then it occurred to me that I was on Wayland and I had a hiccup with a screen capture app as well. I then logged out and logged in using XOrg.

To do this…

  • Logout
  • Select your user account
  • Then click the cog icon right under the password
  • Select Xorg variant (for example: Communitheme Xorg)
  • Login

Thats it, after that your UpWork tracker will work fine.

PS: I kind of like how the new UpWork client workspace is. Every thing seems to be grouped neatly. Good work UpWork!

Ubuntu 18.04 - First Things First

Ubuntu 18.04 is not out yet, but that shouldn’t stop you. I installed an pre release in my secondary laptop and as far as I can every thing is cool except some apps (so far Nodejs) not having official repos for it. I only stick with LTS versions. As a result, I am jumping from Ubuntu 16.04 to 18.04.

I have been a huge Unity fan. My heart sank when Ubuntu officially notified that Unity will be discontinued. Now Ubuntu comes with the Gnome shell. Been a power user what irritates me is the difference in keyboard short cuts. I bet they can be customized but I don’t. I need to feel the pain.

This are the first few steps I followed setting up my laptop and what I think is important. I will update this article in time.

Update

Once you install a Linux distribution, it is always a good idea to install any upgrades. I run this every few days at night.

~# sudo apt update
~# sudo apt dist-upgrade 

Tweaking

Ubuntu looks great out of the box, but we can make it personalized. Gnome Tweak Tool is a great tool that can help you customize the shell to your desire.

~# sudo apt install gnome-tweak-tool

Appearance

I lost apatite for the aging Ambiance GTK theme long time ago. Thankfully Ubuntu guys are developing a new theme named Communitheme which is a flat GTK theme with dark headers. Lets install that first.

~# sudo add-apt-repository ppa:communitheme/pp
~# sudo apt update
~# sudo apt install ubuntu-communitheme-session

Using the Unity Tweak Tool set the Applications to Communitheme. For a long time I have used the Numix Circle Icon Theme but since Saru comes with Comminitheme I am going to give it a chance. Here are a list of icon themes I find interesting.

Install 3rd Party Codecs

I normally do this when installing the OS because there is no point keeping it for later. We are going to at some point play media. These packages come in the ubuntu-restricted-extras

~# sudo apt install ubuntu-restricted-extras

Night Light

Blue light in the night can interrupt with your sleep. Ubuntu 18.04 comes inbuilt with a night light plugin. You can setup a schedule for it to automatically turn on. I have done it from 10 PM to 6 AM.

Go to Settings > Devices > Night Light and configure it to your interest.

WIP: TODO: Some cool gnome plugins and Ubuntu Software

Field Selection Advanced Level

Following the Sri Lankan OL (Ordinary Level) exam few family friends asked me for my opinion on what they should do for AL. Some say do what your hearts desire. Some say do Math and be an Engineer or do Biology and be a Doctor. Then there are Commerce and Arts fields as well.

In my opinion you should do field selection based on market demands and your capabilities. As per future global job trends, I would recommend choosing a science stream field and get higher education (at minimum a BSc, preferably a MSc or PhD). It will be working solution and your life will be comfortable.

This doesn’t mean you shouldn’t do what you love to do. If you do, you will face challenges more challenging than doing a degree in Science stream. But you will be living your dream. That is a luxury not many have.

The choice is yours. Life will be a bitch, always. Live your life, wish you best of luck.

Hard to Find Monitor Arms in Sri Lanka

A monitor is a tool, but an incorrectly placed monitor can be a pain in the neck, quite literally. On doctors advice I started looking for a monitor-arm to place the monitor to reduce strain on the neck and eyes.

I started a search online. Except for some forum posts, I didn’t find any dealer selling monitor arms. Then I started calling one by one. After going through most of the major dealers I am exhausted and am thinking of giving up the search with no success.

Then I tried eBay and Amazon. There were many good models to choose from. Here are some that I liked.

The Nested Loop Nightmare

Bad code holds a strong position in the list of things I hate. Ruby is a beautiful language which you can write efficient, readable and beautiful code. But some developers are so talented cooks, they make ruby-spaghetti. But yesterday I was knee deep in some bad code.

I opened a huge module that had over 1000 lines of code that handled the import/update of resources using 4 remote services. I was like “hmm… this guy needs OOP lessons”. When I looked in to a method that handled one resource I noticed it was 200+ lines with no comments and cryptic code. It had 5 loops in 3 levels…

a.each_with_index do |b, i|
  b.each_with_index do |c, i|
    e.select { }
    f.each { }
    g.each { }
  end
end

I am a strong advocate of style guides. I also believe logic shouldn’t be nested. This was way too much for my busy brain to process.

The only thing the method was doing is iterating through scraper data, assigning values to objects. Given that I didn’t understand the code I decided to rewrite it. I ended up with 1 class, 2 modules (helpers) which replaced the method with less number of lines of code. It only needed 2 loops but I could have just settled with one.

This was a “99.9% done, quick small fix” according to a client. Surprised at how readable the code was, he asked if I could polish up the other importers as well but it was a busy week so I kept it for later.

Having a chitchat, I asked Peter, a British, about the project. He said that he took a chance with the Myanmarese team following recommendation of an employee. “They had over 30 very nice looking portfolio”. The project had taken 1 year and 2 months. They had quoted him US $ 2500 but later citing changes they had charged him an extra US $ 2500. “Every time they fix 1 issue, they make at least 2 new ones”.

Its sad that people get ripped off by incompetent developers. That is one risk of hiring through the Internet without knowing much about the industry. That is why I recommend users hire through a service like UpWork where you get to see a developers history and ratings and also mediation if necessary.