Sudo copy files as root

To allow user01 to copy any files as root from /from/directory/ to /to/directory/ add the following to /etc/sudors file:

user01 ALL = NOPASSWD: /bin/cp /from/directory/* /to/directory/

And this one is for the multi commands:

user01 ALL = NOPASSWD: /bin/cp /from/directory/* /to/directory/, /bin/rm -rv /to/directory/*, /bin/ls -la /to/direcotry/*

Enable the VNC session running on display :1 for an oracle user on the SUSE server

To enable the VNC session running on display :1 for an oracle user on the SUSE server, please create the file called after.local in /etc/init.d with 775 rights, the file should look like that:

slestest:~ # cat /etc/init.d/after.local
#!/bin/sh
/bin/su oracle -c "/usr/bin/vncserver :1 &"

Just check that you have tightvnc installed:
slestest:~ # rpm -qa|grep vnc
xorg-x11-Xvnc-7.4-27.81.7
tightvnc-1.3.9-81.13.1
slestest:~ #

Find out NFS clients connected to my NFS server

root# cat /var/lib/nfs/rmtab

From the rpc.mountd(8) man page:

The rmtab File
The rpc.mountd daemon registers every successful MNT request by adding
an entry to the /var/lib/nfs/rmtab file. When receivng a UMNT request
from an NFS client, rpc.mountd simply removes the matching entry from
/var/lib/nfs/rmtab, as long as the access control list for that export
allows that sender to access the export.

Clients can discover the list of file systems an NFS server is cur-
rently exporting, or the list of other clients that have mounted its
exports, by using the showmount(8) command. showmount(8) uses other
procedures in the NFS MOUNT protocol to report information about the
server’s exported file systems.

Note, however, that there is little to guarantee that the contents of
/var/lib/nfs/rmtab are accurate. A client may continue accessing an
export even after invoking UMNT. If the client reboots without sending
a UMNT request, stale entries remain for that client in
/var/lib/nfs/rmtab.

CentOS7 – Samba mangles a long filename into an 8.3 filename.

Samba mangles a long filename into an 8.3 filename, for example:

-rw-r–r– 1 42781900 42781900 1432 Oct 16 21:00 2ZAOMT~P.XML
-rw-r–r– 1 42781900 42781900 1432 Sep 14 09:00 2ZCLAI~F.XML
-rw-r–r– 1 42781900 42781900 1432 Dec 3 21:00 2ZDTUD~9.XML
-rw-r–r– 1 42781900 42781900 66047 Sep 24 21:00 2ZG7PO~5.XML

Add “mangled names=no” to the [global] section in /etc/samba/smb.conf and then restart the smb service.

root# cat /etc/samba/smb.conf
–cut
[global]
unix charset = UTF-8
mangled names=no

–cut
root# systemctl restart smb

And now, everything is okay 😉

-rw-r–r– 1 42781900 42781900 1432 Oct 16 09:00 2016-10-16_09:00_Trading_Day_Exchange_Rate.xml
-rw-r–r– 1 42781900 42781900 1432 Oct 16 09:00 2016-10-16_09:00_Two_Day_Rolling_Wind_Forecast.xml
-rw-r–r– 1 42781900 42781900 1432 Oct 16 14:57 2016-10-16_14:57_Trading_Day_Exchange_Rate.xml
-rw-r–r– 1 42781900 42781900 1432 Oct 16 14:57 2016-10-16_14:57_Two_Day_Rolling_Wind_Forecast.xml

More information: http://www.oreilly.com/openbook/samba/book/ch05_04.html