❌

Normal view

There are new articles available, click to refresh the page.
Before yesterdayMain stream

Installing Arch Linux in UEFI systems(windows)

12 November 2024 at 15:22

This will be a very basic overview in what is to be done for installing Arch Linux. For more information check out Arch wiki installation guide.

The commands shown in this guide will be in italian(font).

Step 1: Downloading the required files and applications

I have downloaded a few applications to help ease the process for the installation. You can download them using the links below.

Rufus:
This helps in formatting the USB and converting the disc image file to a dd image file. I have used rufus, you can use other tools too. This only works on windows.
rufus link

BitTorrent
The download option in the wiki page suggests we use BitTorrent for downloading the disc image file.
BitTorrent for windows

Arch Linux torrent file
This is for downloading the Arch Linux Torrent File. The download link can be found in the website given below.
Arch Linux Download Page

Step 2: The bootable USB

You will need a USB of size at least 2GB and 4GB or above should be very comfortable to use.

First open the BitTorrent application or the web based version and upload the magnet link or the torrent file to start downloading the disc image file.

Then to prepare the USB:

  1. Launch the application to make the bootable USB like rufus.

2.In the device section select your USB and remember all the data in the drive will be lost after the process.

3.In boot selection, choose the disc image file that was downloaded through torrent.

4.In the target system select UEFI as we are using a UEFI system.

5.In the partition scheme make sure GPT is selected.

6.In file system select fat32 and 4096 bytes as cluster size.

7.When you click ready it will present you with 2 options, select the dd image file which is not the default option.

After the process is done the USB will not be readable to windows, so there is no need to panic if you cannot access the USB.

If you are using a dual boot make sure you have at least 30 GB of unallocated space.

I would recommend to turn off bitlocker settings as it could give rise to other challenges during the installation.

Then get into the UEFI Firmware settings of your system. One easy way is to:
1.Hold shift key while pressing to restart the computer
2.Go into Troubleshoot
3.Go into Advanced Settings
4.Select UEFI Firmware Settings
5.You will have to restart again but you will be in the required place.

Turn off secure boot state. It is usually in the security settings.

Select save changes and exit.

When you log back into your system ensure that secure boot state is off by going into system information.

Go back to UEFI Firmware settings by repeating the process.

In the boot priority section, give your USB device the highest priority. This is usually in the boot section. Then select save changes and exit.

Step 3: Preparing Arch Linux Installation

When all the above steps are done and the system restarts, you will be prompted with a few options. Select Arch Linux install medium and press 'Enter' to enter the installation environment. After this you will need to follow a series of steps.

1. Verifying you are in UEFI mode.

To do that type the command
cat /sys/firmware/efi/fw_platform_size

You should get the result as 32 or 64. If you get no result then you may not be using UEFI mode.

2. Connecting to the internet:

If you are using an ethernet cable then you don't have to worry as you might already be connected to internet.
Use the command
ping -c 4 google.com
or another website to ping from to check if you're connected to the internet.

To connect to wi-fi, type in the command
ip link

This should show you all the internet devices you have. Your wi-fi should typically be wlan0 or something like wlp3s0, which is your device name.

Then type the command
iwctl

This should get you into an interactive command line interface.
You can explore the options by using the command
help

My device name was wlan0 so I'm using wlan0 in the command I'm going to show if yours is different make the appropriate changes.

To connect to the wifi use the command
station wlan0 connect "Network Name"
where "Network Name" is the name of your network.

If you want to know the name of your network before doing this you can try the command
station wlan0 get-networks

To get out of the environment simply use the command
exit

After you exit, you can verify your connection with
ping -c 4 google.com

If it doesn't work, try the command
ping -c 4 8.8.8.8

If the above also doesn't work, the problem may lie with your network.

However if the second option works for you, the fix would be to manually change the DNS server you're using.
To do that, run the command
nano /etc/systemd/resolved.conf

In this file if the DNS part is commented using a #, remove the # and replace it with a DNS server you desire. For eg: 8.8.8.8

ctrl + x to save and exit

Now try pinging a website such as google.com again to make sure you're properly connected to the internet.

3. Set the proper time

When you connect to the internet you should have the proper time. To check you can use the command
timedatectl

4. Create the partitions for Arch Linux

To check what partitions you have, use the command
lsblk

This will list the partitions you have. It will be in the format /dev/sda or /dev/nvme0n1 or something else. Mine was /dev/nvme0n1 so I'll be using the same in the commands below.

To make the partitions, use the command
fdisk /dev/nvme0n1

This should bring you to a separate command line interface.

It will give you an introduction on what to do.

Now we will create the partitions.
To create a partition, use the command
n

It will show you what you want to number your partition and the default option. Click enter as it will automatically take the default option if you don't enter any value. Let's say mine is 1.

It will show you what sector you want the partition to start from and the default option. Click enter.

Then it will ask you where you want the sectors to end: type
+1g

1g will allot 1 GB to the partition you just created.

Then create another partition in the same way, let's say mine is sector number 2 this time and finally instead of
+1g use +4g

This will allot 4 GB to the second partition you just created.

Create another partition and this time leave the last sector to default so it can have the remaining space. Let's say this partition is number 3.

partition 1 - EFI system partition
partition 2 - Linux SWAP partition
partition 3 - Linux root partition

5. Prepare the created partitions for Arch Linux installation

Here, we are going to format the memory in the chosen partitions and make them the appropriate file systems.

For the EFI partition:
mkfs.fat -F 32 /dev/nvme0n1p1

This converts the 1 GB partition into a fat32 file system.

For SWAP partition:
mkswap /dev/nvme0n1p2

This converts the 4 GB partition into something that can be used as virtual RAM.

For root partition:
mkfs.ext4 /dev/nvme0n1p3

This converts the root partition into a file system that is called ext4.

6. Mounting the partitions

This is for setting a reference point to the partitions we just created.

For the EFI partition:
mount --mkdir /dev/nvme0n1p1 /mnt/boot

For the root partition:
mount /dev/nvme0n1p3 /mnt

For the swap partition:
swapon /dev/nvme0n1p2

Step 3: The Arch Linux Installation

1. Updating the mirrorlist (optional)

The mirrorlist is a list of mirror servers from which packages can be downloaded. Choosing the right mirror server could get you higher download speeds.

This step isn't required as the mirror list is automatically updated when connected to the internet but if you would like to manually do it, its in the file
/etc/pacman.d/mirrorlist

2. Installing base Linux kernel and firmware

To do this, use the command
pacstrap -K /mnt base linux linux-firmware

Step 4: Configuring Arch Linux system

1. generating fstab

The fstab is the file system table. It contains information on each of the file partitions and storage devices. It also contains information on how they should be mounted during boot.

To do it, use the command:
genfstab -U /mnt >> /mnt/etc/fstab

2. Chroot

Chroot is short for change root. It is used to directly interact with the Arch Linux partitions from the live environment in the USB.

To do it, use the command:
arch-chroot /mnt

3. Time

The timezone has 2 parts the region and the city. I am from India so my region is Asia and the city is Kolkata. Change yours appropriately to your needs.

The command:
ln -sf /usr/share/zoneinfo/Asia/Kolkata /etc/localtime

We can also set the time in hardware clock as UTC.
To do that:
hwclock --systohc

4. Installing some important tools

The system you have installed is a very basic system, so it doesn't have a lot of stuff. I'm recommending two very basic tools as they can be handy.

i) nano:
This is a text editor file so you can make changes to configuration files.
pacman -S nano

ii) iwd:
This is called iNet wireless daemon. I recommend this so that you can connect to wi-fi once you reboot to your actual arch system.
pacman -S iwd

5. Localization

This is for setting the keyboard layout and language. Go to the file /etc/locale.conf by using
nano /etc/locale.conf

I want to use the english language that is the default in most devices so for doing that you have to uncomment(remove the #) for the line that says
LANG=en_US.UTF-8

As there are a lot of lines you can search using ctrl+F.

Then ctrl+X to save and exit.

Then use the command
locale-gen

This command generates the locale you just uncommented.

6. Host and password

To create the host name, we should do it in the /etc/hostname file. Use
nano /etc/hostname

Then type in what your hostname would be.
ctrl + X to save and exit.

To set the password of your root user, use the command
passwd

7. Getting out of chroot and rebooting the system

To get out of chroot simply use
exit

Then to reboot the system use
reboot

Remove the installation medium(USB) as the device turns off.

Step 5: Enjoy Arch Linux

Arch Linux is one of the most minimal systems. So you can customize it to your liking. You can also install other desktop environments if you feel like it.

One day One Command(CLI)

30 October 2024 at 15:08

Day 1: pwd
1.pwd: This command stands for Print Working Directory. As the name suggests it helps us know the current/working directory.
Syntax: pwd
1 a.pwd -P: Stands for pwd physical. It returns the current physical directory ignoring all the symbolic links in the path.
Syntax: pwd -P
1 b.pwd -L: Stands for pwd logical. It returns the current logical directory completely preserving the symbolic links in the path.
Syntax: pwd -L

Day 2: poweroff

$ sudo poweroff The poweroff command shuts down the system safely and immediately terminating all processes where unsaved work could be lost. It also unmounts all file systems then powers off the hardware. It is a quick way to turn off the system safely. Users in most cases cannot operate this command without sudo.
$ sudo poweroff --force This command shuts the down the system immediately without terminating any processes. It is generally unsafe to do so. It could be used if the system is unresponsive.
$ sudo poweroff --halt This command works just the way poweroff works but it does not finally cut the power to the hardware systems. It could be used if you want to terminate all the current running processes.

Day 3: ls

  1. ls: The ls command stands for list and it is used to list the files and directories. If used simply without any context it lists the files and directories in the current working directory. It can also be used to list files in other directories by following it up with the path to the directory. To list the files and directories of a file that requires root access we can use sudo on which otherwise we get permission denied. Syntax:ls ls /path/of/directory sudo ls /path/of/restricted directory 3 a.ls -l: This command does the same as ls files with more details. It gives more details such as permissions, ownership, size, date last modified, etc. Syntax:ls -l 3 b.ls -a:This command like the ls file also shows files and directories including hidden ones. Those files usually start with a '.'. Syntax:ls -a 3 c.ls -lh:It is just like ls -l but is in a more human readable format. The sizes are mentioned in kb,mb, etc.

Day 4: cat

  1. cat: This command stand for concatenate. When used on a file it shows the content of the file. If used on executable files or on files containing images they usually return garbled text and symbols as it is interpreting binary data. This command can also copy the content of a file and append it to another file. cat file1 >> file2 appends the contents of file1 to file2. It can also combine two files and copy it to another file. cat file1 file2 > newfile combines the contents of file1 and file2 in newfile. Syntax: cat filename cat file1 >> file2 cat file1 file2 > newfile 4 a.cat -n: This command does the same as cat and numbers all the lines in the output. Syntax: cat -n filename 4 b.cat -b: This command does the same as cat -n but it doesn't number the blank lines. Syntax: cat -b filename 4 c.cat -s: This command does the same as the cat command but it suppresses repeated blank lines into only one blank line. Syntax: cat -s filename 4 d.cat -T: This command does the same as cat but show tabs as ^I helping us differentiate between tabs and spaces. Syntax: cat -T filename 4 e.cat -E: This command is similar to cat -n and instead of numbering all the lines it leaves the $ symbol at the end of a line to help us distinguish between the end of a line or if they just continue. Syntax: cat -E filename 4 f.cat -A: This command is a combination of cat -E and cat -T where it shows the end of each line by leaving a $ symbol and helps distinguishing spaces from tabs by replacing tabs with ^I. Syntax: cat -A filename

Some of these options can be used together.
For eg: cat -ns numbers the lines from start and shortens the repeated blank lines to just one and the numbering is done on the remaining blank line. cat -ET does the same as cat -A. cat -bE numbers only the non blank lines leaves a $ symbol at the end of a line, etc.

Day 5: echo

  1. echo: The echo command sends a message or a variable to all active users or can be used to create or overwrite files. Syntax: echo "Hi everyone" echo $HOME echo "the text" > filename.extension

5 a.echo -e: This command works the same way as echo does but it takes in escape sequences as well. For eg: \n,\t,etc.
Syntax: echo -e "First Line\nNext Line"

Day 6: head and tail

=====================================

I'm sorry to have missed yesterday. So today I will be doing 2 commands.

=====================================

  1. head: It displays the first few lines of a file it is used with. The default number of lines it shows is 10. If used on a file containing binary data it outputs garbled texts and symbols. When used on multiple files it will display each file with a file header.

Syntax: head file.extension
head file1.txt file2.txt

=====================================

6 a. head -n: It behaves the same as head but instead of the default number of lines, it displays the number of lines mentioned. If the mentioned number exceeds the data in the particular file then it displays all of the file without any errors. If this command is used on multiple files it outputs the number of lines in each of the files.

Syntax: head -n file.extenstion
head -n 5 file.txt

=====================================

6 b. head -c: It behaves similar to head -n but instead of the lines it takes number of bytes which the user has mentioned. Similarly, it displays the entire file if the number of bytes mentioned is more than what is available without any errors.

Syntax: head -c file.extension
head -c 25 abc.txt

=====================================

The commands after this may not work for non GNU systems.

=====================================

6 c. head -q: When this is used on multiple files it suppresses the file headers. It can also be used in combination with head -c or head -n.

Syntax: head -q file1.txt file2.txt
head -q -n 2 file1.txt file2.txt

=====================================

6 d. head -v: When this is used even on a single file then the file headers are displayed. If used together with head -q, head -v has the higher priority in whatever order it is done. So head -q -v or head -v -q will always display the headers.

Syntax: head -v file.txt

=====================================

  1. tail: This command is similar to head command with the only difference being it displays the last few lines.

Syntax: tail file.txt

=====================================

7 a. tail -n: This like the tail command instead of the last default number of lines we can specify the number of lines we want.

Syntax: tail -n file.txt

=====================================

7 b. tail -c: This command outputs the last number of specified bytes of the file.

Syntax: tail -c file.txt

=====================================

The commands after this may not work on non GNU systems.

=====================================

7 c. tail -f: This command works similar to the tail command, at the beginning it only displays the last 10 lines but it will continue to give more outputs as the file grows. This can be useful for growing log files. If data is overwritten instead of appended to the said file, tail -f may not work properly.

Syntax: tail -f file.extension

=====================================

7 d. tail -F: This is just a better version of tail -f. If it encounters any errors such as the file is temporarily deleted or being overwritten it retries and when the file is available again, it starts the process again.

Syntax: tail -F file.extension

=====================================

7 d i. tail -F/f --max-unchanged-stats: As tail -F keeps on checking the file indefinitely, it can be stopped using this command. We can issue the number of times tail -F can retry and if there is constantly no updates in the file it will stop retrying.

Syntax: tail -F --max-unchanged-state=5 file.extenstion

=====================================

7 d ii. tail -F/f --pid: This command is the same as tail -F but it stops retrying after a specific process ends.

Syntax: tail -F --pid= file.extension
tail -F --pid==123 logfile.txt

=====================================

7 e. tail -q: This suppresses the file headers if multiple files are used.

Syntax: tail -q file1.extension1 file2.extension2

=====================================

7 f. tail -v: This forces the file headers in the output even if only one file is used.

Syntax: tail -v file.extension

*************************************

Day 7: grep

=====================================

  1. grep: This command is used to look for a given pattern in a files or output lines.

Syntax: grep "pattern" filename

=====================================

8 a. grep -i: This command works the same way as grep but it is case insensitive.

Syntax: grep -i "PaTtern" filename

=====================================

8 b. grep -r: This command searches for the given pattern recursively completely in a given directory. It searches every file or director that is contained in the given directory and gives its results.

Syntax: grep -r "pattern" filename

=====================================

8 c. grep -n: This command does the same as the grep command but it also numbers the output lines.

Syntax: grep -n "pattern" filename

Python(the programming language)

29 October 2024 at 12:30

Python: A programming language which many consider beginner friendly. A language which some programmers would argue to other aspiring programmers not to learn it first. Python is widely used in artificial intelligence programs, machine learning, data science, ethical hacking and so much more.

Created in February 20, 1991 by Guido Van Rossum, it is said that the name was inspired from the BBC TV show Monty Python's Flying Circus as the creator was a big fan of the show. It is said that he wanted to create a programming language that was easy to read compared to other programming languages at the time which people considered to have a more difficult syntax.

Python is one of the most used programming languages today. Some of the important reasons are that it is an open source programming language, many people would argue it has a very large library for every field in programming. It also has a large community with people who also create custom libraries, it even has custom IDEs. It is also used in many fortune 500 companies.

With all this why is there a group of people who argue this is a language beginners can learn and sometimes even the same people from the same group that argue that beginners shouldn't start learning it? The main argument the 2nd group advocates is that the programming language is too easy compared to other languages and when they try to learn other languages they might struggle in doing so.

There is no particular answer to the question, it just depends on the person learning it. The first programming language I properly learnt was python, but learning other languages after that was easy as i had something to compare to and I wasn't learning something complex without any context. In fact learning other languages made me understand how python could be working on a deeper level that I was unaware of by only knowing python and I hope that others who start by learning python have a similar experience.

I think that python is definitely a great programming language due to its simplicity while coding and trying to understand it. It also has what some people would consider disadvantages that it is not closer to the system compared to other languages but there are other people who consider the same statement to be an advantage for python. So it all comes down to what a particular person wants and sometimes python just occurs to be a very good option.

Internet Relay Chat(IRC)

28 October 2024 at 15:03

Internet relay chat (irc for short) is one of the first text based chat systems in the world. Created in 1988 by Jarkko Oikarunen is one of the best creations in technology that have directly influenced the modern day messaging platforms.

It uses server and client method to operate. People can join an IRC server and communicate with others in the same server. As anyone can create a server for a chatroom(there are many servers available either for a particular group of people or for a specific topic) there is no specific place where data is stored rather a group of servers around the world. This can also prove to be a secure place for communication as the servers doesn't belong to 3rd parties.

It also introduced scripting in messaging such that you can use commands while messaging. In modern day messaging tools this feature can be seen in apps such as discord, instagram, etc(eg: /silent in instagram).

This is one of the best ways for people to communicate through technology to develop a community or form a particular group of people or even one on one messages.

I like IRC as it gives me a different experience. I feel a lot less watched as 3rd parties don't blast me with ads with the information from what I message others. It also a looks a lot cooler like in the movies to text from a terminal based messaging service.

❌
❌