Monday, July 31, 2017

Cannot Close 137 udp port - ubuntu

if you face some complains about port 137 udp netbios-service is open on your server and firewall cannot close these ports then check if you have samba or cifs installed on your system, then remove this service completely unless you need it for an important application.
Uninstall cifs-utils from Ubuntu 16.04
To remove cifs-utils package :
 
sudo apt-get remove cifs-utils

Uninstall cifs-utils and it's dependent packages
 
sudo apt-get remove --auto-remove cifs-utils

delete configuration and data files of cifs-utils :
 
sudo apt-get purge cifs-utils

delete configuration and data files of cifs-utils and it's dependencies :
 
sudo apt-get purge --auto-remove cifs-utils

Sunday, July 30, 2017

Raid1 Cannot Remove Drive From Raid Array


First, check the mdadm status
cat /proc/mdstatus

then, run
lsblsk
to see the available drives ,and after choosing the drives to be part of RAID,let's say sda,sdb
sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sda /dev/sdb
if one hard disk fail and you want to replace it, then you need to flag it as fail part of raid the remove it from the raid array:
    mdadm --manage /dev/md1 --fail /dev/sdb2

then you can remove it from the raid array
    mdadm --manage /dev/md1 --remove /dev/sdb2
if you want to remove Raid1 : Check the Raid status -- these may will give you clear picture :
sudo mdadm --detail /dev/md0
and 
lsblk

Then stop and remove the Raid
mdadm --stop /dev/md0
mdadm --remove /dev/md0

tell the drive sda to forget about raid
sudo mdadm --zero-superblock /dev/sda/

if the system complain for being busy or such then
sudo dd if=/dev/zero of=/dev/sda
finally unmount the raid in the fstab file and comment it in the /etc/mdadm/mdadm.conf

Tuesday, July 18, 2017

10 most important seo rules

  • Select the right keywords really searchable by audience.
  • Select the domain name that reflect the keywords.
  • Use keywords in file names and folders if you have .
  •  Use keywords in your page titles "H1,H2,......" and the main title
  • Use keyword text in the internal links and their titles and alt attributes.
  • the Content is king , so don't  spaghettize  keywords , use with care
  • put keywords in the  Description meta tag
  • ssl is preferred for the links
  • Use keyword text in your out and in links
  •  Don't forget the site map

Monday, July 10, 2017

Warning: session_start(): Setting option 'session.hash_function' failed in on line

When I tried to add options parameters to session_start() php function, I got this warning
"Warning: session_start(): Setting option 'session.hash_function' failed in  on line "

I was using the full name of the parameter like this

session_hash_function
 
But the session_start function requires these parameters without the prefix "session", So the new parameter will be "hash_function"
session_start(["hash_function" =>  5 ]);

Notice: in PHP7.1: Session IDs will no longer be hashed upon generation. With this change brings about the removal of the following four ini settings:
    session.entropy_file
    session.entropy_length
    session.hash_function
    session.hash_bits_per_character