Loading...
Installing Arch Linux - Minimalist Version
This is a step by step version to install ArchLinux.
First, What is ArchLinux?
The concept of "The Arch Way" . . Simplicity, Code-Correctness over Convenience, User Centric, Openess and Freedom.
Quote - 'Simplicity is the ultimate sophistication.'
ArchLinux gives you the freedom to do anything, whatever you want, supported by a huge Wiki.
But the distro is for the intermediate linux users who have some experience in using a linux distro and know how to operate on a non-GUI operating system and build a file from source.
Now, without any time wastage, the process of installing a minimalist version of ArchLinux
- Get the latest image of ArchLinux from its page ArchLinux Download.
- Boot it into the system or the virtual machine, whichever you like.
- Select 'Boot Arch Linux (x86_x64)'
- Its is recommended to have an internet connection and to test the connection use 'ping command'.
- Using fdisk -l command, prepare the hard drives for the installation.
- Using cfdisk command, enter the preparation menu and make a root partition (/dev/sda1) as primary, swap partition (/dev/sda2) as primary, and home partition (/dev/sda5) as logical.
- Save the configuration and exit it. You can use fdisk -l command to get the view of the hard drives now.
- Use mkfs.ext4 /dev/sda1 and mkfs.ext4 /dev/sda5 to create the disk file system.
- To initialise SWAP use mkswap /dev/sda2 and the swapon /dev/sda2 commands.
- Run lsblk command to check evrything is right or not.
- Then comes, installing the Arch Base system. Use the following commands:
mount /dev/sda1 /mnt
mkdir /mnt/home
mount /dev/sda5 /mnt/home - Initialise the package manager list by nano /etc/pacman.d/mirrorlist command. And press Enter(default)
- To boot from partitions we use genfstab -U -p /mnt >> /mnt/etc/fstab command.
- Now comes the system configuration, Configure the chroot by arch-chroot /mnt and set language by editing locale.gen file by nano /etc/locale.gen
- Exit it and type
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8 - Enter the location as ln-s /usr/share/zoneinfo/Asia/Kolkata /etc/locatime (List can be seen on ls /usr/share/zoneinfo)
- Configure hardware clock by hwclock --systohc -utc
- Uncomment [multilib] from pacman.conf file by nano /etc/pacman.conf
- Synchronise and update database using pacman -Syu
- Change the password using passwd command.
- Add new user in the system using useradd -mg users -G wheel,storage,power -s /bin/bash your_new_user
- Change its password using passwd command.
- Install sudo package bu pacman -S sudo
- Edit /etc/sudoers file using nano and uncomment “%wheel ALL=(ALL) ALL
- Last step is to install the bootloader:
pacman -S grub
grub-install /dev/sda
pacman -S os-prober
grub-mkconfig -o /boot/grub/grub.cfg - Congratulations, ArchLinux is installed with minimalist base.
Now exit the chroot environment by
exit
exit
umount /mnt/home
umount /mnt
reboot
You can also add adesktop environment to ArchLinux to make it a GUI based OS, which will be covered in later tutorials.
Filed Under:
Arch,
Archlinux,
how to,
installation,
linux,
Minimalist,
virtual,
vmware
on Thursday, 21 August 2014
How to find and return a Maximum occurring Character in a Input String.
/***Write an efficient C function to return maximum occurring character in the input string e.g., if input string is “test string” then function should return ‘t’. Input string = “test” 1: Construct character count array from the input string. count['e'] = 1 count['s'] = 1 count['t'] = 2 2: Return the index of maximum value in count array (returns ‘t’). ****/ #include <stdio.h> #include <stdlib.h> #define NO_OF_CHARS 256 int *getCharCountArray(char *); char getIndexOfMax(int *, int); /* Returns the maximum occurring character in the input string */ char getMaxOccuringChar(char *str) { int *count = getCharCountArray(str); return getIndexOfMax(count, NO_OF_CHARS); } /* Returns an array of size 256 containg count of characters in the passed char array */ int *getCharCountArray(char *str) { int *count = (int *)calloc(NO_OF_CHARS, sizeof(int)); int i; for (i = 0; *(str+i); i++) count[*(str+i)]++; return count; } char getIndexOfMax(int ar[], int ar_size) { int i; int max_index = 0; for(i = 1; i < ar_size; i++) if(ar[i] > ar[max_index]) max_index = i; /* free memory allocated to count */ free(ar); ar = NULL; return max_index; } int main() { char str[] = "sample string"; printf("%c", getMaxOccuringChar(str)); getchar(); return 0; } }
Hello World !
/************************************************************************* * Compilation: javac HelloWorld.java * Execution: java HelloWorld * Traditionally First Program *************************************************************************/
public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, World !"); } }
Guidelines of Commenting
~~GuideLines of Commenting~~
- First, Please do not Spam. It is meant for education so please do not spam or use any abusive language.
- There is a "HTML Encode Tool" for the people who want to ask or optimise the code snippets in the post. It is simple to use. You just have to enter the code and it'll produce a HTML friendly version of the code.
- If you want to share a post that can benefit others, feel free to contact me and I'll publish your article.
- If you have any complaints or Content that you want to put me down from the blog, you can contact me.
Filed Under:
comment,
complaints,
contact,
education,
Encode,
guideline,
guidelines,
help,
HTML Encode Tool,
no-spam,
post,
publish,
share,
spam
on