Posts

Showing posts from November, 2016

Random sleep in bash script

Random sleep in bash script To insert a random sleep into a running script:  sleep $[ ( $RANDOM % 10 )  + 1 ]s   This will introduce a 1-10 second random sleep in the script. 

Glassfish 4.1 admin reset password

Glassfish 4.1 admin reset password 1. Go t o   /opt/glassfish4/glassfish/domains/domain1/config/local_password   its contents are a backup password to log in as admin 2. You can replace the domain\config\admin-keyfile contents with the following: admin;{SSHA256}UV9EsTaoxzAdtxiNMKTkb3g0WjnoUBEBgpDQIGSdOu8QhprFoWiSCw==;asadmin This will give you a username of 'admin' and password 'changeit'.

NFS, Centos 7, firewalld setup

NFS, Centos 7, firewalld setup On server systemctl enable rpcbind systemctl enable nfs-server systemctl enable nfs-lock systemctl enable nfs-idmap systemctl start rpcbind systemctl start nfs-server systemctl start nfs-lock systemctl start nfs-idmap edit  /etc/exports /media/USB-drive/ 192.168.200.2(rw,sync,no_root_squash,no_all_squash) (path do shared folder, IP of client, permissions and configs) firewall-cmd --permanent --add-service=nfs firewall-cmd --permanent --add-service=mountd firewall-cmd --permanent --add-service=rpc-bind firewall-cmd --reload   to check if everything is correct exportfs   from client mount the nfs share create folder /mnt/nfs/USB-drive     mount -t nfs 192.168.200.1:/media/USB-drive /mnt/nfs/USB-drive

How to test NFS speed or HDD speed

How to test NFS speed or HDD speed > hdparm -tT /dev/sda /dev/sda:  Timing cached reads:   24960 MB in  2.00 seconds = 18504.33 MB/sec  Timing buffered disk reads: 6746 MB in  3.00 seconds = 4247.95 MB/sec for more reliable outcome for i in 1 2 3; do hdparm -tT /dev/sda; done or > dd if=/dev/zero of=/tmp/output.img bs=8k count=256k 262144+0 records in 262144+0 records out 2147483648 bytes (2.1 GB) copied, 0.873801 s, 2.5 GB/s   NFS: at first create test folder  > bonnie+++ -d /mnt/nfs/test/ -u root to see some human readable report bonnie++ -d /mnt/nfs/test/ -r 2048 -u root | bon_csv2html > /root/bonnietest.html