❌

Normal view

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

Getting start with Emacs Text Editor

6 October 2023 at 17:50

Emacs, a versatile text editor, can initially seem tedious, but mastering a few basic shortcuts can make it a powerful tool. Here’s a simplified list of essential shortcuts for beginners.

Navigation

  1. Moving the Cursor

Up and Down Arrows: Move up and down.
Left and Right Arrows: Move left and right.
Home and End: Jump to the start and end of the line.


2) Scrolling

Page Up and Page Down: Scroll through the text.

Editing

  1. Cut, Copy, and Paste

    Ctrl + K: Cut text.
    Ctrl + Y: Paste text.


    2) Undo and Redo

    Ctrl + / or Ctrl + _: Undo.

    File Operations

    1. Opening and Saving

    Ctrl + X + Ctrl + F: Open a file.
    Ctrl + X + Ctrl + S: Save the current file.
    Ctrl + X + Ctrl + W: Save with a different name.


    2) Closing and Quitting

    Ctrl + X + K: Close the current file.
    Ctrl + X + Ctrl + C: Quit Emacs.

    Search and Replace

    Search
    Ctrl + S: Search forward.
    Ctrl + R: Search backward.
    Alt + % or Ctrl + X + R: Search and replace.

    Miscellaneous

    1. Help

    Ctrl + H + T: Open the Emacs tutorial.
    Ctrl + H + A: Search for a command.
    Ctrl + H + K: Describe a shortcut.


    2) Running Commands

    Alt + X: Run a command by name.


    3) Customization

    Alt + X + Customize: Access the customization interface.

    These simplified shortcuts will help you navigate, edit, and manage files in Emacs. As you get comfortable, you can explore more advanced features and customize Emacs to suit your needs. Emacs has a steep learning curve, but once you get the hang of it, you’ll find it to be a powerful ally for text editing and beyond.

    Happy editing!

    Title: Setting Up and Running KVM Virtualisation on Linux

    18 August 2023 at 16:09

    Virtualisation has revolutionised the way we use and manage computers, allowing us to create and run multiple virtual machines (VMs) on a single physical host. In this guide, we will walk through the steps to set up KVM on a Linux system and run a VM in terminal mode.

    Prerequisite: Before proceeding the following steps, one should have downloaded the stable Linux ISO on their local machine.

    Step 1: Preparing the Host System

    sudo apt update
    egrep -c β€˜(vmx|svm)’ /proc/cpuinfo

    This image has an empty alt attribute; its file name is image-22.png

    From the above output, you can deduce that virtualisation is enabled since the result printed is greater than 0. If Virtualisation is not enabled, be sure to enable the virtualisation feature in your system’s BIOS settings.

    Step 2: Enabling Virtualisation

    Next, we will enable virtualization in the BIOS/UEFI settings. Access your BIOS/UEFI setup during system boot and navigate to the β€œbias settings > configuration” section.

    Step 3: Installing Required Packages

    sudo apt install cpu-checker
    kvm-ok
    sudo apt install -y qemu-kvm virt-manager libvirt-daemon-system virtinst libvirt-clients bridge-utils
    sudo systemctl enable –now libvirtd
    sudo systemctl start libvirtd
    sudo systemctl status libvirtd
    sudo usermod -aG kvm $USER
    sudo usermod -aG libvirt $USER

    Step 4: Launching KVM Virtualisation

    virt-manager

    Step 5: Running Linux VM in Terminal Mode

    Please note that the following commands should be executed in the KVM terminal, not on the local machine.

    If you are using the server edition, you can skip the steps below.

    After successfully burning the ISO file to the VM, we can proceed with the process of converting the GUI into terminal mode by executing the commands below. Doing this will increase VM performance and reduce processing time.

    Backup the GRUB configuration file:

    sudo cp -n /etc/default/grub /etc/default/grub.backup

    Edit the GRUB configuration:

    sudo vim /etc/default/grub

    Modify the GRUB settings:

    • Disable the splash screen: Change GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" to #GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    • Set the default runlevel to text mode: Change GRUB_CMDLINE_LINUX="" to GRUB_CMDLINE_LINUX="text"
    • Enable console terminal: Remove the # from the line #GRUB_TERMINAL="console"

    Save and exit the editor by pressing :x.

    Update GRUB configuration:

    sudo update-grub

    Set the default target to multi-user (text mode):

    sudo systemctl set-default multi-user.target

    Conclusion:

    Conclusion: In this guide, we explored the process of setting up Kernel-based Virtual Machine (KVM) on a Linux system, enabling us to create and manage virtual machines. We also learned how to configure a Linux virtual machine to run in terminal mode for efficient resource usage. Virtualisation opens up a world of possibilities for testing, development, and server consolidation, allowing us to make the most of our hardware resources.

    Installing Drupal on Ubuntu: A Step-by-Step Guide

    17 August 2023 at 13:51

    Prerequisites: LAMP stack (Linux, Apache, MySQL, and PHP) should be installed.

    Step 1:

    Log in to the MySQL server as the root user:

    Create a new database and user for your Drupal site:

    CREATE DATABASE drupaldb;
    CREATE USER β€˜drupaluser’@’localhost’ IDENTIFIED BY β€˜your_password’;
    GRANT ALL PRIVILEGES ON drupaldb.* TO β€˜drupaluser’@’localhost’;
    FLUSH PRIVILEGES;
    EXIT;

    Step 2:

    Download the latest drupal zip file

    Rename the zip file

    Unzip the file

    Sudo configuring drupal

    Creating the drupal configuration file

    Copy the command inside in the file

    Adding the host name to multiple application

    Add IP and unique host name to run multiple application with getting collide. Likewise here in (eg., drupal.localhost.in)

    Enabling the virtual host and rewriting the module

    Finally enter your http://drupal.localhost.in in your browser.

    Similarly we can install the applications such as wordpress and mediawiki with the steps and comments provided above. install file name, Db creation, and host file configuration could be vary.

    MariaDB Backup and Restore

    11 August 2023 at 14:55

    Step1: Before proceeding to backing up and restoring the database. we should ensure that binary log must be enabled. In other to open the log page execute the below command.

    sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf

    Step 2: After opening the log page uncomment the below line.

    log_bin = /var/log/mysql/mysql-bin.log
    :wq! save and exit

    Step 3: It would be great if you could restart the service whenever you tweak the log script. In other to restart use the below command.

    sudo systemctl restart mariadb.service

    Step 4: All set to Backing up the DB now. The following code would backup the DB and redirecting it to our storage.

    mysqldump -u root -p AAA > AAA.sql

    Step 5: Drop command is used to delete the databases or tables. Here we delete whole AAA database for our experience.

    mysql -u root -p

    drop database AAA;

    Step 6: Before proceeding to restore the DB it is required to create a dummy database with exact same name of the DB as the one to be imported.

    mysql -u root -p

    create database AAA;

    CTRL + D or exit;

    One can follow the same process for multiple databases or the entire database. Please note that the commands may slightly vary depending on the number of databases.

    Step 7: Organizing backup files can be challenging; however, there is a command to obtain the backup with a timestamp.

    mysqldump -u root -p AAA > AAA_date +"%Y-%B-%d_%R".sql

    Step 8: When dealing with a large volume of data to be exported, it’s necessary to compress and unzip the datasets for convenient usage.

    mysqldump -u root -p AAA | gzip > AAA.sql

    Step 9: To unzip the above command use the following command below.

    gzip -d AAA.sql.gz

    ❌
    ❌