Prevent users from accidentally dragging and dropping folders into other folders – OES11

Here is how to prevent that from happening.

1. Right click on the folder that you want to protect
2. Click on properties
3. Click on Netware Info tab
4. Put check mark on "Rename Inhibit" and "Delete inhibit"
5. Click on apply and OK

Also the command line can be used on OES11 server:

root# attrib /folder/protected_from_rename_delete_etc -s=ri,di

Mount an ISO image

An ISO image or .iso (International Organization for Standardization) file is an archive file that contains a disk image called ISO 9660 file system format. Every ISO file have .ISO extension has defined format name taken from the ISO 9660 file system and specially used with CD/DVD rom’s. In simple words an iso file is a disk image.
ISO images can be created from optical discs by disk imaging software, or from a collection of files by optical disc authoring software, or from a different disk image file by means of conversion. Software distributed on bootable discs is often available for download in ISO image format. And like any other ISO image, it may be written to an optical disc such as CD or DVD.

Mount an ISO image:
root# mount -t iso9660 -o loop /root/debian-8.2.0-amd64-xfce-CD-1.iso /mnt/iso/

Unmount an ISO image:
root# umount /mnt/iso

/ on LVM gets mounted by initrd with kernel device name /dev/dm-X instead of /dev/mapper/XXX name

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791754

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=791754;msg=10;filename=resolve_device.diff;att=1

— /usr/share/initramfs-tools/scripts/functions.orig 2015-07-08 10:48:26.000000000 +0200
+++ /usr/share/initramfs-tools/scripts/functions 2015-07-08 10:39:15.000000000 +0200
@@ -324,6 +324,10 @@
UUID=*)
DEV=”/dev/disk/by-uuid/${DEV#UUID=}”
;;
+ /dev/mapper/*)
+ echo “$DEV”
+ return 0
+ ;;
esac
# Only canonicalise if a valid file, in case $DEV isn’t a filename
[ -e “$DEV” ] && DEV=$(readlink -f “$DEV”)

And then run the following command:

update-initramfs -u -k all

If this is not possible to implemented this patch/workaround always this command can be used:

dmsetup ls --tree

ACL and a sticky bit.

Set a directory with rwx inherit default permissions for groups, also to ensure that all files and directories crated in will have ownership the “users” group.

All new files created in the directory will have the group set to the group of the directory.

chmod g+s user1

Set the set file access control lists (ACL), set the group to rwx default and others to read access only.

setfacl -d -m g::rwx user1
setfacl -d -m o::r user1

Output:

server:/home # l user1/
total 393256
drwxr-xr-x 12 root root 4096 Jul 24 10:38 ./
drwxr-xr-x 26 root root 4096 Oct 16 15:03 ../
drwxrwsr-x+ 4 user1 users 4096 Oct 28 15:16 user1/
drwxr-xr-x 2 user2 users 4096 Oct 28 15:15 user2/
drwxr-xr-x 6 user3 dba 4096 Oct 13 14:24 user3/
drwx------ 2 root root 16384 Apr 17 2014 lost+found/

server:/home> getfacl user1/
# file: user1/
# owner: user1
# group: users
# flags: -s-
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::r--

server:/home/user1> l
total 72
drwxrwsr-x+ 4 user1 users 4096 Oct 28 15:36 ./
drwxr-xr-x 12 root root 4096 Jul 24 10:38 ../
-rw------- 1 user1 users 2197 Oct 28 15:14 .bash_history
drwxrw-r-- 2 user1 users 4096 Oct 27 08:43 bin/
-rw-rw-r-- 1 user2 users 0 Oct 28 15:36 createdbyuser2.txt
-rw-rw-r-- 1 user1 users 10324 Oct 21 09:22 createdbyuser1.txt
server:/home/user1>

Email Traffic Per Hour

The busiest time for the email traffic:
10:00 – 12:00 and 14:00 to 15:00

Per-Hour Traffic Summary
————————
time received delivered deferred bounced rejected
——————————————————————–
0000-0100 50 58 0 0 0
0100-0200 19 20 0 0 0
0200-0300 40 40 0 0 0
0300-0400 16 15 0 0 0
0400-0500 30 25 0 0 0
0500-0600 76 81 0 0 0
0600-0700 81 82 0 0 0
0700-0800 231 254 0 0 0
0800-0900 468 485 0 0 0
0900-1000 686 776 0 0 0
1000-1100 841 718 0 0 2
1100-1200 845 818 0 0 0
1200-1300 624 681 0 0 10
1300-1400 607 630 0 0 0
1400-1500 714 747 0 0 0
1500-1600 688 782 0 0 0
1600-1700 605 662 0 0 0
1700-1800 357 417 0 0 0
1800-1900 287 291 0 0 0
1900-2000 158 149 0 0 0
2000-2100 102 98 0 0 0
2100-2200 105 119 0 0 0
2200-2300 62 62 0 0 0
2300-2400 54 46 0 0 0

Forward queries for certain domian names to another name server.

Use a zone statement of type forward to tell a BIND server to forward queries for domain names that
end in the specified suffix to particular name servers. For example:

zone "domian.com" {
type forward;
forwarders { 172.16.12.100; };
};

This tells the name server to forward queries for domain names that end in domain.com to the name server at 172.16.12.100

How to convert bytes to KB and MB in Excel?

In Excel, to convert “bytes” from a cell D2 to KB/MB in a cell C2, insert the following to a cell C2:

=IF(D2>=1048576,D2/1000000&" MB",IF(AND(D2<1048576,D2>1024),D2/1000&" KB",D2&" BYTES"))

And then copy the formula down by dragging the bottom right-hand corner of the cell with the formula to the end of your KB/MB info already entered.

Log file for NRPE

NRPE does not have its own log file, everything goes to /var/log/messages. It would be nice to have a dedicated log file for NRPE.
To do that add the following lines in your NRPE configuration file. In my case the configuration file is /etc/nagios/nrpe.cfg

log_facility=local1
debug=0

and add the following lines to rsyslog configuration file. In my case the configuration file is /etc/rsyslogd.conf

local1.* /var/log/nrpe.log

And now, restart rsyslogd and nrep:

/etc/init.d/./rsyslogd restart
/etc/init.d/./nrpe restart

tmpfs

tmpfs is a temporary filesystem that resides in memory and/or your swap partition(s), depending on how much you fill it up. Mounting directories as tmpfs can be an effective way of speeding up accesses to their files, or to ensure that their contents are automatically cleared upon reboot.

By default, a tmpfs partition has its maximum size set to half your total RAM, but this can be customized. Note that the actual memory/swap consumption depends on how much you fill it up, as tmpfs partitions do not consume any memory until it is actually needed.
To explicitly set a maximum size, in this example to override the default /tmp mount, use the size mount option:

/etc/fstab
tmpfs /tmp tmpfs nodev,nosuid,size=4G 0 0

The tmpfs can also be temporarily resized without the need to reboot:

root# mount -o remount,size=6G,noatime /tmp

To find a filesystem at /proc/mounts of /tmp use findmnt which will list all mounted filesytems or search for a filesystem. The findmnt command is able to search in /etc/fstab, /etc/fstab.d, /etc/mtab or /proc/self/mountinfo. If device or mountpoint is not given, all filesystems are shown.

root# findmnt --target /tmp
TARGET SOURCE FSTYPE OPTIONS
/tmp tmpfs tmpfs rw,nosuid,nodev,relatime

Download and install Perl modules.

Debian – download and install from CPAN

root~# dh-make-perl --install --cpan Foo::Bar

Linux – download and install from CPAN

root~# perl -MCPAN -e shell
cpan> install Foo::Bar

For example:

DBI is a database-independent interface for the Perl programming language. DBD::mysql is the driver for connecting to MySQL database servers with DBI.
DBI is the basic abstraction layer for working with databases in Perl.
DBD::mysql is the driver for using MySQL with DBI.
Net::MySQL is a pure-Perl implementation of the MySQL client-server protocol. (It is not necessary when using DBI with DBD::mysql, but may be useful in environments where you are not able to compile the MySQL client library required by DBD::mysql.)

root~# perl -MCPAN -e shell
cpan> install DBI
cpan> install DBD::mysql
cpan> install Net::MySQL

or

root~# cpan -f DBI
root~# cpan -f DBD::mysql
root~# cpan -f Net:MySQL

Where -f stands for: Forces the specified action, when it normally would have failed.
Most of the time I had used cpan -f 😉