Author Archives: daniel.kreling

Mount HFS+ as R/W without a MacOS

If you created a usb flash drive using MacOS, chances are you might have an HFS+ (journaled) file system device in your hands.

NOTE: If you do have a Mac sitting around, try this before.

In case you do not have access to a Mac, you may have to tweak a little to get your device working normally.

When you try to use your usb stick in Linux, you will have it mounted as a Read Only file system.

/dev/sdb3 on /media/dbkreling/dbkusb type hfsplus (ro,nosuid,nodev,uhelper=udisks2)

A filesystem check (fsck) did not work for me:

$ sudo fsck /dev/sdb3
fsck from util-linux 2.20.1
fsck: fsck.hfsplus: not found
fsck: error 2 while executing fsck.hfsplus for /dev/sdb3

Let’s install it then. The name of the package is hfsprogs:

$ sudo apt-get install hfsprogs

Preparing to unpack .../hfsprogs_332.25-11_amd64.deb ...
Unpacking hfsprogs (332.25-11) ...
Processing triggers for man-db ( ...
Setting up hfsprogs (332.25-11) ...

Now let’s try fsck again:

$ sudo fsck -f /dev/sdb3
fsck from util-linux 2.20.1
** /dev/sdb3
** Checking HFS Plus volume.
** Checking Extents Overflow file.
** Checking Catalog file.
** Checking Catalog hierarchy.
** Checking Extended Attributes file.
** Checking volume bitmap.
** Checking volume information.
** The volume dbkusb appears to be OK.

Nice! Making progress… Then create a mounting point for it, other than the default one (without this step, I could not make it work, so make sure you do it):

$ mkdir /mnt/usb

Make sure the flash drive is unmounted and remount it at the new mount point, forcing r/w mode:

$ sudo umount /dev/sdb3
$ sudo mount -t hfsplus -o force,rw /dev/sdb3 /mnt/usb/
$ mount
/dev/sdb3 on /mnt/usb type hfsplus (rw,force)




Git remove remote branch from repo via CLI

Quick shot: To remove a remote branch on your git repo:

git push [remote-name] --delete [branch-name]


dkreling@dkreling:~/RobotFramework|devel ✔ ⟫ git branch -r

dkreling@dkreling:~/RobotFramework|devel ✔ ⟫ git push origin --delete teste [8:46:33]
remote: Updating references: 100% (1/1)
To ssh://dkreling@:/RobotFramework.git
 - [deleted] test


Setting up mLab addon on Heroku

If you live outside the US or Europe, chances are you cannot provision some addons to your Heroku application. If you try to create one using the heroku config comand, you end up getting:

$ heroku addons:create mongolab:sandbox
Creating mongolab:sandbox on ⬢ radiant-stream-99649… !
▸ Please verify your account to install this add-on plan (please enter a credit card) For more information, see Verify now at

The default heroku command: $ heroku addons:create mongolab:sandbox does not work.

If you try to add it from the web interface, same thing:

Screen Shot 2017-11-14 at 7.51.10 AM11-14-17

Although mLab MongoDB is a free add on, it is not possible to provision it without providing a credit card number

Even so, it is still possible to add the mLabs addon to your application on Heroku. You can do it via your mLabs account:

1) Head over to and create an account or log in;

2) In the Home screen, click “Create new”:


2.1) Select ‘Sandbox (Free)’:


2.2) Pick a region;
2.3) Give your DB a name;
2.4) Submit your order (should be $0.00)

Your DataBase should be created. Then go ahead and..

3) Click on your just-created DB;

4) Create a user:


5) After it has been created, use the information mLab gave you to fill out the MONGODB_URI variable line displayed above, replacing <dbuser> and <dbpassword>.


6) Set it up as a Heroku environment variable from your terminal :

You should then configure the environment variable by hand with:

$ heroku config:set [MONGODB_URI-provided-by-mLab]

in my case:

$ keroku config:set mongodb://mlabs_guest:<dbpassword>

This image shows how I set mine up for another project:


That should be it: now your MONGODB_URI is set and configured, and you can now connect it to heroku.

Good luck with your project,


Selecting remote repository on git

I recently started to work with two remote repositories on git, and then faced a probably common scenario: check the state of each repository (say ‘origin‘ and ‘vertiv‘).

A 20 minute search provided me the best solution:

$ git branch -u [remote-repo]/[branch]

For example:


In this case, origin/master is ahead of vertiv/master by 2 commits, and my local is sync’ed with vertiv/master.

The docs read:

-u <upstream>, –set-upstream-to=<upstream>
Set up <branchname>’s tracking information so <upstream> is considered <branchname>’s upstream branch. If no <branchname> is
specified, then it defaults to the current branch.



Git: two awesome quick commands

Find branches the commit is on

git branch --contains <commit #>

Sample output:

Screen Shot 2017-10-17 at 10.18.41 PM10-17-17

fetch_weather, implement_axios and master all have the commit # 3dea5b6


Show all branches with unmerged commits to <branch>

git branch -a --no-merged <branch>

Sample output:

Screen Shot 2017-10-17 at 10.22.39 PM10-17-17

remotes/origin/error_handler has not yet been merged into master


Happy git work!