Month: December 2015

  • 3 Months of Remote Work

    3 Months of Remote Work

    Three months have passed since I left the office and started working remotely (+1000 km), in this post I share the “pros and cons” of my short experience, even though across the Internet many people already covered this topic extensively.

    Whitesmith has been “remote friendly” since first day I joined, more recently the company is trying to become a “remote first” business, as described in a recent blog post. What this means is that remote workers should be treated as first class citizens and the company’s processes should assume that all employees are working remotely. This mindset gave me the possibility to move farther away for a while.

    The first thing that I’ve done was to rent a table in the nearest co-working space, because staying all 24/7 in the same house is not my thing. It was a good decision, this way is possible to meet and interact with new people from different backgrounds regularly and I have a spot where I can focus without too many distractions.

    Regarding the job related issues, the asynchronous nature of remote work is both its biggest strength and at the same time its biggest drawback. I say this because all the liberty and flexibility comes with a cost, which is the lack of a fast feedback loop and that instant discussion on the spot that settles everything down, without the need for more message round trips or checking my peer’s availability for a quick video call.

    On the social side, one aspect that I noticed (and already expected before embracing this new experience) was a small detachment of whats going on in the office. Slack is more active than ever but is not the same as the “water cooler”, plus new people are constantly joining in. Without a physical presence it is hard to get to know the newcomers.

    Even though there are these rough edges, I’m really enjoying working remotely. In 2016 I will try a few new strategies to overcome the above obstacles, such as:

    • Improve my written communication skills
    • Avoid slack for long running discussions and prefer more structured platforms
    • Organize some on-line activities/events
    • Work on small projects with the new teammates

    Lets see how it goes in the next few months.

  • Django Friday Tips: Managing Dependencies

    This one is not specific of django but it is very common during the development of any python project. Managing the contents of the requirements.txt file, that sometimes grows uncontrollably can be a mess. One of the root causes is the common work-flow of using virtualenv, install with pip all the required libraries and then do something like:

    $pip freeze > requirements.txt

    At the beginning this might work great, however soon you will need to change things and remove libraries. At this point, things start to get a little trickier, since you do not know which lines are a direct dependency of your project or if they were installed because a library you already removed needed them. This leads to some tedious work in order to maintain the dependency list clean.

    To solve this problem we might use pip-tools, which will help you declare the dependencies in a simple way and automatically generate the final requirements.txt. As it is shown in the project readme, we can declare the following requirements.in file:

    django
    requests
    pillow
    celery

    Then we generate our “official” requirements.txt with the pip-compile command, that will product the following output:

    #
    # This file is autogenerated by pip-compile
    # Make changes in requirements.in, then run this to update:
    #
    #    pip-compile requirements.in
    #
    amqp==1.4.8               # via kombu
    anyjson==0.3.3            # via kombu
    billiard==3.3.0.22        # via celery
    celery==3.1.19
    django==1.9
    kombu==3.0.30             # via celery
    pillow==3.0.0
    pytz==2015.7              # via celery
    requests==2.8.1
    

    Now you can keep track of where all those libraries came from. Need to add or remove packages? Just run pip-compile again.

  • Securing IoT Devices

    During the first couple of months of the year 2015 I’ve worked a “little” on the subject of security in the Internet of things world. Even though there is a lot of information about this topic and its crucial role on this new era of the IoT. So today I will share a small document I’ve compiled, with information about simple issues, that we should take for granted in the functionality of these devices, that I’ve found out that they aren’t always done the right way.

    This document was written in the beginning of the summer but today I’ve decided to recompile the .tex files and share here. The PDF version can be found in this link and web version for quick consultation bellow in this post.

    The document is always open to updates and improvements, so if you have any suggestions just send me an email or leave some feedback in the comment’s section.

    (more…)

  • Django friday tips: Switch the user model

    In the most recent versions of django, you’re no longer attached to the default user model. So unlike what happened some time ago, when you had two models (User and Profile) “linked” together through an one-to-one relationship, nowadays you can extend or substitute the base user model.

    It is as simples as adding the following line to your settings.py:

    AUTH_USER_MODEL = 'djangoapp.UserModel'

    If you only want to extend it and avoid having to implement some boilerplate, you should sub class the AbstractUserModel like this:

    from django.contrib.auth.models import AbstractUser
    
    
    class User(AbstractUser):
        ...
    

    This way you will be able to use all th predefined features, and even use the admin settings of the default user model by doing the following in your admin.py file:

    from django.contrib.auth.admin import UserAdmin as DefaultUserAdmin
    
    @admin.register(User)
    class UserAdmin(DefaultUserAdmin):
        ...
    

    If you are starting out I hope this information was useful.