diff --git a/docs/extra.css b/docs/extra.css index f293cbd..7c03440 100644 --- a/docs/extra.css +++ b/docs/extra.css @@ -2,3 +2,8 @@ h1 { font-weight: 600 !important; color: black !important; } + +.center { + display: block; + margin: 0 auto; +} diff --git a/docs/index.md b/docs/index.md index e9271eb..12890d2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -5,6 +5,7 @@ authors: ["trent"] # Trent's Blog ## **Posts By Date** +* [2021-01-09: Xmpp Apt Notifications](posts/xmpp-apt-notifications.md){target=_blank} * [2020-12-20: Apache Virtual Hosts](posts/apache-virtual-hosts.md){target=_blank} * [2020-12-19: SENDXMPPHandler for Python Logging](posts/sendxmpp-handler-for-python-logging.md){target=_blank} * [2020-12-17: Instructions for Tethering From Phone](posts/instructions-for-tethering-from-phone){target=_blank} diff --git a/docs/posts/xmpp-apt-notifications.md b/docs/posts/xmpp-apt-notifications.md new file mode 100644 index 0000000..182780f --- /dev/null +++ b/docs/posts/xmpp-apt-notifications.md @@ -0,0 +1,68 @@ +--- +title: "Xmpp Apt Notifications" +date: 2021-01-09 +draft: false +tags: ["apt","apt-get","prosody","debian"] +authors: ["trent"] +--- +date: 2021-01-09 + +## **Introduction** +In order to save yourself the work of checking your computer for +updates, configure it to send you a weekly notification for updates +using cron and sendxmpp. + +## **Register an Xmpp User** +`ssh` into your prosody server and use `prosodyctl` to create a user +for your computer. + +i.e. for your htpc: +```console +# prosodyctl adduser htpc@example.com +``` +You will be prompted to create a password. + +## **Install sendxmpp** +`ssh` into your computer and install `sendxmpp`. + +i.e. for your htpc: +```console +$ sudo apt-get install sendxmpp +``` + +## **Configure sendxmpp** +`ssh` into your computer and login as the root user +using +```console +$ sudo su +``` +write the following contents into `/root/.sendxmpprc`, i.e. +for your htpc +```conf +htpc@example.com;example.com +``` +secure your `.sendxmpprc` file by making it read-only, and +only accessible by the root user +```console +# chmod 600 /root/.sendxmpprc +``` + +## **Create Cron Job** +While still logged in as root, open `crontab` for editing. +```console +# crontab -e +``` +And then write a command in `crontab`, i.e. for your htpc. +```conf +#!/bin/bash +PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +15 3 * * 4 apt-get update && apt-get -u upgrade --assume-no | sendxmpp -t -u htpc @example.com +``` + +## **Receive Notifications on Android Device** + +
+ Example Notification in Yaxim on Android +
+ +!["Yaxim ScreenShot"](https://photos.boringonian.com/1280_IMG_20210109_155515.jpg){: .center } diff --git a/mkdocs.yml b/mkdocs.yml index 5c24185..cf19e80 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -19,6 +19,7 @@ markdown_extensions: nav: - Home: - Home: index.md + - posts/xmpp-apt-notifications.md - posts/apache-virtual-hosts.md - posts/sendxmpp-handler-for-python-logging.md - posts/instructions-for-tethering-from-phone.md diff --git a/site/404.html b/site/404.html index 39ffb8c..ae50fa5 100644 --- a/site/404.html +++ b/site/404.html @@ -225,6 +225,18 @@ +
  • + + Xmpp Apt Notifications + +
  • + + + + + + +
  • Apache Virtual Hosts diff --git a/site/extra.css b/site/extra.css index f293cbd..7c03440 100644 --- a/site/extra.css +++ b/site/extra.css @@ -2,3 +2,8 @@ h1 { font-weight: 600 !important; color: black !important; } + +.center { + display: block; + margin: 0 auto; +} diff --git a/site/index.html b/site/index.html index 3f090ac..f4d9e0a 100644 --- a/site/index.html +++ b/site/index.html @@ -281,6 +281,18 @@ +
  • + + Xmpp Apt Notifications + +
  • + + + + + + +
  • Apache Virtual Hosts @@ -503,6 +515,7 @@

    Trent's Blog

    Posts By Date

      +
    • 2021-01-09: Xmpp Apt Notifications
    • 2020-12-20: Apache Virtual Hosts
    • 2020-12-19: SENDXMPPHandler for Python Logging
    • 2020-12-17: Instructions for Tethering From Phone
    • @@ -540,13 +553,13 @@