# Project management - FabAc 2021

FabAc 2021

Mauro Herrero-FabLabLeon-URJC

2. Project management

This week there is a lot to take. Not only plan and sketch a possible final project, but also experiment and get used to some tools that we will need along the way. So let's dive into it!

Tasks for the week

Tools of the trade

Linux, Terminal, Bash, GNU nano, Vim, Git, Markdown, MkDocs, Material... and the list goes on forever and fast, as any of Neil's lectures. My first thought was to stay on the safe side: do not take unnecesary risks. But then... what fun would my Fab Academy semester be?

So, let's get hands down to the task, and let's document as you go, even though for me sounds more like, play it by ear, when you don't even know how to play.

Gitlab and Git

Ok, it is true. This Git section was not documented on the fly. But I had to set up Git and clone the repo before being able to edit it locally. Yes, I know I could have document as I went, editing this file directly in GitLab. But, to be honest, I did not realize until a few hours later how much better is to really document as you go than taking notes and writing later.

Since I am working in Xubuntu, Git is already installed in the system. Besides this computer (air), I might use another two: the workstation that is in the basement (earth), and the laptop that URJC provided me with this year (dell). Those two computers run on Windows 10, so I installed the Windows Subsystem for Linux (WSL). Something really useful is the command explorer.exe which opens an explorer window with the current WSL directory. The Linux filesystem appears as a network connection, as if it is a different machine.

Ssh key for GitLab

I followed last year recitation instructions to add the ssh key in GitLab. Thanks, Kris & Viktor The procces was quite straightforward, and did it without errors. I generated two different keys, one for air and the other for dell; earth will have to wait.

Getting Git to work

So drumroll, please, it's time to clone the repo: from my home directory, I type git clone and paste the address provided in GitLab. Once it is done downloading files, I ran git status.

And now, after some editing today, it is time for my first real commit. So first, lets get the order right, following our local instructors guidence:

  1. ncdu - to check local repo size and avoid messing up
  2. git status - to check we are adding and commiting only wanted changes
  3. git add . - to add the changes - use with caution, will add all files
  4. git status - to confirm that changes were added
  5. git commit -m 'descriptionOfTheChange' - to confirm the changes
  6. git push -u origin master - to make the changes effective and finally update the repository online

Of those commands, for now I don't understand the difference between git push -u origin master, and a plain git push. I guess in the first option you are telleing git where (host) and in which branch push the commits made.

This is a great cheat sheet to have around.

Next day, morning exercise and git mantra:git pull, git status... and, a surprise: Yesterday, as I was really trying hard to document as I was going, I started the Git routine with this very file still open in nano, and I accidentally added and commited a temporary file that later dissapeard. So as I ran git status this mornig, I got this:

I guess there is a way to prevent this for happening, using git ignore, so I'll add an item in my to do list. For now, I will close all files before running the mighty git add . command.

Tutorial on Git

I went through the tutorial linked under the class archive site: tutorial. In my first try, I had a bit of trouble when merging the two branches, because of conflict in modified files. I did not figure out what was excactly going on, so I started over, and when I modified file1 in both branches, I made sure that differences ocurred in different lines. This time, it worked as expected:

I liked the final statement of this section of the tutorial: Branches are chea and easy, so this is a good way to try something out. I will keep this in mind when the time to move to raw html comes.

I read throgh the Using Git for colaboration section, but did not type the commands. I will have to go over it again whenever I have to collaborate in any repository.

One command that for now I liked was gitk --since="2 weeks ago" (obviously stating whatever time lapse you want, to visualize graphicly the history of commits. I used this info to read the colour circles:

You will make mistakes

Neil dixit. And indeed I made them. Thankfully, the crime I commited was that I pushed without commiting* first (apologies, it was an easy pun), so hopefully it was fixed in the next git mantra iteration.

Text Editor: GNU nano

I have just started editing this markdown file directly using GNU nano, and since it is about experimenting, I will continue for a while. Until now I had used nano just a handful of times, mostly in the last week, while setting up a mid 2011 mac book air with Xubuntu to be my workhorse during the semester. Every time the editor opened, it felt quite awkward: I kept all the time trying unsuccessfully to use the mouse to select text, copy and paste stuff around. But yesterday I picked up one comment from Neil, explaining why he would rather use Vim over more modern desktop oriented text editors: in Vim, he could perform almost with his hands 99% on the keyboard, not the mouse. Ever since, I've learning to navigate the text, edit, copy and paste using keyboard entries. Hopefully I'll get faster with some practice.

Along the way, I found a way to enable/disable trackpad from the console, running xinput: first listing the devices, and then acting on them (xinput -list; xinput -disable 11; xinput -enable 11). It is quite useful, so the pointer does not accidentally move around the screen. Probably, there are better ways to achieve the same result, but for now, I am happy with this.

The nice surprise with nano came when I opened this very file, week2.md, and voila, Markdown was recognized and highlighted. Just after inserting the picture, I noticed it was noti Markdown highlighting, so I did a quick search, and used sudo nano /usr/share/nano/markdown.nanorc. Then, pasted the following content: markdown.nanorc by Scopatz.

This is the first time that I am using Markdown, and was really looking forward to test it. So far, so good. So next, I will instal MkDocs, to be able to tinker arond before commiting and pushing the repo.

Overall, using nano for editing Markdown files has been a possitive expirence.

What did I like:

What I disliked:

MkDocs

Before deciding how I would like my site to be, I will stick to MkDocs for a couple of weeks, just to test something I've never used before. I have basic knoledge of html and css, but it is probably outdated.

To install MkDocs locally in Xubuntu, I typed in a terminal sudo apt install mkdocs. Yeap, it was that easy... I just followed this instructions

After that, I started the built-in dev-server, by running mkdocs serve command. It needs to be done from the same directory as the mkdocs.yml file. After that, opening up http://127.0.0.1:8000/ in the browser will shoe the default home page.

I also needed to install the material theme, using pip3 install mkdocs-material (Tried to use pip instead of pip3, as described )here, but couldn't make pip - Python 2 based - work in my system. It was also needed this plugin.

I am starting to like typing directly on the terminal. Definetly one of my favorites lines so far is sudo find / - name "theNameYouWant". I ran it as sudo since it does not show so many "Permission Denied" warnings. As usual, sure there are better ways to achieve this, but didn't find any.

Final thoughts: after just two days using Markdown here are what I found as pros and cons:

I also edited the mkdocs.yml file, changing some colours and fonts, and dropping the table of contents. It just felt too much text. I will probably stick with it for another week, and try to tweek it a little, just to customize it a little.

Additional CSS

On the material site there is little guidance about how to override CSS default setings, almost no mention to classes or id's, so I will play for a couple of pommodoros trial and error, to see if I can get more or less where I want. The help info is here.

Overall, I like the grey color availible, but this are the things I changed: