Showing posts with label Linux Administration. Show all posts
Showing posts with label Linux Administration. Show all posts

Monday, 15 January 2018

Installation of jdk-1.8.xxx on Fedora

Dear Viewer

Follow the below mentioned steps to install / upgrade jdk version on your Linux box.


JDK1.8.0_151 installation steps

[pavan@Pavan opt]$ su
Password:
[root@Pavan opt]# pwd
/opt
[root@Pavan opt]#
[root@Pavan opt]# wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz"
--2018-01-15 18:25:57-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
Resolving download.oracle.com... 23.66.247.173
Connecting to download.oracle.com|23.66.247.173|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz [following]
--2018-01-15 18:25:57-- https://edelivery.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz
Resolving edelivery.oracle.com... 23.211.219.179, 2600:1417:2c:183::2d3e, 2600:1417:2c:190::2d3e
Connecting to edelivery.oracle.com|23.211.219.179|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516021067_f2db42d3f19a78350632a1e8f269fe63 [following]
--2018-01-15 18:25:58-- http://download.oracle.com/otn-pub/java/jdk/8u151-b12/e758a0de34e24606bca991d704f6dcbf/jdk-8u151-linux-x64.tar.gz?AuthParam=1516021067_f2db42d3f19a78350632a1e8f269fe63
Connecting to download.oracle.com|23.66.247.173|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 189736377 (181M) [application/x-gzip]
Saving to: `jdk-8u151-linux-x64.tar.gz'

100%[==========================================>] 189,736,377 401K/s in 9m 4s

2018-01-15 18:35:02 (340 KB/s) - `jdk-8u151-linux-x64.tar.gz' saved [189736377/189736377]

Monday, 20 March 2017

Compile, Configure and Reinstall Linux Kernel from Source

Linux is the most desirable operating system in today's world. Linux has made available variety of distribution for local and commercial use. At some time you may think to rebuild, reconfigure and reinstall your existing Linux kernel with the new version.

This post will help you to do so within very short period of time. You just have to follow below steps carefully.

1. Download the latest Kernel source of your choice from official website (https://www.kernel.org/). 


You may use below link:
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.2.1.tar.gz

[pavan@localhost ~]$ su -
Password:
Last login: Thu Mar  2 12:15:25 IST 2017 on pts/0

[root@localhost ~]# cd /usr/src/

[root@localhost src]# ls
kernels

[root@localhost src]#

[root@localhost src]# cp -r /home/pavan/Downloads/linux-3.2.1 .

Tuesday, 28 February 2017

No GRUB seen after Windows 10 installation or update

Most of the times we come across a situation where we try to dual boot system with Fedora/Ubuntu and Windows; and suddenly post installation or update we do not get GRUB screen back.

Well nothing to worry for such trouble as both OS are there installed on your HDD. The only thing is that you need to take extra efforts to boot one of the OSs of your choice.

You may follow below process to get back the GRUB screen. This will ensure to add grub entries into EFI database file.

1. Go to Windows prompt.
2. Run prompt with Administrator rights.
3. Type following command
      bcdedit /set {bootmgr} path \EFI\Fedora\grubx64.efi
4. Reboot your system and you shall be able to see GRUB screen.

Note: If still GRUB is not seen then add other files with above command again. Files like: shim.efi, shim-fedora.efi, etc


Above solution will work if you are able to get inside Windows. If you are not then same changes to the database can also be done by getting into BIOS settings and doing respective modifications.

Write first device driver for Linux

This post will encourage you to write your first device driver for Linux platform


Basics:
Device driver is a program that manages the system interaction with a particular piece of hardware. The driver translates between  hardware commands understood by the device and the programming interface used by kernel. Device drivers are part of kernel; they are not user process.

In this post we will be writing a simple "Hello World" .c program which we will convert into .ko file and later on will load into kernel. Besides this you will need to have a makefile which you will be calling with the help of "make" utility.

Contents of "ofd.c" and "makefile" is as below:

Wednesday, 27 July 2016

Two days handson workshop on "Basics of Linux" on 6th & 7th Aug, 2016 @ PICT, Pune

Dear Students,

At PICT, Computer Engg Dept, we are organizing two days workshop on “Basics of Linux” on 06th & 07th Aug 2016.

Motivation behind this workshop is to explore Linux operating system. Syllabus of this workshop ensures hands on training which includes hands on Linux utilities, POSIX API programming, inter-process communication constructs, exposure to shell scripting, Linux server administration / configuration, basic building blocks of python, etc.

Interested students can register their name to the mentioned below faculties on or before 02-08-2016.

1) Prof. Virendra Bagade

Mob No. 9763722393

2) Prof. Pavan Jaiswal

Mob No. 9545200881


Online registration link:

https://goo.gl/tycYqz

Thanks.

Wednesday, 23 September 2015

Create ISO Boot Image Using ISOLinux and MKISOFS Uitility on Linux Box

Dear Viewers

This post will help you to create ISO boot image using ISOLinux and mkisofs utility on Linux box.

Prerequisite:
1. Syslinux archive.
2. Binary files, source code files and other required configuration file of any preferable  Linux flavor.
3. mkisofs utility installed.


Tuesday, 22 September 2015

Make and Cmake Utility Example in Linux


Dear Viewers

This post will help you to use Make and Cmake utility in Linux for auto compiling and building C language project. 

Prerequisite:
1. Basic knowledge of C language. 
2. GCC compiler on your Linux box. 
3. Make and Cmake utility installed. (On Linux terminal, type man make and man cmake for know more details on Linux terminal) 


Concept:
In your daily routine you might have come across a situation where a big software application need to be split-up into small-small module.
There is a possibility that these each one of these modules have thousands lines of source code written in them. Imagine that these modules 
have been developed by different-different developer who actually sits on different-different locations. In such scenario, whenever a developer 
make changes to source code, he is expected to compile that code manually. Same applies to other developers. This actually seems to be a tedious 
job considering each time manual compilation. Can we think for solution to this problem? Yes. We have a solution for this problem. That is Make 
and Cmake utility. Both are explained below with their practical demonstration. 
 

Monday, 22 June 2015

Shell script to perform simple file operations

Dear Viewers
Below shell script handles basic file operations. Linux commands used to perform operations are:
1. echo - to print on standard output
2. read - to read user input
3. touch - to create a file
4. mv - to rename a file
5. rm - to remove a file
6. ls - to list the contents of current directory  


Tuesday, 9 June 2015

"Backspacce" key not working in Fedora nautilus

Dear Viewers,

While using Fedora distributions, you might have experienced that "Backspace" key on nautilus do not work. In simple words, nautilus means filesystem hierarchy under "/". So every time to visit or to go back to previously accessed folder, you have to make use of mouse and click on "Back" button available on left top corner. So if you wants to get rid out of this and wish to use shortcut key, then follow the process given below:

1. Open terminal
2. Type in  vi /root/.config/nautilus/accels 
3. Replace the user root by the user name for whom you would like to apply these settings. Important is you have to provide absolute path.
4. Go into "Insert" mode on VI, and copy paste below line as it is
 (gtk_accel_path "<Actions>/ShellActions/Up" "BackSpace") 
5.Press "Esc" then ":" and type "wq"
6. This will save the changes made and will take you back on terminal
7. On terminal type either "nautilus -q" or "killall nautilus"
8. Now open any folder, jump to any directories and cross check whether "Backspace" started working. 
9. You are done.

All The Best.....

Monday, 8 June 2015

Linux administration tools and commands

Dear Viewers,

You may use following links where Linux administration tools and utilities have been explained with examples so well.

Link 1:
http://www.tecmint.com/60-commands-of-linux-a-guide-from-newbies-to-system-administrator/

Link 2:
http://www.tldp.org/LDP/abs/html/system.html

Link 3:
http://www.reallylinux.com/docs/admin.shtml

Sunday, 31 August 2014

Create ISO boot image using open source tools

Problem statement
Create ISO boot image using open source tool

Solution
Various open source tools are available to create ISO boot image starting with Linux platform, Windows platform and many more. We are interested here to use tools that are used for Linux distribution. Here we used ISOLINUX and SteamOSInstaller. Detailed information about them is as below.

Note: Screen shots provided below in this post will help you to create .iso file of Fedora 20. If you wish to create .iso file of Ubuntu, you may follow the another link -
http://www.pavanjaiswal.com/2015/09/create-iso-boot-image-using-isolinux.html

   1.     ISOLINUX
ISOLINUX is a boot loader for Linux/i386 that operates off ISO 9660/El Torito CD-ROMs in "no emulation" mode. This avoids the need to create an "emulation disk image" with limited space (for "floppy emulation") or compatibility problems (for "hard disk emulation".)


Detecting computer is booted with BIOS or UEFI

Problem statement
Write a program in Python / C++ to test that computer is booted with legacy boot ROM-BIOS or UEFI 


Solution
   A.    Introduction to booting
When we start our computer then there is an operation which is performed automatically by the Computer which is also called as Booting. In the Booting, System will check all the hardware’s and Software’s those are installed or Attached with the System and this will also load all the Files those are needed for running a system.
In the Booting Process all the Files those are Stored into the ROM Chip will also be Loaded for Running the System. In the Booting Process the System will read all the information from the Files those are Stored into the ROM Chip and the ROM chip will read all the instructions those are Stored into these Files. After the Booting of the System this will automatically display all the information on the System. The Instructions those are necessary to Start the System will be read at the Time of Booting.


Saturday, 30 August 2014

Socket programming in Linux

Problem statement
Use python for socket programming to connect two or more PCs to share a text file

Solution
   A.     Introduction
Sockets allow communication between two different processes on the same or different machines. To be more precise, it's a way to talk to other computers using standard Unix file descriptors. In Unix, every I/O actions are done by writing or reading to a file descriptor. A file descriptor is just an integer associated with an open file and it can be a network connection, a text file, a terminal, or something else.
To a programmer a socket looks and behaves much like a low level file descriptor. This is because commands such as read() and write() work with sockets in the same way they do with files and pipes. The difference between sockets and normal file descriptors occurs in the creation of a socket and through a variety of special operations to control a socket.
Sockets were first introduced in 2.1BSD and subsequently refined into their current form with 4.2BSD. The sockets feature is now available with most current UNIX system releases.

Create Linux Virtual File System

Problem statement
Write a python program for creating Virtual File System on Linux environment 

Solution
   A.    History of Linux filesystem
Linux is a Unix-like operating system, which runs on PC-386 computers. It was implemented first as extension to the Minix operating system [Tanenbaum 1987] and its first versions included support for the Minix filesystem only. The Minix filesystem contains two serious limitations: block addresses are stored in 16 bit integers, thus the maximal filesystem size is restricted to 64 mega bytes, and directories contain fixed-size entries and the maximal file name is 14 characters.


Tuesday, 29 July 2014

Create RAMDisk on Linux platform

Problem statement: 
Write a program in C++ to create a RAMDRIVE and associate an a cyclic directory structure to it. Use this RAMDRIVE to store input, out files to run a calculator program.

Solution:

   A.    Basics of RAMDisk
As name suggest, RAMDisk is basically hard disk portion which is used / treated as RAM portion. It means, from actual RAM, we utilize few size to be used as RAMDisk. For e.g out of 2GB RAM size, you may allocate 512 MB size to newly created portion. Ramdisk or ramdrive is part of system memory that applications/user can use just like normal disk space — e.g. to create folders and files in it and manipulate them with dramatically better performance rather if they were stored on the hard drive. This is because Ram memory is much faster than other forms of storage.
By default Ubuntu has ramdisk mounted into /dev/shm/ directory so you can just copy/move files into that dir and be sure they’ll be stored in RAM memory. That could be useful for, say, video conversion when both input and output files are stored in ramdisk — resulting performance will be better as read and write speeds are higher for ram than for hdd or any other storage. This is due to the fact CPU cannot access to HDD directly while it can do it with RAM. There are two types of RAMDisk: 1. ramfs (not much used now a days) and 2. tmpfs (mostly used).

Thursday, 24 July 2014

Use pipe to perform Inter-Process Communication (IPC)

Problem statement: Write an IPC program using pipe. Process A accepts a character string and Process B inverses the string. Pipe is used to establish communication between A and B processes using Python or C++.

Solution: 
   A.    Basics of Inter-Process Communication (IPC)
Inter-Process-Communication (or IPC for short) are mechanisms provided by the kernel to allow processes to communicate with each other. On modern systems, IPCs form the web that binds together each process within large scale software architecture. 
The Linux kernel provides the following IPC mechanisms:


Ugrade Ubuntu 10.04 to Ubuntu 12.04 via terminal [closed]

Objective: 
Upgrade to Ubuntu 12.04 from Ubuntu 10.04 via terminal

Steps:
1. start terminal. Use shortcut alt+ctrl+t

2.  Install update-manager-core, if it is not already installed.
 pavan@ubuntu:~$ sudo apt-get install update-manager-core 

3. Run the commands below to open upgrade manager's release  upgrade file
pavan@ubuntu:~$ sudo vi /etc/update-manager/release-upgrades 

4. set Prompt=lts if not set in the opened file. Save file and close it

5. Update all packages installed before you upgrade
pavan@ubuntu:~$ sudo apt-get update && sudo apt-get upgrade & sudo apt-get autoremove

6. Finally begin the upgrade process
pavan@ubuntu:~$ sudo do-release-upgrade
when ask if you want to continue with upgrade, press Y or yes

7. After successful upgrade, cross check your Ubuntu version with below command
pavan@ubuntu:~$ lsb_release -a
No LSB modules are available.
Distributor ID:    Ubuntu
Description:    Ubuntu 12.04.1 LTS
Release:    12.04
Codename:    precise
pavan@ubuntu:~$
 
8. You are done. Enjoy !!!


Wednesday, 23 July 2014

Display i-node information of given file

Problem statement: Display i-node information of given file using C++ or Python language

Solution:
    A.     Introduction
The inode (also known as Index Node) is a very basic concept related to Linux and UNIX filesystem. Each and every object/element in the filesystem is associated with an inode.
You must be aware of the fact that, most of the countries have given a unique identity to their citizens in the form of a unique identification number ('Aadhar Card' in India and 'SSN' in the USA) to identify an individual easily and uniquely. This also leads to make all the paper work corresponding to any citizen easier to be handled.
Just like these identification numbers for people, there is a unique identity of every member of a Linux filesystem which is known as Inode number and it uniquely exists for each and every individual file on Linux or Unix filesystem.


Reset Ubunut 12.04 root password using recovery mode on GRUB window