Configure Raspberry Pi Wifi Command Line


We need to first modify wpa_supplicant.conf to add the network we want the Raspberry Pi to connect to.

Add the to the end of the file.

Then we need to modify the Raspberry Pi’s interface file to modify wlan0 to use dhcp.

Change the following lines.

change the top 3 lines to match the bottom, note the inet manual/dhcp change.

wpa_supplicant should see the changes automatically, if not run


Configure OpenLDAP Logging on CentOS 7


By default slapd doesn’t log anything to syslog, to allow slapd to begin logging on CentOS 7 we need can add the olcLogLevel directive to the cn=config database for your OpenLDAP installation.


This directive specifies the level at which logging/debugging statements and operation statistics should be syslogged to the local4.* facility. Log levels may be specified as integers or by keyword. Multiple log levels may be used and the levels are additive. The LogLevel Integers/Keywords are in a table below.

Level Keyword Description
-1 Any enable all debugging
0 no debugging
1 Trace trace function calls
2 Packets debug packet handling
4 Args heavy trace debugging
8 Conns connection management
16 BER print out packets sent and received
32 Filter search filter processing
64 Config configuration processing
128 ACL access control list processing
256 Stats stats log connections/operations/results
512 Stats2 stats log entries sent
1024 Shell print communication with shell backends
2048 Parse print entry parsing debugging
4096 Cache database cache processing
8192 Index database indexing
16384 Sync syncrepl consumer processing
  • To configure the olcLogLevel directive on your installation of OpenLDAP first create a file called logging.ldif and in that file place the folllowing;

  • Run ldapmodify to insert the logging.ldif in to your LDAP database.

  • Now we need to configure rsyslog on CentOS 7 to log the local4.* facility that slapd uses and register all logs to a separate file. Add the following line to /etc/rsyslog.conf.

  • Touch the file.

Restart rsyslog/slapd.

Verify OpenLDAP is logging to the file by tailing the log file and making connections to LDAP.

You have now configured logging in LDAP.

Configuring OpenLDAP Security TLS/LDAPS


This is a guide in a series of which part 1 can be found here in which we setup a OpenLDAP server, in this straightforward guide we will configure OpenLDAP security. Please note, we don’t cover such topics as Firewall rules(iptables) as that’s consider basic system security.


We’re going to assume you have your SSL certificates, self-signed or purchased.

  • ca-bundle.crt
  • server.crt
  • server.key

Add the following to a file called security.ldif

We are adding the 4 statements below with the path to the files and directory of our SSL certificates.

  • olcTLSCACertificateFile
  • olcTLSCACertificatePath
  • olcTLSCertificateFile
  • olcTLSCertificateKeyFile

Run the ldapmodify command below to apply the changes

If you’re client specifies it can now connect using StartTLS and LDAPS using an encrypted connection. StartTLS unlike LDAPS first creates the connection using an unencrypted connection. LDAPS uses SSL which has had a bad time lately, evaluate your options carefully.

Installing OpenLDAP 2.4 on CentOS 7


Below is straight-forward guide to setting up LDAP on CentOS 7, it’s expected that SELINUX is disabled. NOTE: This LDAP implementation is not secure enough to be used in a production environment. See other guide posts in this series.

  • Install OpenLDAP server

  • Add the server hostname to hosts file manually /etc/hosts

  • Start OpenLDAP

  • Start OpenLDAP at boot

Continue reading

Change the Hostname on Mac OS X El Captain

OS X El Captain

OS X El Captain

Use the commands below replacing “falcon” with your desired choose of name for your hostname on your machine.

The last command will require sudo/admin privileges.

Rotate Raspberry Pi 7″ Touchscreen Display

When using the Raspberry Pi 7″ Touchscreen Display with the stand from Pimoroni the screen will be upside when first loading. Once you have installed Raspbian you can edit a file to rotate the screen and mouse calibration.

Add the following to the bottom of the /boot/config.txt file

Reboot your Raspberry Pi and the screen will be in the correct rotation when used with the stand.

Fix MySQL Slave – Relay Log Corrupted

If you find one of your MySQL Slave’s relay logs has been corrupted, usually with an Error message such as;

Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master’s binary log is corrupted (you can check this by running ‘mysqlbinlog’ on the binary log), the slave’s relay log is corrupted (you can check this by running ‘mysqlbinlog’ on the relay log), a network problem, or a bug in the master’s or slave’s MySQL code. If you want to check the master’s binary log or slave’s relay log, you will be able to know their names by issuing ‘SHOW SLAVE STATUS’ on this slave. Fixing this issue is usually straightforward as long as you don’t leave the replication broken for too long. First log into MySQL on the effected slave and run

We need to use the Relay_Master_Log_File value and the Exec_Master_Log_Pos value to reset the slave to that point fixing replication.

Replication on the slave should now be fixed, verify to confirm.

Modify Elasticsearch Index Replica Settings

When using Elasticsearch by default newly created indexes will have 5 shards and 1 replica, this is great for basic installations but when you want redundancy for your data and to improve search speed, you need to fine tune your Elasticsearch cluster.

Elasticsearch provide the use of the Indices API to modify settings for your indexes, using the Indices API we can update the amount of replicas your index has by using the following command.

Your Elasticsearch cluster will go Yellow whilst it is creating replicas on each of your nodes for your index, this shouldn’t take long to process.

Update Default Logstash Elasticsearch Template

If you have configured the ELK stack, you will most likely have used the default Elasticsearch index template provided by Logstash’s elasticsearch output-plugin.

We can update this template to modify settings on newly created indexes without having to modify your elasticsearch.yml configuration file and perform a rolling cluster reboot.

The default logstash template can be found here.

Below is the modified elasticsearch index template provided by logstash. We have added number_of_replicas and increased from the default value of 1 to 2 to increase search performance this will apply to newly created indexes.

To apply the new template, you will need to PUT the changes using curl. Use the command below.

NOTE: We have truncated the JSON to show you the command, you will need to replace the JSON with your desired changes.

Windows Server 2012 – WDS Capture Image Fails with 0xc000000f


If you are using Windows Server 2012 R2, Windows Deployment Server and are unable to use the Capture Image that you created using WDS, you can do the following to get around the issue.

First we mount the .wim file

After we have mounted, normally we would make changes to the offline .wim but in this case we are just going to commit the changes…Yes we haven’t made any changes but we still need to commit to close the .wim

Replace or Import the image back into WDS. Use a machine and try to boot the Capture image it will now successfully load.