Allow linux users to login using ldap

Allow linux users to login using ldap

To enable LDAP authentication, we need to install the nslcd package. When configured properly this will allow us to add users and have them authenticate via LDAP. Local users will still be able to login using a local password, think of it as a fall through mechanism. apt-get install nslcd The installer will ask you some questions. LDAP URL: usually something like ldap://mycompany.com LDAP root to search in: usually something like: DC=mycompany,DC=com, but you could put a specific container/group if…

Read More Read More

MariaDB/MySQL group by error

MariaDB/MySQL group by error

After we upgraded our MySql/MariaDB installation to 5.7.16 our CiviCRM gave us some “unknown DB errors”. We traced it back to a group by error thrown by MySql. As of version 5.7.5 the default SQL modes includes the ONLY_FULL_GROUP_BY option. To fix this issue you can of course change your code, but if that isn’t an option, you can remove this mode setting. First select your existing modes: mysql> SELECT @@SQL_MODE, @@GLOBAL.SQL_MODE; This will output all enabled modes. Copy both…

Read More Read More

Dell DRAC SSL Error when using console

Dell DRAC SSL Error when using console

When using DRAC to connect to the console you get the following error. Error when reading from SSL socket connection This error also appears after every java update. How to fix this? Navigate to the following directories (your JRE version can be different): C:\Program Files\Java\jre1.8.0_111\lib\security\java.security C:\Program Files (x86)\Java\jre1.8.0_111\lib\security\java.security Open the 2 files and comment out these lines (use # in front of the line): jdk.certpath.disabledAlgorithms=MD2, MD5, RSA keySize < 1024 jdk.tls.disabledAlgorithms=SSLv3, RC4, MD5withRSA, DH keySize < 768 Also make sure the…

Read More Read More

OpenSSL create certificate request

OpenSSL create certificate request

Execute this command from a terminal/command window to generate a new private key and a new certificate signing request (csr). openssl req -new -newkey rsa:4096 -nodes -keyout yourdomain.key -out yourdomain.csr -sha256 It will ask you some questions Country Name (2 letter code) [AU]:BE State or Province Name (full name) [Some-State]: Antwerpen Locality Name (eg, city) []: Antwerpen Organization Name (eg, company) [Internet Widgits Pty Ltd]: My Company Name Organizational Unit Name (eg, section) []: Department X Common Name (e.g. server…

Read More Read More

Access older SMB shares on windows 10 and windows 8

Access older SMB shares on windows 10 and windows 8

Open a new powershell window as administrator and execute the following commands: Set-SmbClientConfiguration -RequireSecuritySignature 1 Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters" RequireSecureNegotiate -Value 0 -Force You’ll now be able to connect to older SMB shares.

Protecting GRUB

Protecting GRUB

I stumbled across this neat “little” security tool that runs a bunch of checks on your system and warns if any potentials problems are detected. It is called Lynis and on arch you can install it by executing: pacman -S lynis then lynis audit system To start an audit of your system. It told me a number of things, but one caught my attention: “GRUB password protection”. Now why is this important? Well you could restrict users from booting certain…

Read More Read More

Execute large SQL script on MS SQL server

Execute large SQL script on MS SQL server

Having trouble executing a large SQL script using the SQL server management studio? Use the command line tool sqlcmd sqlcmd -S server\instance -i script_file.sql This should work, unless you have errors in your script of course 😉 Don’t forget to start your script with a correct use statement. use databaseNameHere;

.NET Web API OData and Entity Framework Database First: No Key defined

.NET Web API OData and Entity Framework Database First: No Key defined

When using EF database first, I came across an error: No Key defined… Turns out the generated classes are not decorated with the [Key] attribute. You can manually add them but once you generate your model(s) again, it’s all gone. There are workarounds floating across the internet to edit the T4 template(s) that generate these models, but every developer has to do that, plus I didn’t want to fiddle around with those files. Another way is to map your key(s)…

Read More Read More

.NET Web API and OData: Cannot serialize a null ‘feed’

.NET Web API and OData: Cannot serialize a null ‘feed’

Recently I came across an error when working with oData and web API. Cannot serialize a null ‘feed’. System.Runtime.Serialization.SerializationException I couldn’t really find a solution online, but it turns out i just forgot to decorate my method parameter with [FromODataUri]. [EnableQuery] public IQueryable Get([FromODataUri] ODataQueryOptions queryOptions) { … } Now you can use $expand and $select in your URL without issues.