How to create a user with readonly privileges for all databases in Postgresql?

You need to do 2 things: firstly, allow access to existing objects; and secondly, set the default access for new objects created from now on. Note that granting access to “TABLES” includes views, but does not include sequences (such as the auto-increment function for “SERIAL” columns), so you’ll probably want to grant access to those … Read more

Accessing Environment Variables from Windows Services

I’ve no idea if this is useful, but I’ve found that for every service, there is an option to add environment variables directly to a service. It is done via the registry. Say the key to your service is … HKLM\SYSTEM\CurrentControlSet\Services\YourService Create a REG_MULTI_SZ called Environment. Now you can add entries like … Var1=Value1 Var2=Value2 … Read more

Copy file permissions, but not files [closed]

You should have a look at the –reference option for chmod: chmod –reference version2/somefile version1/somefile Apply find and xargs in a fitting manner and you should be fine, i.e. something like ~/version2$ find . -type f | xargs -I {} chmod –reference {} ../version1/{} This even works recursively, and is robust against missing files in … Read more

How to Grant permission to user on Certificate private key using powershell?

Here is the Answer. Created a powershell script file AddUserToCertificate.ps1 Here is the content for script file. param( [string]$userName, [string]$permission, [string]$certStoreLocation, [string]$certThumbprint ); # check if certificate is already installed $certificateInstalled = Get-ChildItem cert:$certStoreLocation | Where thumbprint -eq $certThumbprint # download & install only if certificate is not already installed on machine if ($certificateInstalled -eq … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)