Showing posts with label Ubuntu. Show all posts
Showing posts with label Ubuntu. Show all posts

Friday, January 29, 2021

Setting up Linux Desktop Environment using Openbox Window Manager in Ubuntu

Hi,

In this post we are going to see how to build a Custom Linux Desktop Environment from scratch using Openbox Window Manager.

Before we proceed further, if we have a linux system with no desktop environment would be of much help to proceed with ease, if you have one already you can skip the following link which talks about having a linux system with no desktop environment.


Desktop Environment Packages Installation

lightdm : The Display Manager
The first and foremost item in the installation list is the Light Display Manager AKA lightdm, it is a cross desktop display manager...which can be installed using the command given below....

$ sudo apt install lightdm

The installation would take sometime, please hold on till it completes...

openbox-gnome-session : The Session Manager
Runs a GNOME session with Openbox as the window manager

To Install Openbox GNOME Session, key in the following command at the terminal...

$ sudo apt install openbox-gnome-session

openbox : The Window Manager
Openbox is a highly configurable, next generation window manager with extensive standards support

To install openbox, run the command below...

$ sudo apt install openbox

gnome-terminal : The Terminal Emulator
To Install GNOME Terminal Emulator execute the following command

$ sudo apt install gnome-terminal

obmenu : The Openbox Menu
Let us now install Openbox Menu, use the following command to have Ob Menu installed

$ sudo apt install obmenu

gedit : The GNOME Text Editor
Well this is not a part of window manager installation.... we need this utility to configure the desktop environment

Key in the following command at the terminal  to have this utility installed...

$ sudo apt install gedit

tint2 : The System Tray
As we all know the system tray is one of the key features in the desktop environment, which can be made available using the following command...

$ sudo apt install tint2

docky : A Simple Docker
This utility is again a additional ingredient in the desktop environment, which enhances the user experience to an other level...

This utility can be installed using the command given below....

$ sudo apt install docky

nitrogen : Desktop Background Browser and Setter
This utility is used to set the background for the desktop. We can have it installed using the following command...

$ sudo apt install nitrogen

ubuntu-wallpapers : Utility for Wall Papers
This is an accessory to have good images for the background, if you have better images than this utility can give, skip this step of installing...

$ sudo apt install ubuntu-wallpapers

pcmanfm : The File Manager
Inorder to have clear differentiation between folders and files, we should have a file manager in place to handles files differently, well this utility would suffice the need and to install the same execute the following comnand

$ sudo apt install pcmanfm

lxappearance : The Theme Switcher
LXAppearance is the standard theme switcher of LXDE. Users are able to change the theme, icons, and fonts used by applications easily.

Use the following command to install LXAppearance

$ sudo apt install lxappearance 

xcompmgr : The Composite Manager
Xcompmgr is a simple composite manager capable of rendering drop shadows and, with the use of the transset utility, primitive window transparency. Xcompmgr is a lightweight alternative to Compiz and similar composite managers.

To install xcompmgr use the following command

$ sudo apt install xcompmgr

firefox : The Browser
This utility does not require any description....

To install firefox run the command below...

$ sudo apt install firefox

pavucontrol : The PulseAudio Volume Control
PulseAudio Volume Control (pavucontrol) is a simple GTK based volume control tool ("mixer") for the PulseAudio sound server

To install pavucontrol use the following command

$ sudo apt install pavucontrol

volti : The Audio Volume Controller
Volti is a lightweight GTK+ application for controlling audio volume from system tray/notification area.

To install volti, use the command below..

$ sudo apt install volti

lxtask : The Task Manager
LXTask is the standard task manager and system monitor of LXDE. It starts via Ctrl+Alt+Del and is extremely lightweight.

To install lxtask, use the command below...

$ sudo apt install lxtask

gconf-editor : Editor for GConf Configuration Database
GConf-Editor is a tool used for editing the GConf configuration database.

To install GConf Editor, run the following command.

$ sudo apt install gconf-editor

Rebooting Virtual Machine
Now at this stage, we have completed installing the necessary components/packages required to have basic Desktop Environment but I cannot guarantee how they are placed.

To see how and where they are placed let us reboot the system...

$ sudo reboot

The above command would prompt you for the password, please provide one associated with the user.

Initial Look and Feel of the System with Openbox
After you reboot the system, you will have the login screen and the default desktop environment similar to the one given in the images

Login Screen by GNOME


Desktop Environment Selection


Login Screen by Openbox


Keying in Password


The Openbox Desktop Environment


Decorating the Desktop Environment

Crediting(Create and Edit) OpenBox Autostart
1. Open Terminal Emulator from the OpenBox Menu

2. Create a directory named openbox at the location ~/.config using the following command
$ mkdir ~/.config/openbox

3. Create a autostart.sh file at the location ~/.config/openbox/autostart.sh, using the following command..
$ touch ~/.config/openbox/autostart.sh

4. Use the following command to edit the autostart.sh file of openbox
$ gedit ~/.config/openbox/autostart.sh

5. Include the following entires in autostart.sh file
tint2 &
docky &
nitrogen --restore &
xcompmgr &
volti &

6. Save the file autostart.sh

7. Reboot the system

Having done all the mentioned steps, you would have a desktop something like the one shown in the image below....


Editing Openbox Menu
1. Open a Terminal emulator and run the following command
$ obmenu &


You would have the obmenu utility dressed up like the one shown in the image below...


2. Expand Openbox 3


3. Renaming Exit Menu Item

Scroll down and select the Exit menu item, click on the Label field to change the name to Logout



4. Save the entry

5. Creating Reboot and Shutdown Entries..... follow the steps given below to create menu items...

    5.1 Click on New Item form the tool bar and name the new entry as Reboot with command reboot.


    5.2 Click on the New Item again from the tool bar and name the new entry as Shutdown with   command shutdown now



6. You can use the arrow tools to move the menu item up and down according to your needs, well the image below would give you the needs I had....


7. Create a menu item for changing the background

New Item -> Lable : Change Background 
              -> Execute : nitrogen



8. Save the changes and Exit.

The Image below would give you the picture of the menu after the changes....



Positioning Docker on the Left Side
In this section let us reposition the docker which is at the bottom and along with system tray.

1. Click on the anchor icon : when you click on the anchor icon in the docker, you would have a window along with the tool tip saying "Drag to repositon" similar to the one given in the image below...


2. Now click and hold the anchor icon and drag to the any of the sides of  the screen, in my case I would like to have the docker at the left hand side of the screen, the reference image is given below...


3. Set the hiding propery to Intellihide, by default this is set None.



Setting an Icon Theme
In this section, I would like to disclose on how to set an Icon Theme for the desktop. To have one we have to use the package lxappearance

1. Open the Terminal Emulator and key in the following command
$ lxappearance &


You would have a window like the one given below...


2. Click on the Icon Theme tab


3. Select the theme which works for you and Apply


Working on Tint2 Panel Themes
In this section we can discuss on working with Tint2 Panel Themes

1. Click on the Tint2 Settings Icon : On the deep left side of the system tray, you would find an icon left to firefox icon called Tint2 Settings Icon, click the icon to have Tint2 Panel Settings.


2. Close the properties window


3. Now select a theme that works for you, my case I have selected the theme shown in the image below...


4. Set the theme as the default theme by clicking on the "Make default" button given on the top.


Setting the Desktop Background
In this section of discussion, let us deal with setting desktop background.

1. From the ObMenu, select/click the Change Background.


2. Click on preferences


3. Click on Add


4. Navigate to the folder File System : /usr/share/backgrounds and click on select


5. Click OK


6. Select the images you like to set it as desktop background and Apply.


7. Set the fill style to "Zoomed Fill" and Apply



Removing Icons from the system tray
In this section, we talk how to remove the icons that we found on the system tray...

1. Click on the Tint2 Panel Theme Icon on the deep left side of the system tray


2. Click the "Launcher" Tab


3. From the above image you can move the items that you have on the left hand side to the right, in my case I would like to have firefox to be moved from left to right...


4. Remove the desktop name


On the Task bar tab, un check the "show desktop name" property


4. Apply the changes and Click OK, the result of the applied changes is displayed below...


Pin to Dock
This section is a utility section, you can skip if you want.

Open up a terminal and run the following command to pin to dock(right click on the icon to pin it) on docker

$ gedit
$ lxtask
$ pcmanfm




Tuesday, February 11, 2020

Creating a simple and new site helloworld.com using Apache Web Server in Ubuntu

Hi All,

In this post i am going to talk about creating a simple site called "helloworld.com" using Apache Web Server in Ubuntu

The details discussed or furnished here is not specific to a particular version of ubuntu, you can apply these steps to other version of ubuntu as well...

Without wasting time let us get on with business...

Installation of Apache Web Server

The first and foremost steps involved in the process is the installation of Apache Web Server, usually the ubuntu distributions comes along with apache web server pre-installed but if you do not find one in the distribution you use, you can install the same using the following commands

> sudo apt update
> sudo apt install apache2

Make sure the above commands executed successfully...

if the command executions were successfull, we could confirm the same using the browser by typing the address "localhost" in the address bar and the browser should display a page something like the one given below...



Creating folder and files

Open up a terminal, and fire the commands below at the prompt...

> cd /var/www
> sudo mkdir /var/www/helloworld
> cd /var/www/helloworld
> sudo touch index.html

Open the file "index.html" using your favourite text editor, in my case it is going to be "vi" and fill in the file with some test contents as given below
sudo vi index.html
<html>
<head>
  <title> HelloWorld </title>
</head>
<body>
  <p> Greeting from HelloWorld.</p>
</body>
</html>

Save the file and exit from the text editor.

Virtual Host Configuration

Open a terminal and fire the command at the prompt one after the other...

> cd /etc/apache2/sites-available/
> sudo cp 000-default.conf helloworld.conf
> sudo vi helloworld.conf

now is the time to update the newly created or copied configuration file called "helloworld.conf"

There are three important configuration items you could see in the configuration file...

1. ServerAdmin
2. DocumentRoot
3. ServerName

Now update these configuration items accordingly, I believe the above mentioned configuration items are self explanatory in case if you want an example you can refer below...

Example:

ServerAdmin      admin@helloworld.com
DocumentRoot   /var/www/helloworld/
ServerName       helloworld.com
With that we have finished the virtual host configuration.

Updating hosts file

We have to include the domain "helloworld.com" in the hosts configuration file, to do that...

Open a terminal and execute the command below...
> sudo vi /etc/hosts

Include the host configuration as mentioned below...



Save the file and exit form the text editor.

Activating VirtualHost

We are at the final step to have our site up and running...

Open a terminal and navigate to the location of the file "helloworld.conf" i.e as given below...
> cd /etc/apache2/site-available

Fire the below commands to have the site activated...
> sudo a2ensite helloworld.conf
> service apache2 reload

Testing
Open up a browser and hit the address bar with the following address...

"helloworld.com"

You should have something like the image given below....

Well that is it, we have successfully created a new site using Apache Web Server.

Hope you had great time reading...

Thanks.


Saturday, August 10, 2019

Running Multiple Instances of MySql in ubuntu 16.04

Hi,

In this post we will discuss about having multiple instances of mysql on a server machine.

I am trying  to establish the objective here using MySql-5.7.25 on Ubuntu, you can do the same with other version of MySql as well

If you do not have one, you can refer an other article of mine to install MySql Server, the link to it is given below

MySql Server Installation in Ubuntu

1. Disabling mysqld in AppArmor 
The first and foremost is disabling mysqld using AppArmor tool, Ubuntu is shipped with this tool by default and if not you can install the same using the following web page as reference...

Installation of AppArmor

Create a link to "usr.sbin.mysqld" in disable folder as follows...

Move to folder "/etc/apparmor.d/disable" and provide the command below to have mysql daemon disabled at the start up
> sudo ln -s ../usr.sbin.mysqld usr.sbin.mysqld

RESTART YOUR MACHINE

2. Creating Directories and Files

The second step is to create required directories for each instances of mysql, the following commands would help to create those directories for you.

I have chosen "/opt" directory as my location to put the directories in but, you can choose to have your convenient location to create directories...

The below commands would ask to provide the password before the execution, provide the one associated with the account.

Creating directories for Instance One
> sudo mkdir -p /opt/mysql/one/data
> sudo mkdir -p /opt/mysql/one/log
> sudo touch /opt/mysql/one/log/mysql.log
> sudo chown -R mysql:mysql /opt/mysql/one
> sudo /usr/sbin/mysqld --initialize --explicit_defaults_for_timestamp --user=mysql --basedir=/opt/mysql/one --datadir=/opt/mysql/one/data

Creating directories for Instance Two
> sudo mkdir -p /opt/mysql/two/data
> sudo mkdir -p /opt/mysql/two/log
> sudo touch /opt/mysql/two/log/mysql.log
> sudo chown -R mysql:mysql /opt/mysql/two
> sudo /usr/sbin/mysqld --initialize --explicit_defaults_for_timestamp --user=mysql --basedir=/opt/mysql/two --datadir=/opt/mysql/two/data

Creating directories for Instance Three
> sudo mkdir -p /opt/mysql/three/data
> sudo mkdir -p /opt/mysql/three/log
> sudo touch /opt/mysql/three/log/mysql.log
> sudo chown -R mysql:mysql /opt/mysql/three
> sudo /usr/sbin/mysqld --initialize --explicit_defaults_for_timestamp --user=mysql --basedir=/opt/mysql/three --datadir=/opt/mysql/three/data

3. Editing my.cnf file (/etc/mysql/my.cnf)

The third step is to update the file called "my.cnf" file which you can locate under the folder "/etc/mysql"

The following are the details to be provided for each instance of MySql in "my.cnf", these entries are called group entries where each entry corresponds to an instance of mysql

[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = multi_admin
password = password
log = /var/log/mysqld_multi.log
[mysqld1]
skip-grant-tables
user = mysql
port = 3306
datadir = /opt/mysql/one/data
socket = /opt/mysql/one/one-mysql.sock
pid-file = /opt/mysql/one/one-mysql.pid
log-error = /opt/mysql/one/log/mysql.log
[mysqld2]
skip-grant-tables
user = mysql
port = 4406
datadir = /opt/mysql/two/data
socket = /opt/mysql/two/two-mysql.sock
pid-file = /opt/mysql/two/two-mysql.pid
log-error = /opt/mysql/two/log/mysql.log
[mysqld3]
skip-grant-tables
user = mysql
port = 5506
datadir = /opt/mysql/three/data
socket = /opt/mysql/three/three-mysql.sock
pid-file = /opt/mysql/three/three-mysql.pid
log-error = /opt/mysql/three/log/mysql.log

Start the Instances

After the configuration update is finished at "my.cnf", the immediate next step is to start the instance to check its function.

The command given below would help you to achieve starting an instance, if you are successful please perform the same actions for other instances as well...

NOTE: do not forget to change the socket file parameter...

> sudo mysqld_multi start
> mysql -u root -S /opt/mysql/default/default-mysql.sock -p
mysql> use mysql
mysql> UPDATE user SET authentication_string=PASSWORD('admin') WHERE User='root';
mysql> FLUSH PRIVILEGES;

4. Granting SHUTDOWN privilege to multi_admin USER

This step discuss granting shutdown privileges to multi_admin user, to provide the same kill the running mysql instances using "ps-aux | grep mysql"

remove "skip-grant-tables" parameter from every group in my.cnf file

now your my.cnf file should look something as below

[mysqld_multi]
mysqld = /usr/bin/mysqld_safe
mysqladmin = /usr/bin/mysqladmin
user = multi_admin
password = password
log = /var/log/mysqld_multi.log
[mysqld1]
user = mysql
port = 3306
datadir = /opt/mysql/one/data
socket = /opt/mysql/one/one-mysql.sock
pid-file = /opt/mysql/one/one-mysql.pid
log-error = /opt/mysql/one/log/mysql.log
[mysqld2]
user = mysql
port = 4406
datadir = /opt/mysql/two/data
socket = /opt/mysql/two/two-mysql.sock
pid-file = /opt/mysql/two/two-mysql.pid
log-error = /opt/mysql/two/log/mysql.log
[mysqld3]
user = mysql
port = 5506
datadir = /opt/mysql/three/data
socket = /opt/mysql/three/three-mysql.sock
pid-file = /opt/mysql/three/three-mysql.pid
log-error = /opt/mysql/threelog/mysql.log

5. Start an instance

After removing the "skip-grant-tables" parameter from the group in "my.cnf" each instance of MySql will be identified by numbers based  on the position they appear in the configuration file.

To start the first instance, issue the following command
> sudo mysqld_multi start 1
login as root using the following command on instance 1 to check whether the connection establishment is fine.
> mysql -u root -S /opt/mysql/default/default-mysql.sock -p
provide the password of the root user

We can conclude the connection is fine, the the terminal window appears with mysql prompt.

6. Reset the password of root

This is final step and also an optional step to have, If you want to reset the root users password you can perform resetting the password using the following commands.
mysql> SET PASSWORD = PASSWORD('admin');
mysql> GRANT SHUTDOWN ON *.* TO 'multi_admin'@'localhost' IDENTIFIED BY '<password-provided-in-my.cnf-for-multi_admin>';

Thursday, August 8, 2019

Xeams : The Extended Mail and Messaging Server Installation in Ubuntu 16.04

Hi,

In this blog article, we are going to see how to install Xeams extended mail and messaging server in ubuntu 16.04

There would not be much deviation from the installation procedure between version of Opertating System, the same procedure can be adopted for other OSes with little bit or no tweaks...

So, lets start the show....

Prerequisites
Name Version Download Page Direct Link
Java 1.7 N/A N/A
Xeams 7.0 Xeams Downloads Page Click to Download Directly

From the above prerequisite section we are going to discuss only about the installation of Xeams but not Java.

To Install Java, there are plenty of resource available online, Please refer the one appropriate to you.

1. Installation of Xeams Mail Server
Form the downloads page or using the direct link, download the Xeams extended Mail and Messaging server and put it in a preferred location you like. What you download would be a .tar file, please extract the same

Open a terminal and navigate to the folder where you have extracted the package.

At the prompt, fire the following command to install the Mail Server
> ./Install.sh
The execution of the above command would ask certain questions, If you like you can answer those or leave it blank to have the server configured with default values....

Please sit back and relax till the execution completes, which would hardly take a minute.

This installation would also install a service, which takes care of starting the service at the machine startup.

You can find the service at the below mentioned location...

/etc/init.d/xeams

Well this concludes the installation of Xeams extended Mail and Messaging server.

2.  Server Configuration

In order to configure the server, open a browser and hit the following address in the address bar

http://localhost:5272

The server configuration requires certain details in order to function correctly, which would also ask you to set the administrator account to maintain the server.

Administrator Details
The first page asks you the details for a administrator, provide the same and click next to proceed.



Server Type
The next configuration item is the server type, select the one appropriate to you, In my case I have selected the standalone type and click next to proceed.



Domain Setup
The third items is the domain setup, you can key in the domain name if you have one and click next to proceed.



Verification
The last part is the verification page, Please check the details which you have provided are correct



Logout from the application using logout menu item in Home Menu and Log back in.

You would see the administrator control panel page like the one given in the image below...



There are plenty other options to configure, have a walk thru if you want to configure the required features for the installation

Well this concludes the article

Hope you liked it, Thanks.

Addressing Modes of 8080 / 8085 MicroProcessor

Hi,   In this post I am going to talk about different addressing modes of 8080/8085...without much talking let us get into the topic.   Ther...