add Xmpp Apt Notifications
This commit is contained in:
@ -2,3 +2,8 @@ h1 {
|
||||
font-weight: 600 !important;
|
||||
color: black !important;
|
||||
}
|
||||
|
||||
.center {
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
@ -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}
|
||||
|
68
docs/posts/xmpp-apt-notifications.md
Normal file
68
docs/posts/xmpp-apt-notifications.md
Normal file
@ -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 <password>
|
||||
```
|
||||
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 <yourself>@example.com
|
||||
```
|
||||
|
||||
## **Receive Notifications on Android Device**
|
||||
|
||||
<div align="center">
|
||||
<em>Example Notification in Yaxim on Android</em>
|
||||
</div>
|
||||
|
||||
{: .center }
|
Reference in New Issue
Block a user