lundi 24 août 2020

Darmanin VS drogue, Marlène VS gros camion & Sarkozy VS littérature ! (J...

"https://localhost.duia.eu/index.html", "https://b-box3.blogspot.com/index.html", "https://b-box3.blogspot.com/404.html", "https://b-box3.blogspot.com/2020/07/article.html", "https://b-box3.blogspot.com/2020/07/article.html",

jeudi 30 juillet 2020

Oh My Zsh

sitemap
rss-feeds index.html article

How to Setup ZSH and Oh-my-zsh on Linux

The Z shell or zsh is an interactive UNIX shell and a powerful command-line interpreter for scripting languages, including shell scripting. Zsh was developed by 'Paul Fastad' since 1990, and the name 'zsh' comes from the Yale professor Zong Shao.

The Z-Shell has become one of the most popular shells for the Linux operating system. It is rich in features and easy to configure and customize. Below are some important zsh functions:

  • Command auto-complete
  • Improved variable handling
  • Spelling correction
  • Shared command history
  • Kill tab completion
  • Environment variable easy setup
  • Customizable

Oh-my-zsh

Oh-my-zsh is an open-source framework for managing ZSH, the Z shell. There are also other frameworks for the Z shell, such as prezto, Zgen, Antigen, etc. In this tutorial, we use 'oh-my-zsh' for our zsh configuration.

Oh-my-zsh is a community-based framework with many functions. It comes with a customizable design and has an extensive catalog of plugins aimed at system administrators and developers.

In this tutorial we show you how to install the Z-Shell or zsh under Ubuntu Linux and CentOS. Then we configure the oh-my-zsh framework for managing zsh. We will also show you how to change the zsh theme and activate plugins.

Prerequisites

  • Linux - Ubuntu 20.04 or CentOS 8
  • Root privileges

What we will do

  1. Install and configure ZSH
  2. Install and configure Oh-my-zsh framework
  3. Change default theme
  4. Enable oh-my-zsh plugins

Step 1 - Install and configure ZSH

In this step, we will install the Z shell from the repository, and then configure a user to use the Z shell as the default theme. Basically, the default shell on Ubuntu and CentOS is bash, so we will configure a root user to use zsh as the default shell.

To install zsh from the repository, use the following commands.

On Ubuntu:

apt install zsh

On CentOS:

dnf install zsh

After the installation is complete, change the default shell of the root user to zsh with the chsh command below.

On Ubuntu:

chsh -s /usr/bin/zsh root

On CentOS:

chsh -s /bin/zsh root

Now logout from the root user, log in again, and you will get the zsh shell.

Check the current shell used with the command below.

echo $SHELL

The output should be zsh. Here's the result on Ubuntu.

Change shell to zsh on Ubuntu

And here's the result on CentOS.

Change shell to zsh on centOS

The Z shell zsh has been installed.

Step 2 - Install and configure Oh-my-zsh framework

So the Z shell is now installed on the system. Next, we want to install the oh-my-zsh framework for managing the Z shell zsh. Oh-my-zsh provides an installer script for installing the framework, and we need to install some other required packages, including wget for downloading the installer script and Git for downloading oh-my-zsh shell from GitHub.

So the first step is to install wget and git on the system. Here are the commands you need to run:

On Ubuntu:

apt install wget git

On CentOS:

dnf install wget git

Now download the installer script and execute it.

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

The result/output should be similar to the one shown below.

nstall Oh-my-zsh

So, oh-my-zsh is installed in the home directory '~/.oh-my-zsh'.

Next, we need to create a new configuration for zsh. As with the Bash shell, which has a configuration named '.bashrc', for zsh, we need a '.zshrc' configuration file. It's available in the oh-my-zsh templates directory.

Copy the template .zshrc.zsh-template configuration file to the home directory .zshrc and apply the configuration by running the source command, as shown below.

cp ~/.oh-my-zsh/templates/zshrc.zsh-template ~/.zshrc
source ~/.zshrc

Oh-my-zsh is now installed on the system, and the Z shell has been configured for using the oh-my-zsh framework with default configuration.

The following result is on Ubuntu.

The Oh-my-zsh installation on Ubuntu

And here's what you'll see on CentOS.

Oh-my-zsh installation on CentOS

Step 3 - Change default themes

The default .zshrc configuration that's provided by oh-my-zsh is using 'robbyrusell' theme. In this step, we will edit the configuration and change the default theme.

The Oh-my-zsh framework provides many themes for your zsh shell, head to the link below to take a look at the available options.

https://github.com/robbyrussell/oh-my-zsh/wiki/Themes

Alternatively, you can go to the 'themes' directory and see the list of available themes.

cd ~/.oh-my-zsh/themes/
ls -a

List of zsh themes

In order to change the default theme, we need to edit the .zshrc configuration file. Edit the configuration with the vim editor.

vim ~/.zshrc

Pick one zsh theme - let's say 'risto' theme.

Then change the 'ZSH_THEME' line 10 with 'risto' theme as below.

ZSH_THEME='risto'

Save and exit.

Now, reload the configuration .zshrc and you will see that 'risto' theme is currently used as your shell theme.

source ~/.zshrc

The result on Ubuntu.

reload the configuration .zshrc on Ubuntu

Result on CentOS.

reload the configuration .zshrc on CentOS

So this way, you can apply a new oh-my-zsh theme.

Step 4 - Enable Oh-my-zsh plugins

Oh-my-zsh offers awesome plugins. There are a lot of plugins for our environment, aimed at developers, system admins, and everyone else.

Default plugins are in the 'plugins' directory.

cd ~/.oh-my-zsh/plugins/
ls -a

List available zsh plugins

In this step, we will tweak zsh using the 'oh-my-zsh' framework by enabling some plugins. In order to enable the plugins, we need to edit the .zshrc configuration file.

Edit .zshrc configuration file.

vim ~/.zshrc

Go to the 'plugins' line 54 and add some plugins that you want to enable inside the bracket (). For example, here's the change I made in my case:

plugins=(git extract web-search yum git-extras docker vagrant)

Following is the result when using the 'extract' plugin - you can extract zip and tar file using the 'extract' command.

Install the zsh extract plugin

Yum command - yum info with only 'yp' command.

yum command info

Vagrant plugin for command autocompletion.

zsh vagrant plugin

To conclude, the Z shell, as well as the oh-my-zsh framework, have been installed. In addition, oh-my-zsh default theme has been changed with some plugins enabled.

mardi 14 juillet 2020

https://ptitanubis.blogspot.com/2020/07/premiere.html

https://archman-lan.blogspot.com/2020/07/draft.html
https://archman-lan.blogspot.com/2020/07/13/article.html

https://archman-lan.blogspot.com/2020/07/13/page.html
https://archman-lan.blogspot.com/2020/07/13/jours.html
https://archman-lan.blogspot.com/2020/07/premiere.html










mardi 21 avril 2020

Interview sur le Projet [Darling].

Resumer : "Interview sur le Projet [Darling]." Qu'est ce que le projet [Darling]? A quoi sert [Darling]? [Darling] est un ensemble de logiciels qui permette depuis une machine [GNU/Linux] d'exécuter les logiciel écrit pour les ordinateurs de la marque (appel) qui utilise leur OS propriétaire appeler [macOS], [MacOS X], et ce directement sous votre machine [GNU/Linux] et ce sans utiliser d'émulateur matériel. Gratuitement, et sans devoir posséder les onéreuses machine a faible capacité évolutive du constructeur à la pomme. Comme [GNU/Linux], [Darling] est un logiciel gratuit, libres et open-source. Il est développé ouvertement sur (GitHub) et distribué sous la licence GNU GPL version 3. Compatible, [Darling] implémente un environnement [Darwin] complet. Mach, dyld, launchd, ... Tout ce que vous vous attendriez à trouver pour l’exécution d'un logiciel conçus depuis un (Mac) sous [MacOS]. Facile à utiliser, [Darling] fait la plupart de la configuration pour vous. Asseyez-vous et profitez de votre logiciel préféré. Ou en est le projet [Darling]? Nous visons à intégrer pleinement les applications exécutées sous [Darling] dans l'expérience du flux de travail d'un bureau Linux en les faisant ressembler, interagir et se comporter comme des applications Linux natives. Cela ressemble beaucoup à Wine Et c'est! Wine vous permet d'exécuter des logiciels Windows sur Linux. Donc on as repris le principe et c'est! Darling fait de même pour les logiciels macOS. Un projet similaire est Anbox, pour les applications Android. Prend-il en charge les applications GUI? Presque! Cela nous a pris beaucoup de temps et d'efforts, mais nous avons enfin un support expérimental de base pour exécuter des applications graphiques simples. Cependant, il nécessite une configuration spéciale pour le moment, alors ne vous attendez pas à ce qu'il fonctionne tout de suite. Nous y travaillons activement et progressons de façon très prometteuse, mais la tache est plus complexe qu'elle pourrait en avoir l'air. Quand bien même les version très très ancienne de [Mac OS X] dans ça version serveur ont débuter avec un serveur d'affichage X11. Mais ils ont rapidement basculer vers leur propre implémentation nommée xQuartz qui est déjà un autre serveur d'affichage. [GNU/Linux] lui passait de Xfree86/x11 a x11/X.Org généralement, à l'exception de Ubuntu qui lui aussi proposait aussi sa propre implémentation nommée xMire d'un serveur d'affichage qu'ils ont finit par abandonné fin 2017. Et puits s'il ne suffisait que de tout transcrire en x11/X.Org, mais [GNU/Linux] se vois aujourd'hui aussi obliger de migrer vers un autre serveur d'affichage qui est Wayland, et ce en grande partie pour pouvoir exploiter pleinement les caractéristique des nouvelles carte graphique qui totalement changer d'architecture si ont les compare au carte de l’ère 2005/2010 ou encore 2010/2015. Et que x11/X.Org est très vieux et dans le cas présent devenus obsolète pour la prises en charge des GPU Moderne. Bien que paradoxalement très flexible et surtout adapter pour l'affichage de machine distante comme des client leger, des console d'administration. Aujourd'hui avec l'API Vulkan, la translation de DirectX vers vkd3d qui est possible depuis proton et la demande sans cesse croissant de l'usage de fonctionnalité 3D de type OpenGL/OpenGLES, GEGL/OpenCL/Cuda ... Surtout depuis que Steam est disponible nativement sous [GNU/Linux] et que le bureau Gnome peut sans rougir êtres désigner comme l'une des meilleurs options en terme de choix d'une plateforme de Jeux. Restez à l'écoute! Cela viole-t-il le CLUF d'Apple? Non! Nous n'utilisons directement que les parties de [Darwin] qui sont publiées en tant que logiciel entièrement libres et gratuit. Le nom Darling signifie-t-il quelque chose? Le nom Darling est une combinaison de «Darwin» et «Linux». [Darwin] est le système d'exploitation principal sur lequel sont basés macOS et iOS. Puis-je exécuter Darling sur Windows en utilisant WSL? Malheureusement non. [Darling] nécessite un vrai noyau Linux pour fonctionner. Connaissez-vous opensource.apple.com, GNUstep, The Cocotron et d'autres projets? Bien sur et en fait, [Darling] est largement basé sur le code source original de [Darwin] publié par Apple. Nous utilisons The [Cocotron] comme base pour notre implémentation de [Cocoa], avec la base portable et divers morceaux de [GNUstep]. Envisagez-vous de prendre en charge les applications iOS? Oui, à long terme, nous aimerions pouvoir exécuter des applications iOS sur des appareils ARM (comme la plupart des téléphones Android). Un défi important ici serait d'écrire notre propre implémentation d'UIKit. Venez nous parler si vous êtes intéressé à y travailler! Comment puis-je contribuer? Commencez par lire la documentation et notre blog pour vous familiariser avec les internes de [Darling]. Ensuite, venez nous rejoindre sur GitHub. C'est génial si vous avez de l'expérience dans le développement pour [macOS] ou [iOS], mais il n'est absolument pas nécessaire de commencer à contribuer. Pour faire simple tester et remonter vos impressions est déjà pour nous une grande aide.
Guide