Weekly discoveries #1
Tags: linux, react, shell, debian
Published: 2021-05-23 16:13:35

As a young and self-taught freelance web developer and designer, learning and expanding my knowledge is part of my job. Every weeks comes with its series of discoveries and lessons, which I am happy to share. Maybe they sounds like facts you have known since forever, or  maybe they are new things for you as well. If you know it already, please don't take it for granted by everybody and teach the ones who need it. 


# Debian: learning to navigate through linux
Since I was a child, I only experienced Windows and Mac Os and it is only recently that I started on Linux with a Debian system. It happened that working on Debian was the only way for me to install node.js and make React working.


## 1. Crash your computer to understand how to repair it and make it work again
So, after a few days working on a React project, something wrong happened on my computer and I got locked out of my session for ever. I tried to repair it, but as I could not find where my problem was coming from, I decided to re-install Debian, and start from scratch again. 
-> Here's some tips:
 
### Know what you have to do and where you are going
* Check the documentation beforehand, take notes and have them at hand
* Be sure to have extra usb sticks and computers around to copy non-free firmware if needed
* Using different iso can help you to experience different version of the same thing and eventually get lost (for ex: different window environment, such as KDE or LXDE), but sticking to the same version allows you to get more efficient. However, another version can help you overcoming a bug.
* Don't be afraid of losing data or hardware (save your data beforehand)

### On hardware manipulation: be clean and organized
* In general, work in a cleaned environment and set everything its own space
* Be extra careful with hard drives, not to let them fall on the floor
* Give yourself time and space. Sometimes, external help can be a good idea, but other times, a clear head and time frame is better. You will learn faster.

### Extra possibilities can save your life
* An extra QWERTY keyboard is always useful (especially if you ask for help)
* An ethernet connection can be helpful to solve problems after the install
* A handful of usb sticks, card readers, all sorts of cables
* Nice flatmates with extra computers

### Fail to learn
* If you need to repeat installation, repeat it as soon as possible, and format your drive before repeating the installation process to clean it up


## 2. Set up and fixing bugs on unknown environment
After the installation of Debian, with the LXDE window environment two problems remained. 

### Wrong Keyboard layout
After finding a tip on how set up my keyboard to French with command line:
```
$ sudo setxkbmap fr,us
```
I discovered that on right click on the bottom right-hand panel, I could had a keyboard manager where I could set up the keyboards I wanted to use, and choose a default one.

### Non-free firmware iwlwifi and WICD on LXDE
Of course, on the iso I choose from Debian with LXDE, there was not the non-free firmware that are necessary to connect to the wifi. It is a bit complicated process and maybe not the place to explain exactly how to do it here. 

The install of the firmware was quite simple, but with WICD Network Manager, I couldn't see any wifi at all. Only with a hint on a forum, I understood where the problem was and how to repair it. 

This link might help you to revert from WICD to Gnome Network Manager if you have a similar issue:
<https://help.ubuntu.com/community/WICD#Reverting_to_NetworkManager>

## 3. Learning command lines in shell Terminal
Well, using command lines before was completely out of my mind. Maybe, as I started to use git bash to commit my designs and gulp to compile my files, I grew more familiar with basic commands such as moving from one folder to the other. However, it is really by working with Debian that I managed to understand how to accomplish actions in that way. 

**Some of them are:**
* login in as root: `$ su` OR `$ sudo su`
* give sudo rights to user: `$ sudo adduser <username> sudo`
* copy / paste in Terminal: use mouse right click (CTRL + C and CTRL + V don't work)
* install application with apt-get
* install application from source repository with [curl](https://curl.se/)
* create new folder using mkdir
* use [nano](https://www.nano-editor.org/) to open a file with sudo rights and edit it: `$ nano <my_file>` & CTRL + O to save 
* use [Total Commander](https://www.ghisler.com/) to transfer files over location 

# Start on React.js

Before and after the trouble with Debian, my main goal is to learn React. I already completed a few free online courses but I still haven't found something worth your time. If you have any tips to learn it from a good starting point, please let me know.

Well, at least I learnt:
```
$ npx create-react-app <projectname>
$ cd <projectname>
$ npm start
```

# Social Media discoveries

<Dev.to> is my weekly discovery of social media thanks to @emilycook321. It is so great to see such a vibrant and inspiring community sharing knowledge and tips. Thank you for making it happened and for reading until here.

Hope your week was full of discoveries as well! Let me know down below :)