« Ubuntu arm 20.04 » : différence entre les versions

De Banane Atomic
Aller à la navigationAller à la recherche
Ligne 140 : Ligne 140 :
</kode>
</kode>
* [[PostgreSQL_and_Ubuntu|PostgreSQL_and_Ubuntu]]
* [[PostgreSQL_and_Ubuntu|PostgreSQL_and_Ubuntu]]
= .NET Core =
* [https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-1804 Install .NET SDK or .NET Runtime on Ubuntu 18.04]
== Installation ==
* [https://dotnet.microsoft.com/download/dotnet-core/ Download the ASP.NET Core Runtime] → Linux ARM64 Binaries
<kode lang='bash'>
# download the archive
wget https://download.visualstudio.microsoft.com/download/.../aspnetcore-runtime-x-linux-arm64.tar.gz
# create the dotnet folder
mkdir dotnet
# extract the archive in the dotnet folder
tar zxf aspnetcore-runtime-x-linux-arm64.tar.gz -C dotnet
sudo mv dotnet /usr/share
sudo chown root:root -R /usr/share/dotnet
export DOTNET_ROOT=/usr/share/dotnet
export PATH=$PATH:/usr/share/dotnet
# test
dotnet --info
# sdk
wget https://download.visualstudio.microsoft.com/download/.../dotnet-sdk-x-linux-arm64.tar.gz
tar xzf dotnet-sdk-x-linux-arm64.tar.gz
</kode>
<filebox fn='~/.zshenv' lang='bash'>
# .NET Core
export DOTNET_ROOT="/usr/share/dotnet"
export PATH=$PATH:"/usr/share/dotnet"
</filebox>
== Console ==
<kode lang='bash' collapsed>
# create the project
dotnet new console -o dotnet-console
# build the project
cd dotnet-console
dotnet build
# run the binary
bin/Debug/netcoreapp3.1/dotnet-console
</kode>
== ASP.NET Core with React.js and Redux ==
<kode lang='bash' collapsed>
# create the project
dotnet new reactredux -o dotnet-reactredux
# install node.js and npm
sudo apt install nodejs npm
# build the project
cd dotnet-reactredux
dotnet build
# start the server
dotnet run
</kode>
* [[Apache_et_ubuntu#Dotnet_core|Apache et dotnet core]]
== [[Blazor_.NET_Core_3.1|Blazor]] ==


= Applications =
= Applications =

Version du 11 août 2023 à 21:07

Links

Useful commande lignes

Bash.svg
# updates
adg  # sudo apt update && sudo apt upgrade
sudo snap refresh

sudo reboot
sudo poweroff

APT (Advanced Package Tool)

zsh - oh my zsh

Bash.svg
# install zsh
apt install zsh zsh-syntax-highlighting
# zsh install zsh-common

# install oh-my-zsh and set zsh as default shell for the current user
sh -c "$(wget -O- https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
~/.zshrc
plugins=(
    alias-finder
    colored-man-pages
    common-aliases
    copybuffer
    debian
    extract
    fd
    git
    ripgrep
    sudo
    systemd
    wd)

# don't store in history commands prefixed with a space (test with: history | tail)
setopt HIST_IGNORE_SPACE

# add hostname to PROMPT only for ssh connection
if [[ -n $SSH_CONNECTION ]]; then
    PROMPT="%m ${PROMPT}"
fi

# must be loaded last
source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh

netplan

/etc/netplan/01-netcfg.yaml
network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      dhcp4: yes
      # addresses: [192.168.0.x/24]
      # gateway4: 192.168.0.y
      nameservers:
        addresses: [192.168.0.x, 192.168.0.y]  # set multiple DNS servers
Bash.svg
# test the configuration, the configuration is applied for 120 seconds then reverted
sudo netplan try

# apply changes
sudo netplan apply
# creates the file /run/systemd/network/10-netplan-eth0.network

# check the DNS servers
systemd-resolve --status | grep 'DNS Servers' -A2

# display current DHCP lease
netplan ip leases [interface]

# debugging the generation of the file /run/systemd/network/10-netplan-eth0.network
sudo netplan --debug generate

UFW configuration

Bash.svg
sudo ufw allow OpenSSH       # port 22
sudo ufw allow 'Nginx Full'  # port 80 443
sudo ufw allow DNS           # port 53 (dnsmasq)

PHP 8+

Bash.svg
sudo add-apt-repository ppa:ondrej/php

sudo add-apt-repository ppa:ondrej/nginx-mainline  # new features, updates, bugfixes
sudo add-apt-repository ppa:ondrej/nginx           # no new features, major bugfixes only, annual release
sudo add-apt-repository ppa:ondrej/apache2

uWSGI

Doesn't seem to work with PHP 8.2 and Ubuntu 20.04
With Ubuntu 20.04, ondrej ppa and PHP 8.2 installed, the following dependencies are wrongly installed:
php7.4-cli php7.4-common php7.4-json php7.4-opcache php7.4-phpdbg php7.4-readline
 !!! UNABLE to load uWSGI plugin: libphp7.so: cannot open shared object file: No such file or directory !!!
Bash.svg
# better use --plugin option instead of the following workaround
sudo ln -s /usr/lib/libphp8.so /usr/lib/libphp7.so

MariaDB

Bash.svg
ai mariadb-server

# connection with unix_socket
sudo mariadb

PostgreSQL 15+

Bash.svg
# add the postgre official package repository
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list'
# import the GPG signing key for the repository
wget -qO- https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo tee /etc/apt/trusted.gpg.d/pgdg.asc &>/dev/null

# install specifically the version 15 instead of the meta-package postgresql to avoid unwanted upgrade
ai postgresql-15

.NET Core

Installation

Bash.svg
# download the archive
wget https://download.visualstudio.microsoft.com/download/.../aspnetcore-runtime-x-linux-arm64.tar.gz
# create the dotnet folder
mkdir dotnet
# extract the archive in the dotnet folder
tar zxf aspnetcore-runtime-x-linux-arm64.tar.gz -C dotnet

sudo mv dotnet /usr/share
sudo chown root:root -R /usr/share/dotnet

export DOTNET_ROOT=/usr/share/dotnet
export PATH=$PATH:/usr/share/dotnet

# test
dotnet --info

# sdk
wget https://download.visualstudio.microsoft.com/download/.../dotnet-sdk-x-linux-arm64.tar.gz
tar xzf dotnet-sdk-x-linux-arm64.tar.gz
~/.zshenv
# .NET Core
export DOTNET_ROOT="/usr/share/dotnet"
export PATH=$PATH:"/usr/share/dotnet"

Console

Bash.svg
# create the project
dotnet new console -o dotnet-console

# build the project
cd dotnet-console
dotnet build

# run the binary
bin/Debug/netcoreapp3.1/dotnet-console

ASP.NET Core with React.js and Redux

Bash.svg
# create the project
dotnet new reactredux -o dotnet-reactredux

# install node.js and npm
sudo apt install nodejs npm

# build the project
cd dotnet-reactredux
dotnet build

# start the server
dotnet run

Blazor

Applications

Name Version Comment
btop 1.2.13 resource monitor (snap)
MariaDB 10.3.38
NGINX 1.24 use ondrej ppa (native 1.22)
PHP 8.2.8 use ondrej ppa (native 7.4.3)
PostgreSQL 15.4 use PDGD repository (native 12.15)

Shell tools

Name Description
bat A cat clone with syntax highlighting and Git integration. batcat
du-dust more intuitive du unable to install
exa modern replacement for ls unable to install
fd-find file name search tool
ripgrep file content search tool
tldr simplified and community-driven man pages
trash-cli command line trash