a LOT of changes
@@ -1,10 +1,12 @@
|
||||
+++
|
||||
title = '{{ replace .File.ContentBaseName "-" " " | title }}'
|
||||
date = {{ .Date }}
|
||||
lastmod = {{ .Date }}
|
||||
draft = true
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux', 'Windows', 'Development', 'General' ]
|
||||
categories = [ 'Guides', 'Tutorials', 'Rants' ]
|
||||
categories = [ 'Guides', 'Tutorials', 'Rants', 'Stories' ]
|
||||
series = []
|
||||
series_weight = 1
|
||||
featuredImage = ""
|
||||
+++
|
||||
|
BIN
content/images/avatar.png
Executable file
After Width: | Height: | Size: 22 KiB |
@@ -1,73 +0,0 @@
|
||||
+++
|
||||
title = 'Easy ML Linux VM Setup'
|
||||
date = 2023-11-28T10:47:31+01:00
|
||||
draft = false
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux', 'Windows', 'Development' ]
|
||||
categories = [ 'Tutorials' ]
|
||||
series = [ 'Arch-Dev-VM' ]
|
||||
+++
|
||||
|
||||
Developing Software on Windows is a massive pain. This is why I have created a guide for beginners that are looking to start learning machine learning and don't have a proper Operating System to do serious ML work. You may, depending on your level of commitment also install as Dual-Boot, but not with this script, as this partitions automatically for a full system wipe. You can also use this script as a starting point for a full install, as it installs all important packages automatically for you.
|
||||
|
||||
The GitHub repository you are going to clone when following this guide is the following: [https://github.com/simplePCBuilding/arch-dev-vm](https://github.com/simplePCBuilding/arch-dev-vm).
|
||||
It contains all scripts that are executed as part of the installation
|
||||
|
||||
# Installation of a VM-Hypervisor
|
||||
On Windows, if you have the pro-edition, a Hypervisor comes already with the OS, but I don't recommend using Hyper-V and opt for VMWare Workstation or QEMU instead. For this guide we will be using VMWare Workstation Player as it is much easier to use. Before we get started though, please enable VT-x or AMD-V depending on if you have an Intel or AMD CPU. You can do that by heading into your device's BIOS and enabling it there. You might need to look up how this works on your device, as every BIOS is different. If you are unaware of how to get into the BIOS, the easiest way to do this on Windows is by holding down shift whilst clicking onto "Restart" and then, once it comes up, clicking onto Troubleshoot and then UEFI-Firmware settings and then restart. This will take you straight to the BIOS without having to spam the BIOS access key on boot.
|
||||
|
||||
With that setting enabled, it is now time to download and install VMWare Workstation Player from the official website and then following the installation prompts.
|
||||
|
||||
|
||||
# Setting up a VM
|
||||
To create a new VM, you want to first download the Arch Linux ISO from the [link](https://pkg.adfinis.com/archlinux/iso/latest/). Download the file that says
|
||||
`archlinux-x86_64.iso`. Then, launch VMware workstation, click "New Virtual Machine". Click next on the now opening dialogue. Now select the ISO you have just downloaded and click next.
|
||||
|
||||
Now enter a virtual machine name (like "arch-dev-vm") and select a location for the virtual machine. This should be on your local disk and preferably outside your user folder. Please create a new folder to not clutter up the folder it resides in. Now, click next and in the next part, give the virtual machine half the System Memory your PC has.
|
||||
|
||||
To check how much memory your PC has, press Ctrl + Shift + Esc to open up Task Manager and expand it to see more detailed infos and head to the resources tab. There it will tell you under memory how much memory you have left. Head back to the Virtual Machine Setup dialogue and give it at most half of the system memory or, if your OS uses more than half of your memory, subtract the amount currently used by your OS form the total and subtract another 2GB to be on the safe side.
|
||||
|
||||
Next off, you need to select how many CPU cores you want to give it. If you don't expect to do anything outside of the VM on your host OS, then you can go ahead and give the VM all the cores available to have maximum performance (recommended). Also ensure that 3D graphics is turned ON!
|
||||
|
||||
Now click finish and you're done!
|
||||
|
||||
|
||||
# Installing
|
||||
Once the VM is booted, enter these commands to start the installation. Before you do that though, read on below:
|
||||
|
||||
```
|
||||
pacman -Sy git
|
||||
git clone https://github.com/simplePCBuilding/arch-dev-vm
|
||||
cd arch-dev-vm
|
||||
./install.sh
|
||||
```
|
||||
|
||||
Then follow the on-screen prompts to complete the installation.
|
||||
|
||||
## Selecting a Keyboard layout
|
||||
If your keyboard layout isn't US, then you might want to change it.
|
||||
Run the following command in the terminal of the booted VM:
|
||||
```
|
||||
ls /usr/share/kbd/keymaps/**/*.map.gz > kb.txt
|
||||
nano kb.txt
|
||||
```
|
||||
|
||||
This will spit out a list of keymaps. Then to select an appropriate keymap, press Ctrl + x and type only the last part (after the last slash and without the .map.gz) after `loadkeys `, so for example for the default Swiss keyboard layout:
|
||||
```
|
||||
loadkeys de_CH-latin1
|
||||
```
|
||||
|
||||
# After the install
|
||||
After the script has finished running, you may type reboot, and you should end up in the fully set up Arch Linux VM. You may now log in with the password you selected during installation. You are now greeted by the GNOME desktop environment. This is one of the easiest to use and most polished user interfaces that exists.
|
||||
|
||||
A thing you might now want to do is install a so-called AUR-Helper. I personally use YAY (yet another yogurt). You install it by running the following commands in Terminator (press the Windows key and type Terminator):
|
||||
|
||||
```
|
||||
cd /tmp
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
```
|
||||
|
||||
# Using the OS
|
||||
Look out for another post soon (tm)
|
BIN
content/posts/2023/11/easy-ml-linux-vm-setup/featured-image.png
Normal file
After Width: | Height: | Size: 1.5 MiB |
121
content/posts/2023/11/easy-ml-linux-vm-setup/index.md
Normal file
@@ -0,0 +1,121 @@
|
||||
+++
|
||||
title = 'Arch Linux Development Virtual Machine'
|
||||
date = 2023-11-28T10:47:31+01:00
|
||||
lastmod = 2023-11-29T20:42:40+01:00
|
||||
draft = false
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux', 'Windows', 'Development' ]
|
||||
categories = [ 'Tutorials' ]
|
||||
series = [ 'arch-dev-vm' ]
|
||||
series_weight = 1
|
||||
lightgallery = true
|
||||
featuredImage = 'featured-image.png'
|
||||
+++
|
||||
|
||||
**Attribution for featured image:**
|
||||
|
||||
Thanks to ["wavering-radiant"](https://www.deviantart.com/wavering-radiant/gallery) for the feature graphic of this post. No modifications were made. This image is licensed under the [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) licence
|
||||
|
||||
# Arch Linux Development Virtual Machine
|
||||
|
||||
Developing Software on Windows is a massive pain. This is why I have created a guide for beginners that are looking to start learning machine learning and don't have a proper Operating System to do serious ML work. You may, depending on your level of commitment also install as Dual-Boot, but not with this script, as this partitions automatically for a full system wipe. You can also use this script as a starting point for a full install, as it installs all important packages automatically for you.
|
||||
|
||||
The GitHub repository you are going to clone when following this guide is the following: [https://github.com/simplePCBuilding/arch-dev-vm](https://github.com/simplePCBuilding/arch-dev-vm).
|
||||
It contains all scripts that are executed as part of the installation
|
||||
|
||||
# Installation of a VM-Hypervisor
|
||||
On Windows, if you have the pro-edition, a Hypervisor comes already with the OS, but I don't recommend using Hyper-V and opt for VMWare Workstation or QEMU instead. For this guide we will be using VMWare Workstation Player as it is much easier to use.
|
||||
|
||||
{{< admonition type=failure title="Be careful: Enable VT-x or AMD-V in your BIOS" open=true >}}
|
||||
Please enable VT-x or AMD-V depending on if you have an Intel or AMD CPU. Failing to do so will not allow you to launch your VM. You can do that by heading into your device's BIOS and enabling it there. You might need to look up how this works on your device, as every BIOS is different.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=tip title="Tip: Entering the BIOS on your PC / Laptop" open=false >}}
|
||||
The easiest way to enter the BIOS on Windows is to hold down shift whilst clicking onto "Restart" and then, once it comes up, clicking onto Troubleshoot and then UEFI-Firmware settings and then restart. This will take you straight to the BIOS without having to spam the BIOS access key on boot.
|
||||
{{< /admonition >}}
|
||||
|
||||
|
||||
With VT-x or AMD-V enabled, it is now time to download and install VMWare Workstation Player from the official website.
|
||||
|
||||
|
||||
# Setting up a VM
|
||||
To create a new VM, you want to first download the Arch Linux ISO from the [link](https://pkg.adfinis.com/archlinux/iso/latest/). Download the file that says
|
||||
`archlinux-x86_64.iso`.
|
||||
|
||||
Now, set up a Virtual Machine, selecting the Arch Linux ISO you have just downloaded
|
||||
|
||||
{{< admonition type=tip title="Tip: Setting up a VM in VMWare Workstation Player" open=false >}}
|
||||
Then, launch VMware workstation, click "New Virtual Machine". Click next on the now opening dialogue. Now select the ISO you have just downloaded and click next.
|
||||
|
||||
Now enter a virtual machine name (like "arch-dev-vm") and select a location for the virtual machine. This should be on your local disk and preferably outside your user folder. Please create a new folder to not clutter up the folder it resides in. For the size, give the VM at least 20 GB, but preferably more, if you can spare it
|
||||
|
||||
Now, click next and in the next part, give the virtual machine half the System Memory your PC has.
|
||||
|
||||
To check how much memory your PC has, press Ctrl + Shift + Esc to open up Task Manager and expand it to see more detailed infos and head to the resources tab. There it will tell you under memory how much memory you have left. Head back to the Virtual Machine Setup dialogue and give it at most half of the system memory or, if your OS uses more than half of your memory, subtract the amount currently used by your OS form the total and subtract another 2GB to be on the safe side.
|
||||
|
||||
Next off, you need to select how many CPU cores you want to give it. If you don't expect to do anything outside of the VM on your host OS whilst the VM is running, then you can go ahead and give the VM all the cores available to have maximum performance (recommended). Also ensure that 3D graphics is turned ON!
|
||||
|
||||
Now click finish and you're done!
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=warning title="Warning: Configuration" open=true >}}
|
||||
Please ensure that the VM has adequate storage (at least 20 GB) and system memory (at least 2 GB, preferably half your system memory). But do make sure that your host OS can still run fine without the amount of RAM you allocate to the VM.
|
||||
|
||||
Additionally, give the VM all the CPU horsepower you can spare, it'll make it much more snappy. I recommend adding as many CPU cores as you have in your system.
|
||||
{{< /admonition >}}
|
||||
|
||||
|
||||
# Installing
|
||||
Once the VM is booted, enter these commands to start the installation. Press enter between each of the commands:
|
||||
|
||||
{{< admonition type=tip title="Tip: Setting a keyboard layout" open=false >}}
|
||||
If your keyboard layout isn't US, then you might want to change it.
|
||||
Run the following command in the terminal of the booted VM:
|
||||
```
|
||||
ls /usr/share/kbd/keymaps/**/*.map.gz > kb.txt
|
||||
nano kb.txt
|
||||
```
|
||||
|
||||
This will spit out a list of keymaps. Then to select an appropriate keymap, press Ctrl + x and type only the last part (after the last slash and without the .map.gz) after `loadkeys `, so for example for the default Swiss keyboard layout:
|
||||
```
|
||||
loadkeys de_CH-latin1
|
||||
```
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
|
||||
```
|
||||
pacman -Sy git
|
||||
git clone https://github.com/simplePCBuilding/arch-dev-vm
|
||||
cd arch-dev-vm
|
||||
./install.sh
|
||||
```
|
||||
|
||||
Then follow the on-screen prompts to complete the installation.
|
||||
|
||||
|
||||
|
||||
# After the install
|
||||
After the script has finished running, you may type reboot, and you should end up in the fully set up Arch Linux VM. Press enter to select the user and type the password you entered during installation. You are now greeted by the GNOME desktop environment. This is one of the easiest to use and most polished user interfaces that exists. The next post in this series will go over using the user interface.
|
||||
|
||||
A thing you might now want to do is install a so-called AUR-Helper.
|
||||
|
||||
To use all my recommended extensions in VSCodium, run the `setup-vscodium.sh` script by opening a terminal and typing the following commands:
|
||||
```
|
||||
cd arch-dev-vm
|
||||
./setup-vscodium.sh
|
||||
```
|
||||
|
||||
{{< admonition type=tip title="Tip: Installing an AUR-Helper" open=false >}}
|
||||
I personally use YAY (yet another yogurt). You install it by running the following commands in Terminator (press the Windows key and type Terminator):
|
||||
|
||||
```
|
||||
cd /tmp
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
# Using the OS
|
||||
Have a look at the next post in this series
|
After Width: | Height: | Size: 483 KiB |
After Width: | Height: | Size: 62 KiB |
BIN
content/posts/2023/11/linux-gnome-getting-started/gnome45.webp
Normal file
After Width: | Height: | Size: 45 KiB |
146
content/posts/2023/11/linux-gnome-getting-started/index.md
Normal file
@@ -0,0 +1,146 @@
|
||||
+++
|
||||
title = 'The GNOME Desktop Environment - Getting Started'
|
||||
date = 2023-11-29T15:29:47+01:00
|
||||
draft = false
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux' ]
|
||||
categories = [ 'Guides' ]
|
||||
series = [ 'arch-dev-vm' ]
|
||||
series_weight = 2
|
||||
featuredImage = "gnome45.webp"
|
||||
+++
|
||||
|
||||
**Attribution for featured image:**
|
||||
|
||||
[Official Launch Image](https://foundation.gnome.org/2023/09/20/introducing-gnome-45/) from the [GNOME foundation](https://foundation.gnome.org)
|
||||
|
||||
<!-- TODO: Add featuredImage to all arch-dev-vm posts -->
|
||||
|
||||
# The GNOME Desktop Environment - Getting Started
|
||||
|
||||
There is barely any other user interface that achieves the sleekness and user-friendliness that GNOME achieves, on no operating system. It has its own workflow and once adjusting to it, you don't want to switch to a user interface that uses a similar concept to the ones found on Windows or macOS. It has inspired quite a few other desktop environments to use or support the same kind of workflow.
|
||||
|
||||
# The Activities Screen
|
||||

|
||||
When you launch GNOME, you are dropped into what is called the activities overview screen. This is where you can see all your open windows and workspaces. Also, the very powerful search of GNOME can be found there. When using GNOME, get used to searching for programs, as this is much faster than reaching for your mouse to click onto programs, as per default, GNOME doesn't support having icons on your desktop. From the desktop, you can reach the overview by pressing the Windows-Key on your PC. If you press the Windows-Key twice, you will reach the application drawer which you can also reach by clicking onto the nine dots icon in the *dash*, the taskbar of GNOME.
|
||||
|
||||
# File Management
|
||||
GNOME's default file manager, nautilus is good for any day-to-day task, but in case you need more complex features, it can get quite limited, due to the fact that all GNOME apps are focusing on user-friendliness instead of offering all the features you could possibly want, which in turn leads to the apps being more difficult to understand. In GNOME, when you search for "Files", you will find the file manager. If you search, you might also notice that the search also finds Characters, settings, additional software and sometimes more.
|
||||
|
||||
# Installing more software
|
||||
Installing Software on Linux is much different from how it's done on Windows. On Linux, there are so-called software repositories that contain the software that we need on our systems. They are packaged by the distribution's maintainers. There are two ways in which you can install software, if it's a graphical application and a single one if it's a CLI (Command Line Interface) application or backend component
|
||||
|
||||
## Package Manager
|
||||
The Package Manager for me is the only way I install software, as I don't like to have a graphical software store. This piece of software is operated in the terminal and the command to be run depends on the Linux-Distribution used. In the case of Arch Linux, the package manager is called `pacman`. Whilst it is really great, I highly recommend you use an AUR helper like yay.
|
||||
|
||||
{{< admonition type=tip title="Tip: Installing YAY" open=false >}}
|
||||
You install it by running the following commands in Terminator (press the Windows key and type Terminator):
|
||||
|
||||
```
|
||||
cd /tmp
|
||||
git clone https://aur.archlinux.org/yay.git
|
||||
cd yay
|
||||
makepkg -si
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
Syntactically speaking, their usage is basically the same. You can also update your whole system by just running one single command, which is what I recommend doing before installing new Software to avoid version mismatches.
|
||||
|
||||
### Installing new Software
|
||||
You can install a new package by running either one of the two commands below:
|
||||
```
|
||||
sudo pacman -S [package name here]
|
||||
yay -S [package name here]
|
||||
```
|
||||
|
||||
{{< admonition type=example title="Example: Installing a package" open=false >}}
|
||||
If you wanted to install Firefox, you'd run either one of the two commands:
|
||||
```
|
||||
sudo pacman -S firefox
|
||||
yay -S firefox
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=warning title="Warning: Installing packages" open=true >}}
|
||||
To be able to install with YAY, you need to have it installed.
|
||||
|
||||
Additionally, it is always important to always check what you are installing / removing before confirming the operation, regardless of whether you use yay or not (see [the LTT example of what can happen](https://youtu.be/0506yDSgU7M?feature=shared&t=634))
|
||||
{{< /admonition >}}
|
||||
|
||||
### Updating
|
||||
You can update your whole system by running either one of the two commands below:
|
||||
```
|
||||
sudo pacman -Syu
|
||||
yay -Syu
|
||||
```
|
||||
|
||||
This will update EVERY package installed on your system, and you will never have to worry about having outdated software ever again.
|
||||
|
||||
### Removing software
|
||||
You can install a new package by running either one of the two commands below:
|
||||
```
|
||||
sudo pacman -R [package name here]
|
||||
yay -R [package name here]
|
||||
```
|
||||
|
||||
{{< admonition type=example title="Example: Removing a package" open=false >}}
|
||||
If you wanted to uninstall Firefox, you'd run either one of the two commands:
|
||||
```
|
||||
sudo pacman -R firefox
|
||||
yay -R firefox
|
||||
```
|
||||
|
||||
If you want to remove all the package's dependencies that are no longer required for the system run:
|
||||
```
|
||||
sudo pacman -Rs firefox
|
||||
yay -Rs firefox
|
||||
```
|
||||
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=warning title="Warning: Removing packages" open=true >}}
|
||||
To be able to remove packages with YAY, you need to have it installed.
|
||||
|
||||
Additionally, it is always important to always check what you are installing / removing before confirming the operation, regardless of whether you use yay or not (see [the LTT example of what can happen](https://youtu.be/0506yDSgU7M?feature=shared&t=634))
|
||||
{{< /admonition >}}
|
||||
|
||||
## GNOME Software
|
||||
GNOME Software is GNOME's frontend to the package manager that you run in the CLI. You can use it to search for any software you want to install.
|
||||
|
||||
# GNOME Web
|
||||
This is the default GNOME Web browser, formerly know as Epiphany. It is based on WebKitGTK, so it uses the same base rendering engine as Safari. This can be useful when developing websites, as you can have a browser with every single rendering engine that is in use today on the same OS.
|
||||
|
||||
# Settings
|
||||
This is the GNOME settings app, where you can adjust all the important settings of the Desktop Environment, like heading into dark mode, changing the keyboard layout, changing to natural scrolling (the in my *objective* opinion better scrolling direction... well I prefer it, give it a try, if you wish) or whatever else there is that needs to be adjusted. For changing to dark mode, as there is a transition period from an older version of a toolkit to a newer one, you also need to set dark mode in GNOME tweaks.
|
||||
|
||||
# GNOME Tweaks
|
||||
In GNOME Tweaks, you can adjust more advanced GNOME settings. What you are probably most interested in is the appearance tab, where you can change the Legacy Applications Style to HighContrastInverse for dark mode.
|
||||
|
||||
In the Windows tabs, you can add back the maximize and minimize buttons as well.
|
||||
|
||||
|
||||
# Status Bar
|
||||
You might have noticed the bar that goes along the top with the time and date in the centre. This is the so-called status bar. In the top left, you can find the workspaces indicator, which shows you, how many workspaces there are and which one you're currently on. If you click onto that indicator, the activities screen opens.
|
||||
|
||||
When clicking onto the time and date in the centre of the bar, the notification centre and calendar are revealed.
|
||||
|
||||
Finally, towards the right, there's the Quick-Actions menu which allows you to for example take a screenshot, lock your device and shut it down, as well as editing the connection, and you can change between light and dark mode.
|
||||
|
||||
|
||||
# Closing thoughts
|
||||
As you can see, GNOME is very user-friendly and uses a different kind of workflow.
|
||||
|
||||
{{< admonition type=tip title="Tip: Keyboard shortcuts" open=false >}}
|
||||
You can speed up your workflow by using keyboard shortcuts. Here are the most important ones:
|
||||
- Super + Left / right arrow: Tile Window to right or left
|
||||
- Super + Arrow up: Maximize window
|
||||
- Super + Arrow down: Minimize window
|
||||
- Alt + Tab: Cycle through windows
|
||||
- Super + A: Open applications drawer (equivalent) to double-pressing the super key
|
||||
- Super + Page up / Page down: Move up / down one workspace
|
||||
- Super + Shift + Page up / Page down: Move current window up / down one workspace
|
||||
|
||||
You can view all shortcuts in the Keyboard > Keyboard Shortcuts menu in the settings app.
|
||||
{{< /admonition >}}
|
||||
|
||||
In the next part of this series of guides, you're going to learn how to use the terminal.
|
163
content/posts/2023/11/linux-terminal-getting-started/index.md
Normal file
@@ -0,0 +1,163 @@
|
||||
+++
|
||||
title = 'Getting Started with the Linux terminal'
|
||||
date = 2023-11-29T15:29:26+01:00
|
||||
draft = false
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux', 'Development' ]
|
||||
categories = [ 'Tutorials' ]
|
||||
series = [ 'arch-dev-vm' ]
|
||||
series_weight = 3
|
||||
featuredImage = "terminal-image.png"
|
||||
+++
|
||||
|
||||
# Getting Started with the Linux terminal
|
||||
For many people just starting out with using Linux, the terminal can be quite intimidating, but, whilst it might be difficult in the beginning, can save you a lot of time if you know your way around in the terminal, as, if you have to lift your arm up from your keyboard to use your mouse one fewer time, it can lead to using a few seconds less - for every time you do this action. Over time, the effort you put in to learn the Linux terminal will pay out.
|
||||
|
||||
|
||||
# Which shell to choose?
|
||||
On Linux, as always, there isn't just one shell. At the time of writing this article the most popular shells are fish, bash and zsh. They are all slightly different, but I won't go over their differences here. Personally, I use the fish shell, as it has a few neat features, most notably that it shows a hint for what the command you might be writing might be, without having to press tab. In general, fish looks neater than bash and zsh. If you have installed the Arch Linux Development Virtual Machine, the fish shell has been configured for you automatically.
|
||||
|
||||
{{< admonition type=tip title="Tip: How to check your current shell" open=false >}}
|
||||
You can check what your current shell is by typing
|
||||
```
|
||||
echo $SHELL
|
||||
```
|
||||
|
||||
This will spit out the path to the shell. The part behind the last / tells you which shell you are using.
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=tip title="Tip: How to change your shell" open=false >}}
|
||||
You can change your shell by typing
|
||||
```
|
||||
chsh -s /bin/[shell name here]
|
||||
```
|
||||
|
||||
You will be prompted for your password.
|
||||
{{< /admonition >}}
|
||||
|
||||
|
||||
# The basics
|
||||
We are going to look at some simple commands for the terminal which are exactly the same, regardless of what shell you are using.
|
||||
|
||||
The first important aspect is, always use autocompletion, as it can help you type faster and with fewer errors. You autocomplete by, after having typed parts of a command pressing tab. If no suggestion comes up immediately, press tab again.
|
||||
|
||||
## Flags / Options
|
||||
Basically every CLI (command line interface) program has so-called *options*, also known as *flags*. These usually come *before* the *arguments* or *operands*. So essentially:
|
||||
`command [options] [arguments]`. All options come in the form of either `-option (short)` or in `--option (full name)`.
|
||||
|
||||
{{< admonition type=example title="Example: Command line options for ls" open=false >}}
|
||||
This is an example of the usage of flags with the command `ls`. The `-la` option means create a list of all options. The `-l` and `-a` options can be specified separately or grouped as in the example below. Usually, when one has more short arguments, they are chained to have a shorter command. The `--color` option can be used to colour the output. This is the exact command that is executed when you type `ll` if you used the install script
|
||||
```
|
||||
ls -la --color /
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
## Changing Directories (cd)
|
||||
{{< admonition type=info title="Info: Linux folder structure" open=true >}}
|
||||
In Linux, the folder structure is very different from Windows. There are *no drive letters*. All drives are *mounted* (you can understand this as being attached) to different *folders* all originating from the *root folder* which resides at the location `/`.
|
||||
|
||||
All devices connected to the system are files and these files reside in the `/dev` folder
|
||||
|
||||
Inside that root folder, there are numerous other folders, most of which you do not need to know about. Below there's a list of the most important folders and what their purpose is.
|
||||
|
||||
- `/bin`: Points to `/usr/bin` and contains all binaries (executable files, i.e. all programs)
|
||||
- `/boot`: This folder contains all the files that are needed to start the system and is the *mounted boot partition*.
|
||||
- `/dev`: Short for *devices*, contains the files for all the devices connected to the system
|
||||
- `/etc`: Contains all system-wide configuration files
|
||||
- `/mnt`: Short for *mount*. The folder in which there should be folders for mountpoints of additional drives
|
||||
- `/home`: The folder that contains the user folders of all users
|
||||
- `/root`: The home folder of the root user (the most powerful user)
|
||||
- `/tmp`: The *temporary* folder, a folder in which you can put stuff that you only need once. It will be cleared after a restart.
|
||||
|
||||
In Linux, there are also *extension-less files*. The OS doesn't only use file-extensions as hints to what this file is, but also the first few bytes of the file itself, which contains information about the file and the permissions. Therefore, *extension-less files* are possible and might be *executable* or just normal text files
|
||||
{{< /admonition >}}
|
||||
|
||||
If you want to navigate your filesystem, you need to move between folders. You can do this by using the `cd` command, which stands for **c**hange **d**irectory.
|
||||
There are a few notable aliases here:
|
||||
- User's home directory: `~`
|
||||
- Root folder: `/`
|
||||
|
||||
If you want to know in which folder you currently are, there's the `pwd` command, which stands for *print working directory*.
|
||||
|
||||
{{< admonition type=example title="Example: Navigate to your home directory" open=false >}}
|
||||
You can navigate to your home folder (`~`) with the following command
|
||||
```
|
||||
cd ~
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=example title="Example: Navigate to the root folder" open=false >}}
|
||||
You can navigate to the root folder (`/`) with the following command
|
||||
```
|
||||
cd /
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
## Listing contents of directories (ls)
|
||||
To list folders inside a directory, there's the `ls` command. If you used the install-script, there will also be `ll`, which will list *all* files in the folder, also hidden ones. Additionally, the files will be coloured, meaning that you can easily differentiate between folders (blue), normal files (white), executable files (lime) and small arrows are indicating that this is a symbolic link, meaning that this file points to a different folder.
|
||||
|
||||
## Copying, Moving, Renaming (cp, mv)
|
||||
These commands are very powerful and have lots of options.
|
||||
|
||||
- `-r`: *Recursively* copy files and directories. If you want to also copy directories, you need to have this option set, otherwise only files will be copied.
|
||||
- `-v`: *Verbose*. Show what is being copied to where
|
||||
|
||||
The `-r` option only has to be specified on the `cp` command, as the `mv` command also includes directories. The destination's parent folder has to exist!
|
||||
|
||||
You can use the `mv` or `rename` command to rename directory (=folder) or files.
|
||||
|
||||
{{< admonition type=example title="Example: Copying a directory" open=false >}}
|
||||
Assume you want to *copy* the folder `~/arch-dev-vm` folder with the *cp* command to `~/projects/arch-dev-vm`.
|
||||
```
|
||||
cp -rv ~/arch-dev-vm ~/projects/arch-dev-vm
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=example title="Example: Moving a directory or file" open=false >}}
|
||||
Assume you want to *move* the folder `~/arch-dev-vm` folder with the *mv* command to `~/projects/arch-dev-vm`.
|
||||
```
|
||||
mv -v ~/arch-dev-vm ~/projects/arch-dev-vm
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
{{< admonition type=example title="Example: Renaming a directory or file" open=false >}}
|
||||
Assume you want to *rename* the folder `~/arch-dev-vn` folder with the *mv* command to `~/arch-dev-vm`.
|
||||
```
|
||||
mv -v ~/arch-dev-vn ~/arch-dev-vm
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
|
||||
## Python
|
||||
Python comes directly with your system, as many packages rely on it. You can run any python program with `python3 [filename]`
|
||||
|
||||
### pip
|
||||
Python has a package manager called `pip`. It can be used to install additional python libraries. On Arch, for quite some time now, pip has been disabled as it liked to break system packages and you are now required to use *virtual environments*.
|
||||
|
||||
You can create a new *virtual environment* with the following commands. Make sure you are in the directory you want to create the *venv* (short for *virtual environment*) in.
|
||||
|
||||
```
|
||||
python -m venv [venv name here]
|
||||
```
|
||||
|
||||
If the command returns no output, you have successfully created a virtual environment. Now you need to enable it in this terminal to be able to use it. Just remember, it will be turned off, once you close that terminal. You can also use VSCodium's built in terminal.
|
||||
|
||||
```
|
||||
source [path to folder you created venv in]/[ venv name here ]/bin/activate.fish
|
||||
```
|
||||
Omit the `.fish` if you are using another shell than fish.
|
||||
|
||||
|
||||
{{< admonition type=example title="Example: Creating a venv and entering it" open=false >}}
|
||||
These commands create and activate a python virtual environment called `main` in `~`.
|
||||
```
|
||||
python -m venv main
|
||||
source ~/main/bin/activate.fish
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
# Package management
|
||||
You can read more about package management [here](/posts/2023/11/linux-gnome-getting-started#package-manager) (previous part of the series).
|
||||
|
||||
# Closing thoughts
|
||||
This post just barely scratched the surface of what is possible to achieve in a terminal. There might be another post about more complex commands in the future.
|
After Width: | Height: | Size: 52 KiB |
@@ -5,11 +5,9 @@ draft = false
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'introduction' ]
|
||||
categories = [ 'introduction' ]
|
||||
image = '/images/2023/11/start.png'
|
||||
featuredImage = 'start.png'
|
||||
+++
|
||||
|
||||

|
||||
|
||||
What can you expect from this blog?
|
||||
|
||||
I am planning to write about a lot of different topics, but mostly about Linux, the Open Source world, software development, and occasionally I'll create some guides
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
BIN
content/posts/2023/12/linux-de-change/gnome-overview.png
Normal file
After Width: | Height: | Size: 483 KiB |
11
content/posts/2023/12/linux-de-change/index.md
Normal file
@@ -0,0 +1,11 @@
|
||||
+++
|
||||
title = 'Change your Linux Desktop Environment'
|
||||
date = 2023-11-29T15:30:11+01:00
|
||||
draft = true
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux' ]
|
||||
categories = [ 'Guides' ]
|
||||
series = [ 'arch-dev-vm' ]
|
||||
series_weight = 4
|
||||
featuredImage = "featured-image.png"
|
||||
+++
|
BIN
content/posts/2023/12/linux-de-change/xfce.png
Normal file
After Width: | Height: | Size: 488 KiB |
After Width: | Height: | Size: 41 KiB |
17
content/posts/2023/12/start-of-my-linux-journey/index.md
Normal file
@@ -0,0 +1,17 @@
|
||||
+++
|
||||
title = 'The start of my Linux journey'
|
||||
date = 2023-11-29T15:30:55+01:00
|
||||
draft = true
|
||||
author = 'Janis Hutz'
|
||||
tags = [ 'Linux' ]
|
||||
categories = [ 'Stories' ]
|
||||
series = [ 'My Linux Journey' ]
|
||||
featuredImage = 'featured-image.jpg'
|
||||
+++
|
||||
|
||||
|
||||
|
||||
|
||||
Attribution for featured image:
|
||||
|
||||
Thanks to ["malkowitch"](https://www.deviantart.com/malkowitch/gallery) for the feature graphic of this post. No modifications were made. This image is licensed under the [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) licence
|
3
content/series/_index.md
Normal file
@@ -0,0 +1,3 @@
|
||||
---
|
||||
title: Series
|
||||
---
|
4
content/series/arch-dev-vm/_index.md
Normal file
@@ -0,0 +1,4 @@
|
||||
---
|
||||
title: Arch Linux Development Virtual Machine
|
||||
introduction: This series of articles helps you set up a Arch Linux based development virtual machine
|
||||
---
|
92
hugo.toml
@@ -10,6 +10,62 @@ summaryLength = "10"
|
||||
[params]
|
||||
# DoIt theme version
|
||||
version = "0.2.X"
|
||||
[params.header]
|
||||
desktopMode = "fixed"
|
||||
mobileMode = "auto"
|
||||
themeChangeMode = "switch"
|
||||
[params.header.title]
|
||||
# URL of the LOGO
|
||||
logo = "/images/avatar.png"
|
||||
# title name
|
||||
name = "blog.janishutz.com"
|
||||
pre = ""
|
||||
post = ""
|
||||
typeit = false
|
||||
[params.footer]
|
||||
enable = true
|
||||
custom = ''
|
||||
hugo = true
|
||||
copyright = true
|
||||
author = true
|
||||
since = 2023
|
||||
license = '<a rel="license external nofollow noopener noreffer" href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank">CC BY-NC 4.0</a>'
|
||||
[params.social]
|
||||
RSS = true
|
||||
GitHub = 'simplePCBuilding'
|
||||
[params.home]
|
||||
rss = 10
|
||||
[params.home.profile]
|
||||
social = true
|
||||
enable = true
|
||||
avatarLinkURL = "https://janishutz.com"
|
||||
title = "<h1>blog.janishutz.com</h1>"
|
||||
subtitle = "Technology, Linux, Development"
|
||||
avatarURL = "/images/avatar.png"
|
||||
[params.page]
|
||||
seriesNavigation = true
|
||||
lightgallery = true
|
||||
[params.home.posts]
|
||||
enable = true
|
||||
paginate = 6
|
||||
defaultHiddenFromHomePage = false
|
||||
[params.page.toc]
|
||||
enable = true
|
||||
keepStatic = false
|
||||
auto = true
|
||||
[params.page.code]
|
||||
copy = true
|
||||
maxShownLines = 10
|
||||
[params.page.related]
|
||||
enable = true
|
||||
count = 5
|
||||
|
||||
|
||||
[author]
|
||||
name = 'Janis Hutz'
|
||||
email = 'development@janishutz.com'
|
||||
link = 'https://janishutz.com'
|
||||
avatar = '/images/avatar.png'
|
||||
|
||||
[menu]
|
||||
[[menu.main]]
|
||||
@@ -39,6 +95,14 @@ summaryLength = "10"
|
||||
url = "/categories/"
|
||||
title = ""
|
||||
weight = 3
|
||||
[[menu.main]]
|
||||
identifier = "series"
|
||||
pre = ""
|
||||
post = ""
|
||||
name = "Series"
|
||||
url = "/series/"
|
||||
title = ""
|
||||
weight = 4
|
||||
|
||||
# Markup related configuration in Hugo
|
||||
[markup]
|
||||
@@ -46,3 +110,31 @@ summaryLength = "10"
|
||||
[markup.highlight]
|
||||
# false is a necessary configuration (https://github.com/dillonzq/LoveIt/issues/158)
|
||||
noClasses = false
|
||||
codeFences = true
|
||||
lineNos = true
|
||||
lineNumbersInTable = true
|
||||
guessSyntax = true
|
||||
[markup.tableOfContents]
|
||||
startLevel = 1
|
||||
endLevel = 10
|
||||
|
||||
[related]
|
||||
includeNewer = true
|
||||
toLower = true
|
||||
[[related.indices]]
|
||||
name = 'series'
|
||||
weight = 100
|
||||
|
||||
[taxonomies]
|
||||
author = "authors"
|
||||
category = "categories"
|
||||
tag = "tags"
|
||||
series = "series"
|
||||
|
||||
[outputs]
|
||||
# DoIt CHANGED | 0.2.0
|
||||
home = ["HTML", "RSS"]
|
||||
page = ["HTML"]
|
||||
section = ["HTML", "RSS"]
|
||||
taxonomy = ["HTML", "RSS"]
|
||||
taxonomyTerm = ["HTML"]
|
||||
|
20
useful-snippets.md
Normal file
@@ -0,0 +1,20 @@
|
||||
{{< admonition type=example title="Example: Navigate to your home directory" open=false >}}
|
||||
You can change your shell by typing
|
||||
```
|
||||
cd ~
|
||||
```
|
||||
{{< /admonition >}}
|
||||
|
||||
Possible values:
|
||||
- note
|
||||
- abstract
|
||||
- info
|
||||
- tip
|
||||
- success
|
||||
- question
|
||||
- warning
|
||||
- failure
|
||||
- danger
|
||||
- bug
|
||||
- example
|
||||
- quote
|