Config for Samba to allow login Windows XP

Today I found a solution for Samba 4.6.2 in Centos 7.4 for all versions of Windows from 7 upwards are able to connect less Windows XP.

Word in smb.conf

lanman auth = yes
ntlm auth = yes

That’s how the config looks:

[global]
workgroup = SAMBA
server string = Samba
netbios name = Samba
interfaces = 192.168.22.250/24 192.168.0.250/24
hosts allow = 127. 192.168.22. 192.168.0.
max protocol = SMB2
socket options = TCP_NODELAY
read raw = no
log file = /var/log/samba/log.%m
max log size = 500

lanman auth = yes
ntlm auth = yes

security = user
map to guest = bad user

passdb backend = tdbsam

local master = yes
os level = 255
preferred master = yes
printing = cups
printcap name = cups
load printers = no
cups options = bsd

I think this information will help you if you have Windows XP computers on your network.

How to buy a cheap linux vps.

How to buy a cheap linux vps?
This it is the topic of this days.

The first thing you can look for a discount code on www.retailmenot.com
You cand find free discount code to buy VPS server on Linode or cheap domain on godaddy.com.  Other tips, you can search on Google “promo code provider” Ex: promo code godaddy, promo code linode, promo code ovh …… and so on.

  1. Hetzner Germany, from 3.9 Euro to 49.9 Euro, you have Control Panel to control your VPS. Transfer Limit from 2 TB to 30 TB.  If you are from other country than Germany you can pay with TransferGO.
  2. Linode Germany. Price from 5$/month to 960 $/month. Transfer limit from 1 TB to 9 TB.  Very good CPU on VPS hosting.  You can buy cheap with “promote code”.
  3. OVH Price from 2.99 to 11.99. Unlimited traffic 
  4. A2hosting VPS, I suggest to buy Unmanaged VPS Hosting and you will config you services in your server. Price from 4.45 Euro to 13.36 Euro. Transfer limit just 2 TB.
  5. Google Cloud Platform, I like this inteface, eazy to setup, you can try it free ( you will receive $300 credit for free ) for first month.

You can look to Amazon AWS or Digital Ocean but you can waste your time. ( they are good but not cheap )

From now this it is what I found.

Script to monitor disk space on Linux partition.

We want to monitor or watch the disk space on Linux Partitions.

Example of script:

#!/bin/sh
# set -x
# Shell script to monitor or watch the disk space
# It will send an email to $ADMIN, if the (free available) percentage of space is >= 90%.
# ————————————————————————-
# Set admin email so that you can get email.
ADMIN=”samba@domain.com”
### ADMIN=”clucian@ceae.info”
# set alert level 90% is default
ALERT=90
# Exclude list of unwanted monitoring, if several partions then use “|” to separate the partitions.
# An example: EXCLUDE_LIST=”/dev/sda1|/dev/sdc5″
### EXCLUDE_LIST=”/auto/ripper”
EXCLUDE_LIST=”/dev/md0|/dev/md2″
#
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
#
function main_prog() {
while read output;
do
# echo $output
usep=$(echo $output | awk ‘{ print $2}’ | cut -d’%’ -f1)
partition=$(echo $output | awk ‘{print $3}’)
size=$(echo $output | awk ‘{print $1}’)
free=$(echo $output | awk ‘{print $4}’)
if [ $usep -ge $ALERT ] ; then
### echo “Running out of space \”$partition ($usep%)\” on server $(hostname), $(date)” | \
echo “Running out of space \”$partition ($usep%)\” server $(hostname), $(date), Space use = $size”, Free = $free. | \
mail -s “Alerta: Space on Samba este $usep%” $ADMIN
fi
done
}

if [ “$EXCLUDE_LIST” != “” ] ; then
df -H | grep -vE “^Filesystem|tmpfs|cdrom|${EXCLUDE_LIST}” | awk ‘{print $3 ” ” $5 ” ” $6 ” ” $4}’ | main_prog
else
df -H | grep -vE “^Filesystem|tmpfs|cdrom” | awk ‘{print $3 ” ” $5 ” ” $6 ” ” $4}’ | main_prog
fi

If you want more device to report or to see output on bash / cli uncoment “# echo $output”.
Enjoy. Source of info https://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html

How to fix auto-read-only mdadm.

This guide shows you a simple way to fix your mdadm raid based drives which are not syncing or in the auto-read-only mode.

To find the names of your drives which are under auto-read-only mode or not syncing

cat /proc/mdstat

Force the drives to sync.

mdadm --readwrite /dev/md9

Replace md9 with the name of the drive like md127 etc.
server ~ # cat /proc/mdstat
Personalities : [raid0] [raid1] [raid6] [raid5] [raid4] [raid10] [linear] [multipath]
md125 : active (auto-read-only) raid1 sda1[0] sdb1[1]
      192640 blocks [2/2] [UU]

md126 : active raid1 sda5[0] sdb5[1]
      97650944 blocks [2/2] [UU]
        resync=DELAYED

md127 : active raid1 sdb2[1] sda2[0]
      97659008 blocks [2/2] [UU]
      [=>...................]  resync =  8.8% (8686848/97659008) finish=64.0min speed=23148K/sec

md128 : active (auto-read-only) raid1 sdb6[1] sda6[0]
      288875200 blocks [2/2] [UU]

Source Info: http://wiki.crowncloud.net/doku.php/how_to_fix_auto-read-only_mdadm

CP: max source files number arguments for copy utility

Hello

Today we have a problem: We get this error when we try to copy over 32356 file in other folder.
[root@mail server-xv.ro]# cp -p office_23\@domain.ro/new/1* office\@domain.ro/.Inbox_2016_06_23/cur/
-bash: /bin/cp: Argument list too long

Solutions: run your command in a loop.

[root@mail server-xv.ro]# for file in office_23\@domain.ro/new/*; do cp -p “$file” office\@domain.ro/.Inbox_2016_06_23/cur/; done

And works very well.