Monday, December 17, 2018

HP Proliant Microserver Gen10 Marvell BIOS RAID setup

Hi, Its incredible how difficult HPE makes some easy things.
I take 4h to find this solution.
You enter Setup (F2) and change to legacy mode. Restart and Ctrl+M

Accessing the Marvell BIOS Utility under legacy boot mode
The UEFI boot mode is the server default boot mode. To switch to legacy boot mode, see Selecting the
boot mode on page 64.
Procedure
1. Reboot the server.
2. On the POST drive information screen, press Ctrl+M.

Wednesday, October 31, 2018

Windows 10 shared folder not accessible

https://support.microsoft.com/en-us/help/4046019/guest-access-in-smb2-disabled-by-default-in-windows-10-and-windows-ser

Symptoms


In Windows 10, version 1709, Windows Server version 1709, and Windows Server 2019, the SMB2 client no longer allows the following actions:
 
  • Guest account access to a remote server
  • Fallback to the Guest account after invalid credentials are provided
SMBv2 has the following behavior in Windows 10, version 1709, Windows Server version 1709, and Windows Server 2019:
  • Windows 10 Enterprise and Windows 10 Education no longer allow a user to connect to a remote share by using guest credentials by default, even if the remote server requests guest credentials.
  • Windows Server 2016 Datacenter and Standard edition no longer allow a user to connect to a remote share by using guest credentials by default, even if the remote server requests guest credentials.
  • Windows 10 Home and Professional editions are unchanged from their previous default behavior.
If you try to connect to devices that request credentials of a guest instead of appropriate authenticated principals, you may receive the following error message: 
 

Cause


This change in default behavior is by design and is recommended by Microsoft for security.
 
A malicious computer that impersonates a legitimate file server could allow users to connect as guests without their knowledge. Microsoft recommends that you do not change this default setting. If a remote device is configured to use guest credentials, an administrator should disable guest access to that remote device and configure correct authentication and authorization.
 
Windows and Windows Server have not enabled guest access or allowed remote users to connect as guest or anonymous users since Windows 2000. Only third-party remote devices might require guest access by default. Microsoft-provided operating systems do not.
 

Resolution


If you want to enable insecure guest access, you can configure the following Group Policy settings:
 
Computer configuration\administrative templates\network\Lanman Workstation
"Enable insecure guest logons"
 
Note By enabling insecure guest logons, this setting reduces the security of Windows clients. 
 
Example :
Default Registry Value: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters] "AllowInsecureGuestAuth"=dword:0 Configured Registry Value: [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters] "AllowInsecureGuestAuth"=dword:1

More Information


This setting has no effect on SMB1 behavior. SMB1 continues to use guest access and guest fallback.
 
SMB1 is uninstalled by default in latest Windows 10 and Windows Server configurations. For more information see SMBv1 is not installed by default in Windows 10 Fall Creators Update and Windows Server, version 1709.

Monday, September 17, 2018

mysql incorrect information in file corrupt error

https://serverfault.com/questions/422507/mysql-incorrect-information-in-file-corrupt-error
Incorrect information in file:    './cacti/poller_item.frm'
.frm file stores the table format. Try this:
  • Stop MySQL
  • Take the backup of poller_item.frmpoller_item.MYDpoller_item.MYI
  • Drop the poller_item table
  • Start MySQL
  • Recreate poller_item table by using CREATE TABLE statement in cacti.sql (uses the corresponding version that you're running)
  • Stop MySQL
  • Copy the poller_item.MYDpoller_item.MYI into the datadir
  • Start MySQL again

Monday, August 20, 2018

string to array with IFS

https://stackoverflow.com/questions/10586153/split-string-into-an-array-in-bash
http://wiki.bash-hackers.org/commands/builtin/read


IFS=', ' read -r -a array <<< "$string"
Note that the characters in $IFS are treated individually as separators so that in this case fields may be separated by either a comma or a space rather than the sequence of the two characters. Interestingly though, empty fields aren't created when comma-space appears in the input because the space is treated specially.
To access an individual element:
echo "${array[0]}"
To iterate over the elements:
for element in "${array[@]}"
do
    echo "$element"
done
To get both the index and the value:
for index in "${!array[@]}"
do
    echo "$index ${array[index]}"
done
The last example is useful because Bash arrays are sparse. In other words, you can delete an element or add an element and then the indices are not contiguous.
unset "array[1]"
array[42]=Earth
To get the number of elements in an array:
echo "${#array[@]}"
As mentioned above, arrays can be sparse so you shouldn't use the length to get the last element. Here's how you can in Bash 4.2 and later:
echo "${array[-1]}"
in any version of Bash (from somewhere after 2.05b):
echo "${array[@]: -1:1}"
Larger negative offsets select farther from the end of the array. Note the space before the minus sign in the older form. It is required.

There was a solution involving setting Internal_field_separator (IFS) to ;. I am not sure what happened with that answer, how do you reset IFS back to default?
RE: IFS solution, I tried this and it works, I keep the old IFS and then restore it:
IN="bla@some.com;john@home.com"

OIFS=$IFS
IFS=';'
mails2=$IN
for x in $mails2
do
    echo "> [$x]"
done

IFS=$OIFS
BTW, when I tried
mails2=($IN)
I only got the first string when printing it in loop, without brackets around $IN it works.

Thursday, February 01, 2018