Why are Mauritians so concerned about Nandanee Soornack?

Mauritians are bored. They love drama. I guess that’s why the media gives them dramas to keep their minds busy after pretending to be busy in 9-6 jobs.

Mauritian Media quoting Nandanee Sournack

Current politicians are abusing power. They are buying BMWs worth more than Rs 20 million rupees each. And our attentions are diverted to some ex-government agents who allegedly abused power. I don’t care anymore! Let’s stop the current ones from blowing our money and selling our beautiful country.

When the opposing party will take power in the next election, we’d reading articles about how the current government didn’t do its job and was corrupt. WTH?

When are we going to focus on TODAY, the day which needs fixing?

Why I read magazines backwards

I ain’t no bookworm. I got very short attention span like most facebookers and tweeps.

Magazines usually start with editorials and their front featured articles. That’s too much to digest at once.

One paragraph articles or short comics at the end are very easy fast and easy to read. As I move towards the front page, the articles get a little bit longer and deeper. My mind is in a more curious and grasping mode for that effect.

And some people thought I’m a fanatic! xP

Analysing Car Market Trends using Big Data Tools in Mauritius

Who hasn’t heard of Big Data in the 21th century? Big Data in itself isn’t much of a great deal as knowing how to extract useful information from the data. It is the analytics part which is the killer feature of Big Data. It comprises of both science and art!

source: www.fudzilla.com

The first step of Big Data solutions is to gather data. There are lots of ways in which you can achieve this. Manual Data Entry can still be done but you’ll require quite an army of minions for that. But I was not “evil” enough to convince the minions to work for me. So I had to find other ways: Facebook Graph API allows you to get feeds from your wall, car groups you’re in.

{
      “message”: “Renault Scenic
Rs138,000 – Vacoas, Plaines Wilhems, Mauritius

For sale Renault Scenic Year 2005,STEPTRONIC gearbox,fully executive,1500 cc Petrol,never accidented,comes with digital dashboard,armrest,electric mirrors,alloy wheels and panoramic sunroof”,
      “updated_time”: “2017-04-16T05:57:29+0000”,
      “id”: 14851777

},

Good news is that the data is in JSON format. Bad news is that the message field contains unstructured data. We have to extract the informations we want from it. I use Collectiva Beta service (from nayarweb.com) for data processing.

Collectiva Beta

Let’s extract the Make, Model, Price, Location and Year from the data. I use grok patterns on the message field.

Make and Model: ^%{NOTSPACE:make} %{NOTSPACE:model}

Year: (y(ea)*r|an(n*e*))\s*\:*\s*(?<year;int>[0-9]+) // works with an 96, year 2003, yr : 14, anne 2000

Price & Location: (((Rs|\$|£|₹)(?<price_string>([0-9,])*))|FREE)( – %{GREEDYDATA:location_string})?

Now we can just throw data at it. Some will get properly parsed, some not. But with enough data, you can still get some pretty graphs. In the future, hopefully I get an AI do the extracting for me.

Let’s get to the pretty parts now: graphs.

Which car makes are the most sold in Mauritius?

Easy: A Bar Chart

How many models are within each make?

No need to have another graph. We just split the split bars for models. Voila!

How much do the car models depreciate in Mauritius?

Notice that it is graphing the 50th percentile which is also known as median. Means are kinda useless because a single outlier can cause the graphs to be very skewed by a lot. We can show the 10th, 50th, 90th percentile on the same graph so that you can compare whether the car you’re buying falls between the accepted market price. Let’s say you want a Volkswagen Polo

You can see the same lines above are not split into 3 lines. I don’t have much variation here because I’ve been collecting data for only 4 days. The lines are supposed to smoothen over time and the accuracy will increase.

Wanna see the Big Picture? Welcome the Pi Chart

In this graph, I aggregated the data into Make, Model, Year and Price. All in 1 graph. It’s like magic nah?

Want to get into Big Data World?

If you have big databases sitting around, like for supermarket, warehouse, manufacturing and agriculture, or you run an SME or NGO and would like to benefit from the insights of Big Data tools feel free to contact me for a quotation.

Detecting Brute Force Attacks on Linux using Graylog/Elasticsearch

I noticed one of my servers is sending more logs than the other. `sshd` was the application sending the most amount of logs in the last 24 hours.

The logs look like these:

pam_unix(sshd:auth): authentication failure; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.52 user=root

Failed password for root from 116.31.116.52 port 14281 ssh2

message repeated 2 times: [ Failed password for root from 116.31.116.52 port 14281 ssh2]

Received disconnect from 116.31.116.52 port 14281:11: [preauth]

Disconnected from 116.31.116.52 port 14281 [preauth]

PAM 2 more authentication failures; logname= uid=0 euid=0 tty=ssh ruser= rhost=116.31.116.52 user=root

Since the IPs are being logged, I can know from where these are coming. Let’s generate a map.

Well well well, 5437 occurrences from China. Gotta do something. Here’s frequency of the attacks this week.

It seems to have amplified today. Looking at the logs, we can see that the were trying different passwords for the user `root`. Lemme just disable password authentication for SSH.

$ vim /etc/ssh/sshd_config

Change the line

#PasswordAuthentication yes

to

PasswordAuthentication no

$ service ssh restart

And we can see the logs are no more appearing 😉

Do you wish to analyse your server logs too? Feel free to message me on Facebook or Twitter or LinkedIn

 

Goodbye AirAsia

Mauritian social medias are full of disapointment by the fact the AirAsia will stop it’s service in Mauritius soon.

“The suspension of the Mauritius route is a part of the company’s big plan in network restructuring aimed at improving operational efficiencies in term of aircraft utilizations”

There are rumours that this is due to pressure by some Mauritians groups

“the sudden decision could be due to peer pressure by local ethnic groups, lobbying to the authorities in Mauritius to stop the highly successful flights.” –theindependent.sg

As I am a common people, I don’t have the ability to know the real reason behind.

It’s a really sad thing that Middle class Mauritians won’t be able to afford holidays abroad as AirAsia was allowing. Is there anyone to standup for “ti-dimounes”?

Slavery still on in the Employment Rights Act of Mauritius

Stay in your job position for 8 hours. On top of that, add 1 hour more for lunch time. Makes 9 hours in the workplace already.

As the time of writing, February 2017, teleportation has not yet been invented — or at least not that common people know of. It takes around 1 hour to 3 hours to commute to our workplace. Stupid traffic jams. Cherry on the cake, Mauritian Ministers with their escorts have the guts (‘toupe monstre’) to halt other road users so they can drive in our tax-paid BMWs and on our tax-paid roads in front of us while we, uhm, watch them in their dark tinted windows. Why are they in such a hurry to travel to finally do nothing?

The 8 hour work day supposed to be like this (best case scenario):

But in reality, it’s very different:

Lot’s of people do over-times on top of the 8 hour work which further decreases their personal times and sleep. This leads to insomnia, depression.

I believe we have the rights to spend time with our children, energy to setup shop. To summarise, we need time to live!

How many for “30 hour work-week” in Mauritius?

Why it took me 13 Days to get a Mauritian Passport

You know what sucks? When you’re completing some formalities and some officials tell you that you lack a particular document and they send you home.

It happened to me when I was applying for a Mauritian Passport. The official government website says:

Day 1 (Wednesday)

Printed and filled the Passport form. Got my passport photos shot at a studio. Reached Police Station at 17:00 with all documents mentioned on the website. The officers told me the Immigration Office closes at 16:30. Go Home #1

Day 2 (Thursday)

Went at the Immigration Office again at 10:45. Officer says I do not have a proof of address document. I need to go home and fetch it. I told the officer that proof of address was not mentioned on the website. He replied the proof of address is required by the “Police” to sign the address section of the document.

But I had other plans later that day. Couldn’t afford to go home and come back again. Go Home #2

Day 3 (Friday)

Slept till late. Had to go to Friday prayers. Reached Police Station at 15:00. Brought my proof of address (CEB and Telecom bill). Made Police officer sign the proof of address section of the form. However, couldn’t submit the form to the Immigration Office because they only take applications from 09:00 – 14:30 (lunch time 12:00 – 13:00). Go Home #3

Day 4/5/6 (Saturday/Sunday/Monday)

Weekends and Public Holiday. The Immigration Offices are closed in Police Stations.

Day 7 (Tuesday)

Managed to submit the form to the Immigration office. Paid Rs 700. Got receipt with appointment on the following Monday between 14:30 – 16:00 to fetch it. They told me to come in person. Go Home #4

Day 8/9/10/11/12 (Wednesday – Sunday)

4 days waiting periods and weekends

Day 13 (Monday)

Finally the big day. Returned to work from holidays of 2 weeks. Had to take half day leave at work in the afternoon to go fetch the passport. Got the passport within 5 mins reaching the office. Go Home #5

 

Conclusion

If only the 50 million rupees website had hinted that the Police officers will be requiring a proof of address, it would have saved like a week of waiting and a half-day leave for a common citizen of Mauritius.

Emailing those guys seem not to be an options since the old “gov.mu” mail is still up on the website. Gotta call them when I the motivation to 🙁

IoT Series: Smart Light/Sensors in the Kitchen

The Idea

The idea is simple. When someone is the kitchen, the lights should be turned on. When their’s no one,obviously it should be turned off. Wouldn’t a simple $10 IR switch from eBay do the job?

WiFi Switch with Motion Sensor attached

“Would the lights turn on even during the day” my mom asked when I presented the system to her. “Of course not” I replied. It would have be counterproductive and non-environmental friendly then.

Everyone can start using cheap sensors and all but using them in such a way that actually makes sense is what’s the challenge.

How it works

When the motion sensor detects motion, it sends a signal to via MQTT to my main app server.

The server side application calculates whether the sun is above or below horizon — the sun doesn’t rise and set at the same time throughout the year. e.g. in summer, the sun can set around 1900 but in winter, around 1800. The application will calculate the exact time  on a daily basis so I won’ have to worry about this.

If the sun is below horizon, the kitchen light will turn on. Else the motion detected will just be ignored (but still be graphed for future use).

Is that the only benefit?

Having a IoT sensors and switches would allow be to get into the next phase of my work: Machine Learning or AI (Artifical Intelligence) as you wish to call it.

For instance, you might start by looking at the graphs for each light to find a pattern visually.

Right now, I do not have the ressources to send all the data in an Elasticsearch cluster then visualise it using Kibana. Another idea would be to mine the data with Google’s Tensorflow. Alone, it will take me some time to do it all.

Previous works on IoT

If you haven’t been following me previously, I made a system that whenever I reach in front of my house, my outside lights turn on automatically for 2 minutes — the time I reverse my car and enter my house. You may find the article here: Internet of Things (IoT) in Mauritius, lemme just do it!

 

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 LinkedIn, Facebook or Twitter.

[Part 1] Requirements of a Good Transportation System for Mauritius

Transportation in Mauritius is better than lots of “third world” countries. I think Mauritius deserves to be the top!

Requirements of a good Transportation System

1. Eco-friendly

Our planet first, right?

2. Time Saving

Time is money they say. Fuck money! Time is life. Why waste time to get more imaginary money? Be with your family. Work your hobbies. Make yourself happier.

3. Comfortable

We’re animals. Comfort is what we all like.

4. Cheap

We don’t need to be spending 50% of our salary to be able to go to the ever diminishing public beaches (special thanks to Mr Shawkutally Soodhun for selling our beaches like his predecessors).

5. Safe

Who wants to die or lose some body parts? Safe

Conclusion

I think all the points above can be summarised by 1 word: Stress-Free

We don’t want to to harm the planet. We don’t like being bored. We want to live our lives to the fullest. If we continue to believe in our stupid Ministers and Parliamentarians, nothing ain’t gonna change — at-least in the not favour of Mauritians.

Please do comment about your personal requirements for what you, as a Mauritian, expect our transportation system to be. Stay safe. Let’s hope 2017 is the year Mauritians talk, propose ideas and get things done 😉

 

 

Why does God “test” children?

I was scrolling Facebook when I saw this post:

(The Godless and Irreligious:)

Friendly Atheist 发布于 2016年12月13日

 

Does it make sense? I think yes. Why does God has to test small kids who don’t even know they are being tested — or at-least don’t understand the reason of it? I previously wrote an article on how to determine whether God is being nice to you or you are being tested: The 3 Arrays of Life.

Yet, people tell me there are books after which you read, you’ll stop asking question whether is God fair or why is there so much injustice in the world. Basically everything is about “absolute justice”. Maybe I should read one of the books to understand how can people think that way.

Anyways, one should not be afraid to question stuffs. Always question everything whether at work or at home. You’ll die less stupid (or more stupid according to some if your opinions differ to theirs).