These are the steps install or update the SSL certificate on Ubiquiti UniFi Controller software.
- Login to linux host via SSH, then sudo su – root.
- Copy SSL certificate, key file, and CA Bundle onto host.
- Verify the existing keystore – keytool -list -keystore /var/lib/unifi/keystore, password is aircontrolenterprise.
- Backup the original keystore – cp /var/lib/unifi/keystore /home/keystore.orig.
- Start the generation of the new keystore – openssl pkcs12 -export -in /tmp/STAR_rm-pc_com.crt -inkey /tmp/STAR_rm-pc_com_key.txt -out /tmp/tmpkeystore -passout pass:aircontrolenterprise -name unifi
- Complete the generation of the new keystore – keytool -importkeystore -srckeystore /tmp/tmpkeystore -srcstorepass aircontrolenterprise -destkeystore /tmp/newkeystore -deststorepass aircontrolenterprise -alias unifi -trustcacerts
- Copy the new keystore into place – cp /tmp/newkeystore /var/lib/unifi/keystore
- Restart the controller software – systemctl restart unifi
- Verify the SSL Certificate is coming up and correct using a web browser and go to: https://yourctrl.name:8443.
So you have a Raspberry Pi that you are wanting to run the GUI on and not have the display go to sleep (maybe running some displays for a NOC?), well, here’s my setup:
- Login as your user that will auto-login to the GUI desktop, and start a Terminal session.
- From the Terminal, perform the following to remove the default VNC server:
sudo apt remove vnc4server tightvncserver
sudo apt autoremove
- Then, install Vino and xRDP:
sudo apt install vino xrdp
- Now, perform the following as your user:
xset s off
xset s noblank
- Lastly, as your user, execute the following commands:
gsettings set org.gnome.Vino require-encryption false <== Turns off encryption
gsettings set org.gnome.Vino prompt-enabled false <== Turns off prompting for an account
gsettings set org.gnome.Vino authentication-methods "['vnc']" <== Sets the default authentication method for Vino to VNC
gsettings set org.gnome.Vino vnc-password "$(echo -n 'APWnot<8' | base64)" <== Sets a password to authenticate the session with. NOTE - password needs to be 8 characters or less.
- Now, perform the following to configure xRDP:
sudo vi /etc/xrdp/xrdp.ini
name=Active Local Login
sudo systemctl enable xrdp
sudo systemctl restart xrdp
- Now, perform the following to configure lightDM:
sudo vi /etc/lightdm/lightdm.conf
xserver-command=X -s 0 -dpms
- Now reboot the pi, and test your connectivity. You should now connect to the active, logged in session that is on the screen.
To clean up unused packages on a host:
yum install yum-utils
package-cleanup --leaves --all
sudo apt-get autoclean && sudo apt-get autoremove
If you have a Windows 10 host on a network, let’s say 192.168.100.28, and a monitoring host on a server network, let’s say 192.168.200.12. Other hosts that are on the 192.168.100.0/24 network are currently able to ping the Windows 10 host but not your monitoring host. The easy fix is to open an elevated command prompt, and then type:
netsh firewall set icmpsetting type=all mode=enable
Add/set the following in /boot/config.txt:
# Stops CPU Ramping
# Helps to avoid SD card corruption from force_turbo
# Disable Bluetooth & WiFi
Add/Set the following in the /boot/cmdline.txt:
# Turn off dynamic clock ticks
# Changes the I/O scheduler to noop, which is better for SD cards and flash storage devices.
Change CPU Performance:
apt install cpufrequtils
Reboot & verify the governor setting.
This is dependent upon the version of Linux you are using:
export HISTTIMEFORMAT='%F %T '
Which should return:
998 2016-02-09 14:03:35 crontab -l | grep oracle
999 2016-02-09 14:03:35 crontab -l -u oracle
Sometimes, you need to parse a nagios.log, and even more so, need to be able to read the date and time of a logged event. Here’s a simple command-line to do that:
cat /usr/local/nagios/var/nagios.log | perl -pe 's/(\d+)/localtime($1)/e'