Here is a list of commands to update Ubuntu (or Debian distro) in a with one cli command.
Explained version sudo apt update && \ # Update repository sudo apt upgrade -y && \ # Ugprade packages (yes to all) sudo apt dist-upgrade -y && \ # Dist upgrade packages (yes to all) sudo apt autoremove -y && \ # Removes orphaned packages which are not longer needed from the system, but not purges them sudo apt autoclean -y && \ # Cleans obsolete deb-packages, less than clean sudo apt clean # Cleans the packages and install script in /var/cache/apt/archives/ Multiline version sudo apt update && \ sudo apt upgrade -y && \ sudo apt dist-upgrade -y && \ sudo apt autoremove -y && \ sudo apt autoclean -y && \ sudo apt clean One line version (use this one!
Cloc: Count Lines of Code If you have ever had the need to analyze the size of the code, the “cloc” can be a good tool.
It counts source code lines, blank lines and comments lines. Very useful for a simple code inspect.
Check it out this github repo! cloc
Show VIM row numbers Copy/Paste guide Show Numbers set nu Hide Numbers set nonu Long version guide set number or the shortcut
set nu and then, this is the new fantastic-oh-my-God Vim:
To come back, just type the reverse command:
set nonumbers and all gets back clean
Maven per-project settings As seen on SKDMan Install and SDKMan Advance Config, often a project has specific requirements.
As a developer, if I wrote more than two times the same command, I try to find a way to automate that process.
Talking about Maven, in a development environment, where we always have to pass the same parameters. In this case the “Maven common configs” file comes to help.
Create .mvn folder and maven.
SDKMan Advance config As you can see in previous post (“SDKMan Install”), SDKMan is an useful tool for manage your dev machine environments.
Advance config tips An option that I recently discovered is the way to configure and install projects dependencies in one step.
For example in our .sdkmanrc file, we have the following settings:
java=11.0.11-hs-adpt Suppose that, after some days we need to specify the Maven version (ex 3.3.9), we can add it in our file:
SDKMan - Why use it All devs, that work on several projects, have technical requirements for each of them.
Often in a Java project, the base requirements are:
JDK Maven Gradle Apache JMeter other strange things… :) (Hey the Demogorgon!) In this situation, I think that the best choice is not to mess your dev system.
Before using SDKMan, I needed to edit my “JAVA_HOME”, “M2_HOME” envs variables, for each project.