Internet of Things (IoT) in Mauritius, lemme just do it!

iotarch

I reach home from work when it’s already dark. I got to park my car in front of my house. I said to myself wouldn’t it be awesome if I could light up the house exterior light using my mobile phone? I bought some WiFI enabled switches from the internet and installed it. Here’s a diagram of the installation.

iotarch

‘All iz well’ except for 1 problem. Nayar’s highness has stop his car, unlock his phone, launch an app, press the LIGHT ON button, then reverse his car. Nayar is not happy!!!

So I had to make a system such that whenever Nayar reaches home, the exterior lights up automatically? Makes sense right? How did I achieve this? Simple but not so simple.

img_20160923_210617.jpg

The Wireless Switch was vendor locked in; meaning it works with their cloud service and Android/iOS app. It doesn’t give me the flexibility for I need. Had to do the following steps in order to be free:

  1. Flash an Arduino firmware (from github) to the wireless switch.
  2. Create a home automation server on a raspberry pi (which I dropped in favour of cloud hosting)
  3. Create an Android app which whenever I connect to my home WiFi, I sends the TURN ON lights on

After lots of research and development, trial and error, it finally worked 😀


Is it over? Nope. Who’s gonna turn off the lights when I enter home? Ofcourse I put a 3 minutes timer in it 😛

And the Laziest Award 2016 goes to?

Coming soon. Very soon:

  • Control garage doors (R&D stage)
  • Temperature and humidity sensors (prototype stage)
  • Get status of windows/doors status: open or closed (R&D stage)
  • Home Camera Surveillance (waiting for materials)
  • Smart TVs integration (prototype stage)
  • Solar Water Tank monitoring and control inflows (R&D stage)

Wanna get into the world of Home Automation too? Wanna turn on your coffee machine from your bed and more? Feel free to contact me on Facebook or Twitter.

 

 

 

The New MCB Internet Banking Website 2016

After logging in through the usual Internet Banking link, I was asked to choose a new password after which I was in the new web interface.

mcb1

It definitely looks better than the previous interface which had a long long menu bar. It feels very light and minimalist.

mcb2

However I am still facing a hard time accessing my Prepaid Card dashboard that is still dependent on flash; meaning it can’t be used on Macs and Linux unless you have flash plugin installed.

How did you find the new internet banking portal? How is it compared to other internet banking in Mauritius like SBM or HSBC etc?

Attending Front-End Mauritius Meetup July 2016

“A reasonable coding approach to CSS and Sass”

Umar presented some of the “best practices” in the CSS universe; some of which stirred some religious debate e.g. the usage of 2 spaces vs Tabs for indentation. Yusuf, a backend PHP developer, pointed out that in the PHP community, the latter have coding standards known as PSR (PHP Standards Recommendations) which is widely accepted. CSS does not have such widely accepted standards. However attempts are being made have to formalize the standards as David mentioned. I forgot the github name of the project.

Anyways, I am of the opinion that if you are following a coding standard, try to stick to it after deciding on which standards you and your team are going to use.

Another point which I remember is to NOT use CSS #Id Selectors and it makes total sense. The reason is pretty simple to me. Good programmers write code in order to cater for most scenarios. Ids can be used only once on a page. Let’s take for example a “single post page” in a blog. You know very well that only 1 post is going to be displayed on a page

#post {
  background-color: red;
}

<body>
 <article id="post">
 </article> 
</body>

vs

.post {
  background-color: red;
}

<body>
 <article class="post" id="post-15">
 </article> 
</body>

Why you should opt for the second option is that when you have to write the front-end for search page etc, you can just use the class .post without problems as many articles can appear. But during the meetup, maybe I should be replacing the post id using -data* stuffs. Gotta read more on this.

What to remember here is, never ever use # in CSS unless working with form input as per what Sundeep said.

“Vue.js Jumpstart”

Humeira introduced us about Vue.js. I used it previously. Simply love the simplicity and the level of laziness it allows developers to have. However Vue.js is a relatively new technology and I guess it’s pretty normal for big corporations to not use it in production at the moment. As time goes by, I hope Vue.js really takes off in terms of popularity thus gaining stability.

Vue.js, to me, is awesome because it allows me to concentrate on the logic of data objects  in JavaScript and I don’t have to care about the UI views. I know it would simply update itself to reflect the state of my JavaScript object. I just love declarative type UIs.

“Le futur, c’est maintenant avec CSS4”

David explained the differences between a CSS preprocessor and CSS postprocessor. Maybe I might not have yet fully grasped the differences right now but from what I can understood, preprocessors convert .sass or .less to .css. Postprocessors take plain .css augmented with new unsupported attributes by browsers and compiles it into plain .css which are supported by most browsers. Anyways, I think this topic is too advanced for me right now.

Conclusion

13662344_1075355492543126_5851506201456332392_o
Photo stolen from David

Much more happened at the meetup but this writeup is all about what struck me personally. I’d recommend you to attend future meetups so as to be able take part in the interesting debates and be up-to-date with latest front-end techs 😉

Let Mauritian people afford new Tyres for less accidents!

Foreach Rs 2000 I earn over 21,923, Rs 300 will be deducted under the PAYE system [1]. The remaining Rs 1750,  Net Payment, which will be credited into my bank account. Should I decide to purchase let’s say 1 tyre for my car at Rs 1200 + VAT/Tax. I need to pay Rs 1380 (Rs 180 as VAT/Tax). But wait! Is that it?

img_20160420_090844.jpg

Let’s see what the the MRA website says about Tyres [2].

Screen Shot 2016-07-25 at 9.55.09 PM

What do I see there? There was already a 30% duty/custom charges on it. Meaning about Rs 277 was already Taxed upon it by Government.

In order to change 4 tyres on my car, I need to work for a whopping Rs 6494. PAYE will cut Rs 975 on my salary slip. I will pay 15% VAT for 4 tyres totaling Rs 720. 30% Duty/Custom Charges totaling Rs 1107. In reality, It would have costed only Rs 3692.

Do you find it OK to have to work for Rs 6494 to buy things which are priced at Rs 3692. And that thing happens to be primordial for road safety?

And it’s not over. I need to pay Rs 3500 yearly as Road Tax. Meaning I need to earn Rs 4117 (15% PAYE). Rs 1200 fitness for twice a year, need to work for Rs 1412. Not counting yearly insurance, levy on fuel and so on.

Hey Mr the Government. Instead of putting bullshit policies around, let the common people use their hard earned money to maintain their cars properly instead of paying you to use shitty roads. Buying new tyres is NOT a crime but rather should be encouraged for safer roads.

BTW, there is a petition to remove Custom Charges on new cars which have engines less than 1600 cc. Please sign here: https://www.change.org/p/mvda-pour-la-suppression-de-l-excise-duty-pour-les-v%C3%A9hicules-de-moins-de-1600cc

NOTE: I am not a financial expert. I am just a citizen of Mauritius browsing the internet.

[1] www.mra.mu/index.php/employers/paye

[2] http://www.mra.mu/index.php/importexport-a-others/travellers/88-customs-charges

 

 

 

Anil Bachoo vs Anil Gayan

Anil Bachoo vs Anil Gayan

One thing that stroke me in this post in this:

“I believe these people are governing from their comfortable office and cars far from the reality of our society.” – Anil Bachoo

Well Mr Anil Bachoo, you’re completely right about this. I guess you lots of experience in this field right? huh!

What did you do when National Transport Corporation was reporting “losses”? Instead of finding the root of the problem and find solutions, you just increased bus fare for “ti-dimounes” by Rs 2 for each travel while you continue to drive in your BMW with police escorts.

It’s really hard to compare whether the current government is shitter than the previous one. I don’t want this aging,money-minded fleet of politicians to tell us what to do. I’m fed up of you all MSM, MMM, PTR, PMSD et al.

More Money to Mauritian Parliamentarians.

We, the people who make the salaries and allowances of “honorable” parliamentarians, got Rs 150 increase in our salaries as “compensation” [1].

Mauritius Compensation Rs 150

When parliamentarians decide to give themselves more of our hard earned money. We, the ones who i remind make the salaries of parliamentarians, can’t do anything.

The “opposition” only puts a motion to diminish the increase of salaries of parliamentarians [2].

What we, the Mauritian people, actually want is to reduce the salaries of parliamentarians.

But no one gives a shit. We voted to replace dictatorship with ‘dictatorship’ [3]. That’s our punishment.

[1] http://www.govmu.org/English/News/Pages/Salary-Compensation-ranging-from-Rs-150-to-Rs-250-granted-to-employees.aspx

[2] http://www.lexpress.mu/article/282948/hausse-salariale-elus-presentee-ce-mardi-7-juin

[3] http://nayarweb.com/blog/2014/a-message-to-the-new-government/

Noise at Tamarin “Public” Beach in Mauritius

These guys brought their fucking electricity generator and their fucking huge speakers. Spreading high amplitude noise waves. Totally spoiled my afternoon. I was at Tamarin since around 1300 and they were already present in the kiosk.

Tamarin Kioske

After swimming, I was in such  hurry to return home. Just when I was about to start my engine, I noticed they were leaving. It was around 1820.

Finally I could get out of my car. My sister said “now we can finally hear the sea”. The atmosphere became relaxing all of a sudden. I told everybody to get down and enjoy the beach and the clear sky for sometime. Listen to their shit:


Last time at Blue Bay had a similar experience. A guy in a restaurant was singing so loud in speakers so that even in the waters you could hear the noise.

Should I have called the Police or it was their “right” to put such loud music?

Mounting Pendrives at Boot on Raspberry Pi (or Not)

Raspberry Pi with PendriveWell, I got a pendrive that I want to be automounted on my Raspberry Pi. Simple as hell. Do an $ lsblk command. Find the drive name. Mine was /dev/sda1.

I edited the /etc/fstab file to automount it at boot

/dev/sda1       /mnt/externaldrive      auto    defaults     0       0

Problem is that when the pendrive was not on the raspberry pi, the latter would refuse to boot properly. Even the WiFi or ethernet doesn’t work. Had to actually plug in my TV’s HDMI cable to view the boot error messages.

Some googling after, found this page: http://askubuntu.com/questions/14365/mount-an-external-drive-at-boot-time-only-if-it-is-plugged-in

Edited my /etc/fstab like this now. Notice the nofail option.

/dev/sda1 /mnt/externaldrive auto nofail,auto 0 0

Now I can boot with either a pendrive in or not. 😉

Think my 32GB MicroSD died on me

And I didn’t make a backup of it since quite some time. Lost quite some photos 🙁 Been using the card since like 4 years now.

lsblk shows the disk as 30.6mB

root@nayarpersonal-Satellite-L50-A:~# lsblk
NAME           MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
mmcblk0        179:0    0  30.6M  0 disk

Same result with fdisk

root@nayarpersonal-Satellite-L50-A:~# fdisk -l /dev/mmcblk0
Disk /dev/mmcblk0: 30.6 MiB, 32096256 bytes, 62688 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

I tried dd’ing the disk onto an image but the image size turned out to be 31mB which doesn’t help at all into recovery.

 

Searching on the internet, didn’t find someone who managed to fix it except for a guy who put it in oven. Weird.

Advice: always backup your datas!!!