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

Sunday, December 30, 2018

How to Install GUI In CentOS 7

1) yum groupinstall  "GNOME Desktop" -Y
2) systemctl get-default
3) systemctl set-default graphical.target
4) systemctl get-default
5) systemctl isolate graphysical.target

Regards
Gurudatta N.R

Tuesday, October 16, 2018

How to delete a file which is throwing operation not permitted) from root acount.

Unable to delete file in Linux/Unix, operation not permitted) from root account.

chattr -i -a filename 
 
chmod ugo+w  filename 
rm filename
 
Regards
Gurudatta N.R 

Sunday, September 2, 2018

How to Install and Configure VNC on Centos 6

In order to access the GUI of our linux servers

1) yum install tigervnc-server xterm

# vncpasswd
# vi /etc/sysconfig/vncservers

      VNCSERVERS="2:root"
      VNCSERVERARGS[2]="-geometry 1024x768"

# service vncserver start

# chkconfig vncserver on

Regards
Gurudatta N.R

Friday, July 6, 2018

How to list the users in Linux.

awk -F":" '{print "Login:" $1 "\tName:" $5 "\tHome:" $6}' /etc/passwd
 
 
Regards
Gurudatta N.R 

Wednesday, July 4, 2018

How to install the Grub in Linux .

Boot the server using the Linux CD and Type "linux rescue" on the boot prompt.

Once you get the Shell Prompt, Now follow the steps:

# chroot /mnt/sysimage

Now issue the command "grub-install "
 
For Example:
    
# grub-install /dev/sda

Now the grub will be reinstalled in the primary hard disk.

Regards
Gurudatta N.R

Tuesday, April 10, 2018

Linux Signals


Signal NameNumberDescription  
SIGHUP1Hangup (POSIX)
SIGINT2Terminal interrupt (ANSI)
SIGQUIT3Terminal quit (POSIX)
SIGILL4Illegal instruction (ANSI)
SIGTRAP5Trace trap (POSIX)
SIGIOT6IOT Trap (4.2 BSD)
SIGBUS7BUS error (4.2 BSD)
SIGFPE8Floating point exception (ANSI)
SIGKILL9Kill(can't be caught or ignored) (POSIX)
SIGUSR110User defined signal 1 (POSIX)
SIGSEGV11Invalid memory segment access (ANSI)
SIGUSR212User defined signal 2 (POSIX)
SIGPIPE13Write on a pipe with no reader, Broken pipe (POSIX)
SIGALRM14Alarm clock (POSIX)
SIGTERM15Termination (ANSI)
SIGSTKFLT16Stack fault
SIGCHLD17Child process has stopped or exited, changed (POSIX)
SIGCONT18 Continue executing, if stopped (POSIX)
SIGSTOP19Stop executing(can't be caught or ignored) (POSIX)
SIGTSTP20Terminal stop signal (POSIX)
SIGTTIN21Background process trying to read, from TTY (POSIX)
SIGTTOU22Background process trying to write, to TTY (POSIX)
SIGURG23Urgent condition on socket (4.2 BSD)
SIGXCPU24CPU limit exceeded (4.2 BSD)
SIGXFSZ25File size limit exceeded (4.2 BSD)
SIGVTALRM26Virtual alarm clock (4.2 BSD)
SIGPROF27Profiling alarm clock (4.2 BSD)
SIGWINCH28Window size change (4.3 BSD, Sun)
SIGIO29I/O now possible (4.2 BSD)
SIGPWR30Power failure restart (System V)

Tuesday, March 6, 2018

Sunday, February 18, 2018

How to get the serial number of the disk in Linux .

#!/bin/bash
#    NAME
#      getSerial.sh - Get HDD/SDD serial number

echo ""
echo "Device name and Serial Number"
filename="/tmp/devices"
lsblk |grep disk | awk '{print $1}' > $filename
sed -i -e 's/^/\/dev\//' $filename

while read -r device
do
  serial=$(smartctl -i $device |grep Serial)
  printf '%s - %s\n' "$device" "$serial"
done < $filename
# -------------------------------------------------------------------
# EndOfFile
# -------------------------------------------------------------------

.

Sunday, November 1, 2015

How to find the PCI device information in Linux. ?

We can find the PCI device using the following methods.

1)   vendors by name 
2)   vendors by id 
3)   search devices


http://pcidatabase.com/vendor_details.php?id=607

The Linux kernel represents PCI devices as pseudo-devices in the sysfs file system:
$ ls -la /sys/bus/pci/devices
total 0
drwxr-xr-x 2 root root 0 2009-08-03 10:38 .
drwxr-xr-x 5 root root 0 2009-08-03 10:38 ..
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:00.0 -> ../../../devices/pci0000:00/0000:00:00.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:01.0 -> ../../../devices/pci0000:00/0000:00:01.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:01.1 -> ../../../devices/pci0000:00/0000:00:01.1
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:02.0 -> ../../../devices/pci0000:00/0000:00:02.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:02.1 -> ../../../devices/pci0000:00/0000:00:02.1
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:04.0 -> ../../../devices/pci0000:00/0000:00:04.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:05.0 -> ../../../devices/pci0000:00/0000:00:05.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:05.1 -> ../../../devices/pci0000:00/0000:00:05.1
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:05.2 -> ../../../devices/pci0000:00/0000:00:05.2
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:06.0 -> ../../../devices/pci0000:00/0000:00:06.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0a.0 -> ../../../devices/pci0000:00/0000:00:0a.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0b.0 -> ../../../devices/pci0000:00/0000:00:0b.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0c.0 -> ../../../devices/pci0000:00/0000:00:0c.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0d.0 -> ../../../devices/pci0000:00/0000:00:0d.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0e.0 -> ../../../devices/pci0000:00/0000:00:0e.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:0f.0 -> ../../../devices/pci0000:00/0000:00:0f.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:18.0 -> ../../../devices/pci0000:00/0000:00:18.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:18.1 -> ../../../devices/pci0000:00/0000:00:18.1
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:18.2 -> ../../../devices/pci0000:00/0000:00:18.2
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:00:18.3 -> ../../../devices/pci0000:00/0000:00:18.3
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:01:05.0 -> ../../../devices/pci0000:00/0000:00:06.0/0000:01:05.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:01:06.0 -> ../../../devices/pci0000:00/0000:00:06.0/0000:01:06.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:02:00.0 -> ../../../devices/pci0000:00/0000:00:0a.0/0000:02:00.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:03:00.0 -> ../../../devices/pci0000:00/0000:00:0a.0/0000:02:00.0/0000:03:00.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:03:00.1 -> ../../../devices/pci0000:00/0000:00:0a.0/0000:02:00.0/0000:03:00.1
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:04:00.0 -> ../../../devices/pci0000:00/0000:00:0b.0/0000:04:00.0
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:05:00.0 -> ../../../devices/pci0000:00/0000:00:0c.0/0000:05:00.0
Given an entry such as:
lrwxrwxrwx 1 root root 0 2009-08-03 10:38 0000:04:00.0 -> ../../../devices/pci0000:00/0000:00:0b.0/0000:04:00.0
We can break the device string "0000:04:00.0" down as follows:
0000 : PCI domain (each domain can contain up to 256 PCI buses)
04   : the bus number the device is attached to
00   : the device number
.0   : PCI device function
To get additional information about the device, we can change into the 0000:04:00.0 directory and execute our favorite pager to display one or more pseudo-device entries:
$ cd 0000:04:00.0

$ ls -la
total 0
drwxr-xr-x 4 root root     0 2009-08-03 10:38 .
drwxr-xr-x 7 root root     0 2009-08-03 10:38 ..
-rw-r--r-- 1 root root  4096 2009-08-03 12:23 broken_parity_status
-r--r--r-- 1 root root  4096 2009-08-03 10:38 class
-rw-r--r-- 1 root root  4096 2009-08-03 11:34 config
-r--r--r-- 1 root root  4096 2009-08-03 10:38 device
lrwxrwxrwx 1 root root     0 2009-08-03 10:38 driver -> ../../../../bus/pci/drivers/tg3
-rw------- 1 root root  4096 2009-08-03 12:23 enable
lrwxrwxrwx 1 root root     0 2009-08-03 12:12 firmware_node -> ../../../LNXSYSTM:00/device:00/PNP0A03:00/device:1a/device:1b
-r--r--r-- 1 root root  4096 2009-08-03 10:38 irq
-r--r--r-- 1 root root  4096 2009-08-03 12:23 local_cpulist
-r--r--r-- 1 root root  4096 2009-08-03 10:38 local_cpus
-r--r--r-- 1 root root  4096 2009-08-03 12:23 modalias
-rw-r--r-- 1 root root  4096 2009-08-03 12:23 msi_bus
drwxr-xr-x 3 root root     0 2009-08-03 10:38 net
-r--r--r-- 1 root root  4096 2009-08-03 12:23 numa_node
drwxr-xr-x 2 root root     0 2009-08-03 12:12 power
-r--r--r-- 1 root root  4096 2009-08-03 11:34 resource
-rw------- 1 root root 65536 2009-08-03 12:23 resource0
lrwxrwxrwx 1 root root     0 2009-08-03 10:38 subsystem -> ../../../../bus/pci
-r--r--r-- 1 root root  4096 2009-08-03 10:38 subsystem_device
-r--r--r-- 1 root root  4096 2009-08-03 10:38 subsystem_vendor
-rw-r--r-- 1 root root  4096 2009-08-03 10:38 uevent
-r--r--r-- 1 root root  4096 2009-08-03 10:38 vendor
-rw------- 1 root root 32768 2009-08-03 12:23 vpd

$ cat vendor
0x14e4

$ cat device
0x1659

$ cat class
0x020000
Each sysfs entry contains a unique piece of data, such as the PCI vendor id (vendor) the device class (class), the device identifier (device), and information on irq and resource assignments. In the next section, we will see how to decode this data

Note: Taken from the net. 

Regards
Gurudatta N.R

Sunday, July 26, 2015

Linux well known port numbers

20 – FTP Data (For transferring FTP data)

21 – FTP Control (For starting FTP connection)

22 – SSH(For secure remote administration which uses SSL to encrypt the transmission)

23 – Telnet (For insecure remote administration

25 – SMTP(Mail Transfer Agent for e-mail server such as SEND mail)

53 – DNS(Special service which uses both TCP and UDP)

67 – Bootp

68 – DHCP

69 – TFTP(Trivial file transfer protocol uses udp protocol for connection less transmission of data)
80 – HTTP/WWW(apache)

88 – Kerberos

110 – POP3(Mail delivery Agent)

123 – NTP(Network time protocol used for time syncing uses UDP protocol)

137 – NetBIOS(nmbd)

139 – SMB-Samba(smbd)

143 – IMAP

161 – SNMP(For network monitoring)

389 – LDAP(For centralized administration)

443 – HTTPS(HTTP+SSL for secure web access)

514 – Syslogd(udp port)

636 – ldaps(both tcp and udp)

873 – rsync

989 – FTPS-data

990 – FTPS

993 – IMAPS

1194 – openVPN

1812 – RADIUS

995 – POP3s

2049 – NFS(nfsd, rpc.nfsd, rpc, portmap)

2401 – CVS server

3306 – MySql

3690 – SVN

6000-6063-X11


Regards
Gurudatta N.R