issue201:c_c
Différences
Ci-dessous, les différences entre deux révisions de la page.
Prochaine révision | Révision précédente | ||
issue201:c_c [2024/01/27 17:27] – créée auntiee | issue201:c_c [2024/01/29 12:28] (Version actuelle) – andre_domenech | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
- | I was talking to a friend who is stuck in a dead end sales job, about learning the basics of code, so he can learn QA. (His background is actually QC) After a bit of uhm-ing and ah-ing, we got onto the topic of getting up and running with Python. He had tried before and ended up creating a python VM and followed along for the first lesson, but went to sleep thereafter. When he got to the second lesson, he was stuck, not knowing how to get back into that Python VM, so he gave up. I know these kinds of frustrations, | + | **I was talking to a friend who is stuck in a dead end sales job, about learning the basics of code, so he can learn QA. (His background is actually QC) After a bit of uhm-ing and ah-ing, we got onto the topic of getting up and running with Python. He had tried before and ended up creating a python VM and followed along for the first lesson, but went to sleep thereafter. When he got to the second lesson, he was stuck, not knowing how to get back into that Python VM, so he gave up. I know these kinds of frustrations, |
- | I decided to put it onto paper how we did it, that way you guys ‘n gals can share it around. An Ubuntu install is straight forward, so we will skip that part. Once installed, do all the updates. Obviously one can install all the Snaps with one line from the terminal; snap install postman pycharm-community multipass | + | Afin qu’un ami, qui est actuellement bloqué dans un poste de vente sans avenir, puisse apprendre l’Assurance qualité (QA), je lui parlais de l’apprentissage des bases du codage. (En fait, il connaît le Contrôle de la qualité (QC).) Après un peu de tergiversation, |
+ | |||
+ | |||
+ | **I decided to put it onto paper how we did it, that way you guys ‘n gals can share it around. An Ubuntu install is straight forward, so we will skip that part. Once installed, do all the updates. Obviously one can install all the Snaps with one line from the terminal; snap install postman pycharm-community multipass | ||
And just like that, your “client-side” is set up. Pycharm creates Python VM’s for you and is an IDE. Postman allows you to test your API’s and Multipass will let us spin up the server side for development. (For the curious) | And just like that, your “client-side” is set up. Pycharm creates Python VM’s for you and is an IDE. Postman allows you to test your API’s and Multipass will let us spin up the server side for development. (For the curious) | ||
- | Want to know the best part? I just did it all again in a VM! I just created an Ubuntu desktop Virtual Machine on top of Linux Lite 6.6, that in turn runs an Ubuntu server VM. If you are a n00b to all of this, you may ask, “what am I smoking?” | + | Want to know the best part? I just did it all again in a VM! I just created an Ubuntu desktop Virtual Machine on top of Linux Lite 6.6, that in turn runs an Ubuntu server VM. If you are a n00b to all of this, you may ask, “what am I smoking?”** |
- | Let’s rewind. I don’t have a spare PC, to set it all up again, so I thought I’d do it in a VM, so I can vet myself and take screen-shots for you ugly lot. The thing with Ubuntu LTS is, that Virtualbox is version 6.1 in the official repositories and you will need version 7.0+ to follow along. (You will see why in a minute.) I just download the .deb-file from the website and installed it | + | J’ai décidé de mettre par écrit ce que nous avions fait pour que vous, les lecteurs et lectrices, puissiez le partager avec d' |
+ | |||
+ | Et tout de suite, votre « client-side » (côté client) est configuré. Pycharm crée les VM Python à votre place et c’est un IDE. Postman vous permet de tester vos API et Multipass nous donne la possibilité de lancer le côté serveur pour du développement. (Pour les curieux.) | ||
+ | |||
+ | Mais si vous voulez connaître le meilleur, j’ai tout simplement refait tout dans une VM ! Je viens de créer une machine virtuelle avec un bureau Ubuntu par-dessus Linux Lite 6.6, qui, à son tour, exécute une VM sous Ubuntu server. Si vous êtes un n00b concernant tout cela, vous pourriez vous demander « mais qu’est-ce qu’il fume ? | ||
+ | |||
+ | |||
+ | **Let’s rewind. I don’t have a spare PC, to set it all up again, so I thought I’d do it in a VM, so I can vet myself and take screen-shots for you ugly lot. The thing with Ubuntu LTS is, that Virtualbox is version 6.1 in the official repositories and you will need version 7.0+ to follow along. (You will see why in a minute.) I just download the .deb-file from the website and installed it | ||
Once complete, there is a setting under the CPU tab of Virtualbox that you need to set. System -> Processor -> Enable Nested VT-x | Once complete, there is a setting under the CPU tab of Virtualbox that you need to set. System -> Processor -> Enable Nested VT-x | ||
- | Just remember to allocate enough CPU’s for this. The server inside the VM will also need one, minimum. Install Ubuntu desktop as per usual and then install the programs mentioned above. I strongly suggest installing: sudo apt install virtualbox-guest-utils | + | Just remember to allocate enough CPU’s for this. The server inside the VM will also need one, minimum. Install Ubuntu desktop as per usual and then install the programs mentioned above. I strongly suggest installing: sudo apt install virtualbox-guest-utils** |
+ | |||
+ | Revenons en arrière. Je n’ai pas de PC supplémentaire, | ||
+ | |||
+ | Une fois terminé, dans Virtualbox, sous l’onglet CPU, il y a un paramètre que vous devez régler. System → Processeur → Enable Nested VT-x | ||
+ | |||
+ | Il faut juste vous souvenir d’allouer assez de CPU pour cela. Le serveur dans la VM en aura besoin d’un minimum aussi. Installez le bureau Ubuntu comme d’habitude, | ||
- | That installs the one half, but you will need a server to faff around on. We can quickly do so with Multipass. All we are going to need is a yaml file describing our server. I searched the web for multipass cloud-init-examples and stole that yaml file and edited it to my liking: | + | **That installs the one half, but you will need a server to faff around on. We can quickly do so with Multipass. All we are going to need is a yaml file describing our server. I searched the web for multipass cloud-init-examples and stole that yaml file and edited it to my liking: |
(shown top right) | (shown top right) | ||
Ligne 25: | Ligne 42: | ||
This will spin up your instance we named newbuntu and you should see it running looking at the orange icon in the taskbar, or simply check in your terminal: | This will spin up your instance we named newbuntu and you should see it running looking at the orange icon in the taskbar, or simply check in your terminal: | ||
+ | |||
+ | multipass list** | ||
+ | |||
+ | Cela en installe la moitié, mais vous aurez besoin d’un serveur pour bricoler dessus. Nous pouvons faire cela rapidement avec Multipass. Tout ce dont nous aurons besoin est un fichier yaml qui décrit le serveur. J’ai recherché sur le Web des multipass cloud-init-examples et j’ai volé ce fichier yaml et l’ai édité pour qu’il me plaise (voir en haut à droite). | ||
+ | |||
+ | Enregistrez en tant que cloud-config.yaml | ||
+ | |||
+ | Référence : | ||
+ | |||
+ | Quoi qu’il en soit, pour le lancer, il suffit de taper ce qui suit là où le fichier cloud-config.yaml se trouve : | ||
+ | |||
+ | multipass launch -n newbuntu --cloud-init cloud-config.yaml | ||
+ | |||
+ | Cela lancera votre instance que nous avons appelé newbuntu et, en regardant l’icône orange dans la barre des tâches, ou simplement en vérifiant dans le terminal, vous devriez le voir tourner : | ||
multipass list | multipass list | ||
- | Take note of that IP address, as you would need it to ssh into. If you type it into your browser, you should see your Apache landing page. I will add a screen-shot (below) so you can see what I mean. | + | |
+ | **Take note of that IP address, as you would need it to ssh into. If you type it into your browser, you should see your Apache landing page. I will add a screen-shot (below) so you can see what I mean. | ||
How difficult was that? | How difficult was that? | ||
Ligne 38: | Ligne 70: | ||
Feel like we could have done better? Then email: misc@fullcirclemagazine.org | Feel like we could have done better? Then email: misc@fullcirclemagazine.org | ||
- | Above you can see my VM running a VM (Ubuntu server) with htop open and I can write Python code in Pycharm. | + | Above you can see my VM running a VM (Ubuntu server) with htop open and I can write Python code in Pycharm. ** |
+ | |||
+ | Notez l’adresse IP, car vous en aurez besoin pour y entrer avec ssh. Si vous la tapez dans votre navigateur, vous devez voir votre page d’atterrissage Apache. J’ajoute une capture d’écran (ci-dessous) pour que vous puissiez voir ce dont je parle. | ||
+ | |||
+ | Alors, c’était si difficile que ça ? | ||
+ | |||
+ | Entrez dans la machine via ssh avec le nom d’utilisateur ubuntu et le mot de pass poopypants (couche plein de caca) comme indiqué dans notre fichier de configuration et acceptez l’empreinte digitale. (Oui, j’ai douze ans, OK ?) | ||
+ | |||
+ | Alors, qu’est-ce qu’il y a à ne pas aimer ici ? Si vous et vos amis/ | ||
+ | |||
+ | Vous avez l’impression qu’on aurait pu mieux faire ? Alors envoyez un mail à : misc@fullcirclemagazine.org | ||
+ | |||
+ | Ci-dessus, vous voyez ma VM exécutant une VM (Ubuntu server) ; htop est ouvert et je peux écrire du code Python dans Pycharm. | ||
issue201/c_c.1706372865.txt.gz · Dernière modification : 2024/01/27 17:27 de auntiee