Change WordPress file rights on Synology

If you copied a wordpress file structure to your NAS you possible endup in wrong file rights.

Open Telnet session and change to superuser mode . After that, change owner and rights so WordPress is working without errors.

su sudo

cd /volume1/web

chmod -R 644 ./wordpress
chmod -R a+rX ./wordpress
chown -R http:http ./wordpress

Result:


 

Posted in Fix IT, Information Technology | Tagged , | Comments Off on Change WordPress file rights on Synology

German date is not accepted in Powershell

Problem:

Systems or commands  working with english datetime do not accept german date formats. Converting them directly to Datetime ist not possible.
 “System.DateTime”. Error: “String was not recognized as a valid DateTime.”
Example:

Solution:

Convert the date to an english datetime in case there are dots in it. German = 28.02.2017 , English 02/28/2017

$DateValue = "28.02.2017" # Play with this two values
$DateValue = "02/28/2017" # Play with this two values
 
 
if ($DateValue.contains("."))
            {
            $DateValue = [datetime]::parseexact($DateValue,"dd.MM.yyyy",$null)
            Write-host "de"
            }
Else
            {
            $DateValue = [datetime]$DateValue
            Write-host "en"
            }

 

Posted in Information Technology | Tagged | Comments Off on German date is not accepted in Powershell

Permalink dos not change in WordPress

I changed to a new Synology NAS from DSM 5.2 to 6.1. After migrating my WordPress site Permalinks worked only in default mode. On my old NAS i used to have something like “/2013/10/file-open-security-warning/”  .

Problem:

The permalink update is not running after a change. So all posts ended up in 404 Errors.

Solution:

Changing the website server from Nginx to Apache within virtual host settings solved the Problem.

Synology Virtual Host

Posted in Fix IT, Information Technology | Tagged , | Comments Off on Permalink dos not change in WordPress

Cleanup winsxs folder

Do not delete files manually from winsxs folder . Instead use the following command to remove old servicepack files.

dism.exe /online /cleanup-Image /spsuperseded
Posted in Fix IT, Tips | Comments Off on Cleanup winsxs folder

Check NTP on windows computer

Start a command  shell and use the following command.  Here ch.pool.ntp.org is an array of ntp servers delivered by dns query.

w32tm /stripchart /computer:ch.pool.ntp.org /dataonly /samples:5

You should get a response like  this. In this sample the first few request are delayed. This is not so good.

w32tm.jpg

Posted in Fix IT, Information Technology | Tagged | Comments Off on Check NTP on windows computer

SCOM, find stucked agents

Some times agents start to stop collecting data without stopping completely . this is often when client are overloaded or management servers are for a while unavailable. In my case most times disk space counters stopped working as on of the first roles. So check this counter frequently, like every week or after maintenance jobs.

It can be easy done by using a query towards ops db.

First create a view

CREATE VIEW [dbo].[50beansDiskFreeSpace]
AS
SELECT TOP (10) PERCENT bme.Path, ps.PerfmonInstanceName, pdav.SampleValue, pdav.TimeSampled, dbo.MaintenanceMode.IsInMaintenanceMode
FROM dbo.PerformanceDataAllView AS pdav WITH (NOLOCK) INNER JOIN
dbo.PerformanceSource AS ps WITH (NOLOCK) ON pdav.PerformanceSourceInternalId = ps.PerformanceSourceInternalId INNER JOIN
dbo.Rules AS r WITH (NOLOCK) ON ps.RuleId = r.RuleId INNER JOIN
dbo.BaseManagedEntity AS bme WITH (NOLOCK) ON ps.BaseManagedEntityId = bme.BaseManagedEntityId INNER JOIN
dbo.MaintenanceMode ON bme.BaseManagedEntityId = dbo.MaintenanceMode.BaseManagedEntityId
WHERE (r.RuleName LIKE N'%LogicalDisk.FreeMB%' OR
r.RuleName = N'Microsoft.Windows.Server.ClusterDisksMonitoring.ClusterDisk.Monitoring.CollectPerfDataSource.FreeSpaceMB') AND (pdav.TimeSampled =
(SELECT MAX(TimeSampled) AS Expr1
FROM dbo.PerformanceDataAllView
WHERE (PerformanceSourceInternalId = pdav.PerformanceSourceInternalId)))
ORDER BY pdav.TimeSampled
GO

Now run the view . On top you will find all disks in Maintenance mode. It is clear they did not collect any data within the last few minutes . After that follow all servers with a partly disabled agent. on the bottom you will find clients having an TimeSampled within an few minutes. They are working well.

Posted in Fix IT, Information Technology | Tagged | Comments Off on SCOM, find stucked agents

Powershell from scheduled task

As powershell is running by default in secure mode , use the following setting to run powershell scripts from a scheduled task.

This way you do not have to elevate the rights for running scripts. Ensure your Powershell script is located in a folder where he is well protected from tempering bud accessible by the user the scheduled task is running under.

 

executable: Powershell.exe

Option: -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden -File <Path and Scriptname>

Example for Option :-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden –File C:\scripts\myscript.ps1

Posted in Information Technology, Tips | Tagged | Comments Off on Powershell from scheduled task