Today’s hack is Mac specific. We look into solving a big data problem: email search. More specifically, we will use Mac’s Mailsteward application to download and archive emails from different accounts.

Archiving emails is a good strategy, you never know when you would need an specific email. Mailsteward allows to archive emails into a MySQL database, so you can perform complex queries from multiple accounts at the same time.

To get started, you need to make sure to have MySQL server installed in your Mac. Then, go to Mailsteward and download a trial version (upgrade when you need to) to test it out. In our case, we went with a trial version of Mailsteward Pro. The way it works is that Mailsteward will work with Apple Mail and archive your emails into a database independently of Apple Mail, without removing them from Apple Mail. The database will be hosted locally, but you can set a remote database server if you wish so.

After installing Mailsteward, you can take a look at the MySQL tables

MS_1

Next, we will connect Mailsteward with Apple Mail, so Mailsteward will be pulling emails from Apple Mail connected accounts

MS_2

Start archiving process:

MS_3

MS_4

Once we are done, it will tell you how many emails got archived from all your accounts. You can allow for duplicate emails or disable duplicates.

MS_5

Now you have an email database, everything indexed and organized:

MS_6

You can then perform complex search queries in your entire email database:

MS_7

Finally, you can schedule automatic email archiving as follows:

MS_8

And voila! Your own email database ready for big data queries.

In today’s Friday Hack, we take a look at passwords. Where are you currently storing your passwords? In a Google Drive File? In a Word Document? In a piece of paper? Well, it turns out that the best way to secure your password is to implement a Password Manager.

Why use a Password Manager? In theory, you should have different passwords for different services. This means that your Facebook password should be different from your gmail password. Your twitter password should be different from your Instagram password. Additionally, it is highly recommended that you use a combination of lower case letter + upper case letters + number + a special character. And, that you do not use common words, but rather a hash-like password such as 2986b7f0cd0ba9827ace0810c8818825. The longer and more complicated your password is, the more secure and harder to crack it becomes.

So, here is where Password Managers come in handy. They allow you to create your own database of passwords. Note that there are cloud-based services that can manage your passwords online, but if such company ever gets hacked, so get your passwords.

In this session, we will look at implementing a DB of passwords, where you manually organize your passwords, and that is completely disconnected from everything. There exists a common file format for the DB, and it is supported by many different Password Managers, the “.kdb” extension.

We started using KeePassX for Linux. Here is a how it works after downloading the application:

Create a master password: DB1

Create or Select a Database. In this case, we have a dummy Database named “passdb1”

DB2

Manually Create a tree-structure to organize your passwords. You can add, edit, or remove a key.

DB3

Add your username and password, and other relevant information

DB4

Save it. And that’s it! Now, every time you look for a password, open the KeePassX application, supply the master password, then look for the password you need.

In the future, we will look into backing up this database of passwords.

Today’s Friday Hack is about Security. Yes. With the increasing amount of concern over privacy and security over the internet, more and more people are starting to use a Virtual Private Network or VPN. VPNs offer a lot of interesting features such as privacy, encrypting your information, changing your IP, among other things.

The following video explains the advantages and disadvantages of the top 3 paid VPN services: Private Internet Access vs NordVPN vs ExpressVPN

Given that today is “Black Friday”, some of these companies have very interesting promo codes, so we decided to give NordVPN a try since it is offering a very good deal. The service is not free, but your security and your privacy comes at a cost these days. If you do not want to pay for a VPN, and you are ok with letting your Internet Service Provider (ISP) and Google know everything about you, then it is up to you.

We should start moving towards being more concerned about our privacy and security. So, we configured NordVPN for both Ubuntu and Android. If you are interested, the Ubuntu installation tutorial is found here, and the Android installation tutorial is here

In today’s hack, we explored sending SMS notifications using the Twilio API. This project was in conjunction with the 2016 MCIN internal hackathon.

The context in mind was to notify LORIS users when their study gets inserted into their database.

Phone

Source: github.com/paiva/loris-twilio

In the spirit of improving our development sandbox, we set out to look for a better gnome terminal experience. We started out with this boring bash shell terminal:

Old Terminal

The end result looks as follows:

New Terminal

This new shell provides you with a more flamboyant experience by integrating Tmuxinator with Oh-My-Fish

Tmuxinator

Fist step install Tmuxinator

gem install tmuxinator

Then, depending on your default editor, you will have to specify

export EDITOR='vim'

Create new project with

tmuxinator new [project]

where [project] is the given name to your Tmuxinator project.

Start a session with

mux [project]

Look at the sample ~/.tmuxinator/project.yml file to give you an idea of what you can do in different ‘windows’. In our case, we are creating 3 windows, one for personal development, one for work, and one for the localhost server. You can get creative. For example, you could auto start 3 windows and launch Vagrant. Since my default shell is still bash, we specify in the panes option to start the fish shell.

Fish & Oh-My-Fish

To install Oh-My-Fish, you need to install Fish shell v2.1.0 or above. First, let’s install Fish. Fish stands for Friendly Interactive Shell. Go to fishshell.com and select your OS. For us, it is Ubuntu, so we downloaded the .tar.gz file, then

	tar -xzf fish_2.2.0.orig.tar.gz
	cd fish-2.2.0

Apply the Autotools Build

	autoconf
	./configure
	make
	sudo make install

If everything worked, you should be able to start your fish shell on your terminal with $ fish command, you will see that the shell looks different. To go back to bash, simply type ~> bash. Fish has very interesting features such as autocompletion. That is time saved and you reduce then number of keystrokes.

Next we want to install the Oh-My-Fish framework for managing the Fish configuration

curl -L https://github.com/oh-my-fish/oh-my-fish/raw/master/bin/install | fish

To play with the style and colouring, you need to install a theme. You can browse themes here. In our case, we went ahead with the theme bobthefish

omf install bobthefish

This theme is powerful for Git as they use the Powerline to show lots of relevant information to you once you are working in a Git repository.

The final step is to install Powerline and a font. This part is very tricky and we would recommend to read the official documentation on how to do it:

http://powerline.readthedocs.org/en/master/installation/linux.html http://powerline.readthedocs.org/en/master/usage/shell-prompts.html#fish-prompt

More documentation available at:

https://github.com/tmuxinator/tmuxinator https://github.com/oh-my-fish/oh-my-fish