21 novembre 2021

WSL 2 upgrade on windows

Few days ago I would like to use docker from windows with docker composer. And because I am using ansible, I found easier to deal from Linux so I naturally use WSL.

But when I start to launch docker, a warning message tells me WSL 1 is installed but not WSL 2.

So how to upgrade from WSL 1 to WSL 2.

First, identify versions of WSL by using :
wsl --list

Result tells me that I use Ubuntu-20.04 and WSL 2 but I still get a warning message that Ubuntu not running under WSL 2.

I found this article from Microsoft Docs : Troubleshooting Windows Subsystem for Linux | Microsoft Docs talking about an error : "Invalid command line option: wsl --set-version Ubuntu 2".

So, secondly, I try to update by using this command :
wsl --set-version Ubuntu-20.04 2

And it works. My Ubuntu 20.04 is now working on WSL2.

Hoping it will help others.

29 mai 2019

Minecraft server

Minecraft server enable to create a virtual world. Then you can connect from Minecraft from "Multiplayer".

Requirements

Installing Java is mandatory.

apt install default-jre screen nano wget git
apt install software-properties-common
apt install openjdk-16-jdk-headless

Init

Download the server binary located here : https://www.minecraft.net/fr-fr/download/server/.

Then you need to accept EULA by editing the file EULA.txt generated after launching the server for the first time.

Manual method

java -Xmx1024M -Xms1024M -jar minecraft_server.1.17.jar nogui

Screen method

Starting server :

screen -S minecraft -d -m java -Xmx1024M -Xms1024M -jar server.jar nogui

Displaying launched program :
screen -ls will list "screened" programs
screen -r minecraft will show you the terminal where your program is launched
Ctrl + a > c will let you go back to your initial terminal

Service method

Install following code to /etc/systemd/system/minecraft_server.service :

[Unit] Description=Minecraft server

[Service]
User=minecraft
# The configuration file application.properties should be here:
WorkingDirectory=/opt/minecraft/servers/myserver
ExecStart=/usr/bin/java -Xmx1024M -Xms1024M -jar ./server.jar nogui
SuccessExitStatus=143
TimeoutStopSec=10
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Reload service file :

systemctl daemon-reload

Start :

service minecraft_server start

Stop :

service minecraft_server stop

Minecraft commands

To exit the program :
/stop

For help : /help

05 mars 2019

GIT

Few Git commands :

Clone remote repository
git clone (ssh|git)://hostname.com/(repository)
Record code updates
git commit
Push local updates to remote
git push origin master

08 décembre 2018

Angular

Voici quelques repères pour démarrer sous Angular.

Installation windows :
Node.js + npm install -g @angular/cli
IDE :
Visual Studio Code avec module Angular language service
Créer un nouveau projet :
ng new app-test
Générer un composant :
ng generate component mycomponent
Traduction :
ng xi18n
Rendu du site en live :
ng serve --open
Compilation pour mise en ligne :
ng build --prod

Maven tips

Here is the beginning of a progressive documentation of Maven.


Useful commands

>>mvn {{command}}
  • clean
  • compile
  • package
  • site

Reports

Reports are located reporting xml element in the xml project file (pom.xml) :

...

Here are few reports plugin :

org.apache.maven.plugins maven-javadoc-plugin org.apache.maven.plugins maven-checkstyle-plugin org.apache.maven.plugins maven-jxr-plugin org.apache.maven.plugins maven-pmd-plugin

14 janvier 2018

Install Java on Ubuntu



Declare Oracle Java 8 Repository :
sudo add-apt-repository ppa:webupd8team/java

Then, refresh local repository index :
sudo apt-get update

And install with :
sudo apt-get install oracle-java8-installer

Source : https://www.digitalocean.com/community/tutorials/how-to-install-java-with-apt-get-on-ubuntu-16-04

08 décembre 2017

Update Linux with "Aptitude"

In order to update the index of updates of aptitude, you need to launch this command :
apt-get update

Then you can update the OS by launching this command :
apt-get upgrade

08 mars 2013

Acer Iconia Tab A510

Recovery Mode :

  1. Vérifier que le verrouillage de l'écran est activé (pour être sûr, vu du dessus, le fond du bouton est rouge)
  2. Appuyer sur Volume bas puis le "Bouton Power"
  3. A la première vibration, relâcher Power
  4. A la seconde vibration relâcher Volume bas et presser Volume haut


  • Pour naviguer parmi les options :
    • Volume Haut ou bas
  • Pour sélectionner une option :
    • Power

WSL 2 upgrade on windows

Few days ago I would like to use docker from windows with docker composer. And because I am using ansible, I found easier to deal from Linux...