Skip to content

Instantly share code, notes, and snippets.

@AndreiTelteu
Created January 31, 2020 12:55
Show Gist options
  • Save AndreiTelteu/cb79d2e9d0b67b155b008c896f841541 to your computer and use it in GitHub Desktop.
Save AndreiTelteu/cb79d2e9d0b67b155b008c896f841541 to your computer and use it in GitHub Desktop.
Add ssl certificate to your roots/sage based wordpress theme's brpwsersync dev proxy

If you are developing with the wordpress theme starter kit roots/sage, and you want to specify a custom ssl certificate for the dev proxy when you run yarn start, add the ssl certs this way:

Open \wp-content\themes\your-sage-theme\resources\assets\build\webpack.config.watch.js

Add the advanced.browserSync config after delay:

    new BrowserSyncPlugin({
      target,
      open: config.open,
      proxyUrl: config.proxyUrl,
      watch: config.watch,
      delay: 500,
      
      // add this object
      advanced: {
        browserSync: {
          https: {
            key: "absolute-path-to-your/ssl-certificate.key",
            cert: "absolute-path-to-your/ssl-certificate.crt"
          },
        },
      },
      
      
    }),
@AndreiTelteu
Copy link
Author

Create a new file called temps in a folder that is included in PATH (example nano .local/bin/temps)

#!/bin/bash
# Purpose: Display the ARM CPU and GPU  temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# source: https://www.cyberciti.biz/faq/linux-find-out-raspberry-pi-gpu-and-arm-cpu-temperature-command/
# modified by: Andrei Telteu
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
hdd=/dev/sda    # lsblk -d to see all
echo "$(date +'%Y-%m-%d %T') @ $(hostname)"
echo "-------------------------------------------"
echo "CPU => $((cpu/1000))° C"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp | egrep -o '[0-9]*\.' | egrep -o '[0-9]*')° C"

# method 1 for hdd temp; must have installed hddtemp; install with sudo apt-get install hddtemp
echo "HDD => $(sudo hddtemp sata:$hdd | egrep -o '\: [0-9]*' | egrep -o '[0-9]*')° C"

# method 2 for hdd temp; must have installed smartmontools; install with sudo apt-get install smartmontools
#echo "HDD => $(sudo smartctl -d sat -A -T permissive $hdd | grep Temperature_Celsius | egrep -o '[0-9]* \(' | egrep -o '[0-9]*')° C"

Give the file permission to execute: chmod +x .local/bin/temps

To change the HDD you want to monitor, first run lsblk -d to see your available devices, then change the hdd variable.

If HDD temperature does not work, try method to by commenting the first echo HDD and uncommenting the second one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment