Thursday, February 16, 2017

How I was hacked and lost my 2017 freelance earnings

This was really painful, I was hacked and my freelance 2017 earnings were stolen away! I will share my experience and how to protect yourself from potential hacking attacks.

I work as freelancer and used Payoneer to collect my earnings. On the 14/02/2017 (coincidentally, on Valentine's day of 2017) a supposed potential client contacted me with a project request and sent me an MS document file supposedly to contain more detailed description about the project. But unfortunately, the client was a fake and he was just a hacker looking to collect innocent peoples password to there online bank accounts.

The MS document file he sent to me actually contains some VB macro scripts that runs in the background of a PC to extract/grab login credentials saved on the web browser.

Few hours after I opened the file, I got notification that my funds were been transferred out of my account  an unknown email account tied to payoneer and that was how it all happened.

Honestly it sucks to see a potential client turning out to be a hacker. See (image above) the message he sent to me and I was looking up to working with a legitimate buyer, but unfortunately I was wrong.

The hacker transferred or stole my funds to this payoneer email account at:

I know my God will never allow him go free! I have reported this issue already to my God and other relevant authorities.

How to protect yourself from potential hacking attacks

1- Never save important logins details on your web browser, even if you are working from your personal computer. Device a way of saving/remembering your passwords that no script can read remotely.

2- Never trust any MS doc file that contains VB macros. If you most open such file make sure you are not connected to the internet or at least use a different trash PC to open it.

3- Always use anti virus to scan files you received (especially from first time clients) and change your login credentials regularly.

I hope this safes someone out there from being the next victim.
Stay safe!

Wednesday, February 1, 2017

Essential tools or Websites to help you understand, test and generate regular expressions

Hello there,

Recently, I was working on a project that requires me to search through bunch of text and identify some matched patterns within the text, this is what "regex" is good at. So I thought of finding a tool that will ease my way through the project and fortunately, there are many of such tools on the internet.

I wrote this post just to highlight and share with you some of the regex tools I have tested. Just in case you didn't know what regex is here is a quick intro....

RegEx written in full as "Regular Expression" is a pattern that consist of rules used to match a certain set of strings. Regular Expressions are an essential part of any programmer’s toolkit. They can be very handy when you need to identify, replace or modify text, words, patterns or characters.

RegEx is a concept that is found in any programming language. The syntax of regular expressions is the same for all programming and script languages.
Below, you will find tools that are primarily associated with a programming language while others are generic to all languages.

Here is the list:-


Useful Tutorials:

1- What are the best resources for learning RegEx?
2- Essential Guide To Regular Expressions: Tools and Tutorials
3- Regular Expressions: 30 Useful Tools and Resources

Thanks for reading

Saturday, January 28, 2017

Understanding the system of land measurements in Nigeria

Let's talk about how plots of land are measured in Nigeria.

Just like in other parts of the world, in Nigeria landed properties  are either measured in Hectares, Acres, Meters or Feet. The value of these measurements are affected by  human and environmental factors.

For example 1-Hectare (1ha) of land in the heart of the federal capital Abuja will not be of the same value as 1-Hectare (1ha) of land located in the heart of any states capital.

Generally speaking, Systems of measurement in modern use include the metric system, the imperial system, and United States customary units.

Nigeria is among the countries which have officially adopted the metric system.

Metric system adoption map (In Green - Countries which have officially adopted the metric system)

That not withstanding, many Nigerians tend to utilize other system of measurements when referring to the size of land or parcels.

A hectare (ha) is a metric unit of square measure, equal to 100 ares (2.471 acres or 10,000 square metres).

The acre (acre) is a unit of land area used in the imperial and US customary systems. It is defined as the area of 1 chain by 1 furlong (66 by 660 feet), which is exactly equal to 1⁄640 of a square mile, 43,560 square feet, approximately 4,047 m2, or about 40% of a hectare.

The metre (m) is a unit of length in the metric system, and is the base unit of length in the International System of Units (SI).

The feet "foot - singular" (ft) is a unit of length in the imperial and US customary systems of measurement. Since 1959, both units have been defined by international agreement as equivalent to 0.3048 meters exactly.

From above explanation, we can that there are two metric (ha and m) and tow imperial (arce and ft) systems of land measurement commonly used in Nigeria.

What Is The Size Of A Standard Plot Of Land In Nigeria?

The size vary from state to state. But generally, the size will likely be measured in feet as 50x50ft, 50x100ft or 100x100ft.

In relation to Nigeria landed property measurements, the above definitions means a plot can be and of these size:-

1) 50 x 100ft / 15.2 x 30.5m - 463.6sqm (which means there are 8.7 plots of land measuring 463.6sqm in an acre)

2) 60 x 120ft / 18.3 x 36.6m - 669.8sqm (which means there are 6 plots of land measuring 669.8sqm in an acre)

3) 100 x 100ft / 30.5 x 30.5m 930.25sqm (which means there are 4.3 plots of land measuring 930.25sqm in an acre)

Thanks for reading.

Sunday, January 22, 2017

Combining multiple tabular data files together (excel, csv, html)


If you work with any of these files "excel, csv, or html" regularly, you have probably encounter a situation where you have data in same file type say excel for instance and you needed to merge or combine those data from multiple excel files into a one big master file.

The traditional approach to such task is to open up all the files and then copy and paste their contents into the master file. This approach isn't efficient as it is slow and prone to errors.

Lets use the tools in python programming that is much more powerful than the manual copying and pasting most people do in excel.

Thursday, January 19, 2017

Add Multiple map images into one PDF file per page

Bulk images to pdf Tutorial

In this post I will show you how to create an atlas like of Nigeria LGA maps. Let me explain better by using the map of Abuja as an example.

This is a simple script procedure to collect images from a folder and add into a pdf file with each per page.

Abuja (FCT) has six municipal area councils that is the equivalent of LGA for other states. Now I want to create a pdf file to contain or display the map of Abuja and the six municipal area councils with each map on a new page.

This task could be done manually, but since I intend to do the same for all the states, that is about 700+ maps for the whole LGAs. The process become tedious to accomplished, so I use python pdf package (called reportlab) to automate the process as follow.

The maps above are to be added to a single pdf file with each map on a new page. I use python glob module to read in the map images, use for loop to iterate the files and used python reportlab module to generate the pdf file.

The final code is as seen below:-

Note: the above script was written and tested on Python 2. You will need to modify some lines to run/use it with Python 3.

The resulting pdf and other files used for the script are here.

That is it!

Wednesday, January 11, 2017

GIS programming in "pure Python" Vs "GIS-software"

Hello there,
Thank you for stopping by to read about "Python GIS programming" on my blog!

Basically, Python GIS programming is either done in "pure Python" or "GIS-software". By saying "pure Python" I mean using python GIS modules/packages such as the once listed below. And by saying "GIS-software", I am referring to software that supports python GIS scripting such as ArcGIS - ArcPy, QGIS - PyQGIS, etc.

List of python GIS modules/packages:

  • GDAL –> Fundamental package for processing vector and raster data formats (many modules below depend on this). Used for raster processing.
  • Geopandas –> Working with geospatial data in Python made easier, combines the capabilities of pandas and shapely.
  • Shapely –> Python package for manipulation and analysis of planar geometric objects (based on widely deployed GEOS).
  • Fiona –> Reading and writing spatial data (alternative for geopandas).
  • Pyproj –> Performs cartographic transformations and geodetic computations (based on PROJ.4).
  • Pysal –> Library of spatial analysis functions written in Python.
  • Geopy –> Geocoding library: coordinates to address <-> address to coordinates.
  • GeoViews –> Interactive Maps for the web.
  • Networkx –> Network analysis and routing in Python (e.g. Dijkstra and A* -algorithms), see this post.
  • Cartopy –> Make drawing maps for data analysis and visualization as easy as possible.
  • Scipy.spatial –> Spatial algorithms and data structures.
  • Rtree –> Spatial indexing for Python for quick spatial lookups.
  • Rasterio –> Clean and fast and geospatial raster I/O for Python.
  • RSGISLib –> Remote Sensing and GIS Software Library for Python.

Tuesday, January 10, 2017

Wiki Map of Nigeria

This wiki map allows you to learn more about Nigeria states by clicking on the map you will be taken to Wikipedia page for that state. You will learn more on the wiki page!

Feel free to click and explore any of the states.

Happy viewing

Wednesday, January 4, 2017

How to make Maps of Nigeria - Country, States, LGA, and Towns

I often come across this question on how to make a customized Map of Nigeria that shows the Country boundary, the States boundaries, the Local Government Area (LGA) boundaries, and Towns or Cities around the country?

To demonstrate what am referring to, below is an example of a customized map of Nigeria, map of Nasarawa state, Nasarawa state LGAs and some towns within the state:-

Sunday, December 25, 2016

Nairaland Christmas Birthday Analyzed and Visualized in Python

Members of forum that celebrates their birthday on Christmas dayHappy Birthday Christmas to this Nairaland forum members

Which member of forum is celebrating his/her birthdays today? Let's derive some insights from the Birthday dataset.

Friday, December 23, 2016

6 Python web scraping libraries you can't afford to ignore

Hello there,
In this post I will share with you some excellent Python Web Scraping Libraries. For the benefit of the reader who doesn't know what web scrapping is, here is quick introduction.

Web Scraping: is a technique employed to extract large amounts of data from websites whereby the data is extracted and saved to a local file in your computer or to a database in table (spreadsheet) format (source, Web Scraping is also called Screen Scraping, Web Data Extraction, Web Harvesting etc.

Different programming languages have different techniques for doing web data scrapping. Here I will present to you some web data scrapping tools as used in the Python programming languages.