Quickly adding SSH public key to Authorized Hosts

Quickly adding SSH public key to Authorized Hosts

cat ~/.ssh/id_rsa.pub | ssh USER@HOST "mkdir -p ~/.ssh && cat >> ~/.ssh/authorized_keys"

Raspberry Pi Tweaks

Raspberry Pi WiFi Dropouts (rt8192cu)

Check which driver it is using:

readlink /sys/class/net/wlan0/device/driver

If it’s ../../../../../../../../../bus/usb/drivers/rtl8192cu then:

sudo nano /etc/modprobe.d/8192cu.conf

And set contents:

# Disable power saving
options 8192cu rtw_power_mgnt=0 rtw_enusbss=1 rtw_ips_mode=1

Raspberry Pi Tweaks

Raspberry Pi Tweaks

Disable HDMI Output

/usr/bin/tvservice -o

Add this line to /etc/rc.local to enable on startup.

Run /usr/bin/tvservice -p to turn it back on.

Disable LEDs

https://www.jeffgeerling.com/blogs/jeff-geerling/controlling-pwr-act-leds-raspberry-pi

Pi Zero

# Disable the ACT LED on the Pi Zero.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=on

All Other Pis

# Disable the ACT LED.
dtparam=act_led_trigger=none
dtparam=act_led_activelow=off

# Disable the PWR LED.
dtparam=pwr_led_trigger=none
dtparam=pwr_led_activelow=off

Disable USB Ports

echo 0x0 > /sys/devices/platform/soc/3f980000.usb/buspower

Add this line to /etc/rc.local to enable on startup.

Run echo 0x1 > /sys/devices/platform/soc/3f980000.usb/buspower to turn it back on.

Homenet Pre-Requisite Setup on Raspberry Pi

Node JS

http://blog.denwilliams.net/2016/05/02/node-js-on-raspbian/

PM2

Install and set to auto-start: http://blog.denwilliams.net/2017/04/22/pm2-raspbian-autostart/

Redis

http://mjavery.blogspot.com.au/2016/05/setting-up-redis-on-raspberry-pi.html

Mosquitto

sudo apt-get install mosquitto

Flic

Getting Flic Buttons Running on the Raspberry Pi 3 - Take 2

Clone it to the Pi:

sudo apt-get install git
cd /opt
sudo git clone https://github.com/50ButtonsEach/fliclib-linux-hci

Create the data folders:

sudo mkdir /var/lib/flic

Create a systemd start script:

sudo nano /etc/systemd/system/flicd.service

Contents:

[Unit]
Description=flicd Service
After=bluetooth.service
Requires=bluetooth.service

[Service]
TimeoutStartSec=0
ExecStart=/opt/fliclib-linux-hci/bin/armv6l/flicd -f /var/lib/flic/flic.db -s 0.0.0.0 -h hci0 -w -l /var/log/flic.log
Restart=always
RestartSec=3

[Install]
WantedBy=multi-user.target

…then…

sudo systemctl enable flicd

Restart.

Boom.