Code/Cdcopy.md
... ...
@@ -5,7 +5,7 @@ Bash script to automate copying data from [CDs][1][?][1].
5 5
Detects media insertion (via HAL, using polling \*blegh\*)
6 6
7 7
8
-
8
+```bash
9 9
#!/bin/bash
10 10
# cdcopy.sh: copy a data CD to disk
11 11
# mark AT cognomen DOT co DOT uk
... ...
@@ -33,8 +33,7 @@ while ((1)) ; do
33 33
fi
34 34
sleep 3
35 35
done
36
-
37
-[[$[Get Code]]][2]
36
+```
38 37
39 38
40 39
... ...
@@ -43,5 +42,4 @@ done
43 42
[cdcopy.sh][3]
44 43
45 44
[1]: Code.CDs?action=edit
46
- [2]: Code.Cdcopy?action=sourceblock&num=1
47
- [3]: http://markferry.net/code/cdcopy.sh
... ...
\ No newline at end of file
0
+ [3]: http://markferry.net/code/cdcopy.sh
Code/IncludeTree.md
... ...
@@ -6,7 +6,7 @@ Simple #include dependency printer.
6 6
* Searches for files in the current directory only
7 7
8 8
9
-
9
+```bash
10 10
#!/bin/sh
11 11
12 12
# Prints a #include dependency tree
... ...
@@ -39,6 +39,5 @@ if [ -z $@ ]; then
39 39
extract_includes
40 40
fi
41 41
42
-[[$[Get Code]]][1]
42
+```
43 43
44
- [1]: Code.IncludeTree?action=sourceblock&num=1
... ...
\ No newline at end of file
Code/SvnImportSnapshots.md
... ...
@@ -37,6 +37,7 @@ Bash script to commit snapshots to SVN branch
37 37
38 38
# Script
39 39
40
+```bash
40 41
#!/bin/sh
41 42
42 43
REPO_URL="http://path/to/project"
... ...
@@ -109,6 +110,5 @@ do
109 110
(($VERBOSE)) && echo $LABEL: tagged
110 111
done
111 112
112
-[[$[Get Code]]][1]
113
+```
113 114
114
- [1]: Code.SvnImportSnapshots?action=sourceblock&num=1
... ...
\ No newline at end of file
HomeAutomation/EurotronicStellaZ.md
... ...
@@ -23,6 +23,7 @@ Include
23 23
24 24
`stellaz-poll.sh`
25 25
26
+```
26 27
#!/bin/sh
27 28
set -e
28 29
... ...
@@ -56,10 +57,9 @@ do
56 57
enable_polling $value_id
57 58
done
58 59
59
-[[$[Get Code]]][1]
60
+```
60 61
61 62
Usage:
62 63
63 64
stellaz-poll.sh [node_ids...]
64 65
65
- [1]: HomeAutomation.EurotronicStellaZ?action=sourceblock&num=1
... ...
\ No newline at end of file
HomeAutomation/MqttDasherService.md
... ...
@@ -15,7 +15,7 @@ This assumes `npm install` without the global flag so uses `/opt/node_modules` i
15 15
16 16
# Install
17 17
18
-
18
+```bash
19 19
# install nodejs from debsource
20 20
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
21 21
sudo apt-get install -y nodejs
... ...
@@ -37,7 +37,7 @@ sudo chmod 750 /opt/node_modules/mqtt-dasher/nodejs.setcap
37 37
# allow raw sockets and net admin for promiscuous mode
38 38
sudo setcap 'CAP\_NET\_RAW+eip CAP\_NET\_ADMIN+eip' /opt/node_modules/mqtt-dasher/nodejs.setcap
39 39
40
-[[$[Get Code]]][1]
40
+```
41 41
42 42
43 43
... ...
@@ -69,9 +69,9 @@ sudo setcap 'CAP\_NET\_RAW+eip CAP\_NET\_ADMIN+eip' /opt/node_modules/mqtt-dashe
69 69
70 70
# Configure and start
71 71
72
+```
72 73
sudo mkdir /etc/mqtt-dasher
73
-
74
-[[$[Get Code]]][2]
74
+```
75 75
76 76
`/etc/mqtt-dasher/config.yml`
77 77
... ...
@@ -85,12 +85,11 @@ sudo mkdir /etc/mqtt-dasher
85 85
ab:cd:ef:12:34:56: ha/dash/listerine
86 86
87 87
88
-
89
-
88
+```
90 89
sudo systemctl enable mqtt-dasher
91 90
sudo systemctl start mqtt-dasher
92 91
93
-[[$[Get Code]]][3]
92
+```
94 93
95 94
96 95
... ...
@@ -103,7 +102,7 @@ An mqtt switch which:
103 102
* can be activated and deactivated from HA
104 103
105 104
106
-
105
+```yaml
107 106
switch:
108 107
- name: Listerine
109 108
platform: mqtt
... ...
@@ -113,7 +112,7 @@ switch:
113 112
payload_off: 'inactive'
114 113
retain: false
115 114
116
-[[$[Get Code]]][4]
115
+```
117 116
118 117
The switch isn't intended to be used in the HA UI, it should be mapped to a script instead.
119 118
... ...
@@ -123,8 +122,4 @@ The switch isn't intended to be used in the HA UI, it should be mapped to a scri
123 122
124 123
Compile mqtt-dasher with [nexe][5] so that `nodejs.setcap` can't be so easily abused.
125 124
126
- [1]: HomeAutomation.MqttDasherService?action=sourceblock&num=1
127
- [2]: HomeAutomation.MqttDasherService?action=sourceblock&num=2
128
- [3]: HomeAutomation.MqttDasherService?action=sourceblock&num=3
129
- [4]: HomeAutomation.MqttDasherService?action=sourceblock&num=4
130
- [5]: https://github.com/nexe/nexe
... ...
\ No newline at end of file
0
+ [5]: https://github.com/nexe/nexe
HomeAutomation/OwnTracks.md
... ...
@@ -18,6 +18,7 @@
18 18
19 19
## Send [PKCS12][1][?][1] encoded Client cert to the user
20 20
21
+```bash
21 22
openssl pkcs12 \
22 23
-export \
23 24
-in username.crt \
... ...
@@ -25,7 +26,7 @@ openssl pkcs12 \
25 26
-name "User's certificate/key" \
26 27
-out username.p12
27 28
28
-[[$[Get Code]]][2]
29
+```
29 30
30 31
On iOS the file needs a `.otrp` extension.
31 32
... ...
@@ -40,4 +41,3 @@ On iOS the file needs a `.otrp` extension.
40 41
start_type automatic
41 42
42 43
[1]: HomeAutomation.PKCS12?action=edit
43
- [2]: HomeAutomation.OwnTracks?action=sourceblock&num=1
... ...
\ No newline at end of file
HomeAutomation/OzwDaemon.md
... ...
@@ -22,12 +22,13 @@ Do this on a dev host. We don't need or want docker on the [RPi][9][?][9].
22 22
23 23
Get the latest `linux/arm` tag from <https://hub.docker.com/r/openzwave/ozwdaemon/tags>
24 24
25
+```bash
25 26
OZW=openzwave/ozwdaemon:latest@sha256:f51ed08d35d45280b3f5dccfc982d7914c27a548ca4453548b5713c6ab8ec9e8
26 27
docker pull $OZW
27 28
OZW_CONT=$(docker create $OZW)
28 29
docker export $OZW_CONT > ozwdaemon.f51ed08d.tar
29 30
30
-[[$[Get Code]]][10]
31
+```
31 32
32 33
33 34
... ...
@@ -50,9 +51,9 @@ I decided against doing `sudo rpi-update`.
50 51
51 52
Refer to the [ozwdaemon Dockerfile][11]
52 53
54
+```bash
53 55
apt-get -y install libunwind8 libcurl4 binutils libglib2.0- libicu63 wget
54
-
55
-[[$[Get Code]]][12]
56
+```
56 57
57 58
58 59
... ...
@@ -62,6 +63,7 @@ I suppose I should make a deb for it...
62 63
63 64
On the dev host:
64 65
66
+```
65 67
# explode the tar
66 68
tar xvf ozwdaemon.f51ed08d.tar
67 69
... ...
@@ -69,8 +71,7 @@ tar xvf ozwdaemon.f51ed08d.tar
69 71
70 72
scp usr/local/bin/ozwdaemon pi@rpi:.local/bin/
71 73
scp -r opt/qt pi@rpi:/opt/qt
72
-
73
-[[$[Get Code]]][13]
74
+```
74 75
75 76
76 77
... ...
@@ -172,7 +173,4 @@ scp -r opt/qt pi@rpi:/opt/qt
172 173
[7]: #toc6
173 174
[8]: #toc7
174 175
[9]: HomeAutomation.RPi?action=edit
175
- [10]: HomeAutomation.OzwDaemon?action=sourceblock&num=1
176 176
[11]: https://github.com/OpenZWave/qt-openzwave/blob/master/Docker/Dockerfile
177
- [12]: HomeAutomation.OzwDaemon?action=sourceblock&num=2
178
- [13]: HomeAutomation.OzwDaemon?action=sourceblock&num=3
... ...
\ No newline at end of file
HomeAutomation/RoomAssistant.md
... ...
@@ -6,24 +6,21 @@
6 6
7 7
Requires Node 12.
8 8
9
-
10
-
9
+```
11 10
curl -sL https://deb.nodesource.com/setup_12.x | bash -
12 11
apt-get install -y nodejs
13 12
14
-[[$[Get Code]]][1]
13
+```
15 14
16 15
17 16
18 17
# Service User
19 18
19
+```
20 20
sudo useradd -r -d /var/room-assistant room-assistant
21 21
sudo mkdir /var/room-assistant
22 22
sudo chown room-assistant:room-assistant /var/room-assistant
23
-
24
-[[$[Get Code]]][2]
25
-
26
-
23
+```
27 24
28 25
# Configuration
29 26
... ...
@@ -63,12 +60,8 @@ sudo chown room-assistant:room-assistant /var/room-assistant
63 60
64 61
# BLE configuration
65 62
63
+```
66 64
sudo setcap cap\_net\_raw+eip $(eval readlink -f `which node`)
67 65
sudo setcap cap\_net\_raw+eip $(eval readlink -f `which hcitool`)
68 66
sudo setcap cap\_net\_admin+eip $(eval readlink -f `which hciconfig`)
69
-
70
-[[$[Get Code]]][3]
71
-
72
- [1]: HomeAutomation.RoomAssistant?action=sourceblock&num=1
73
- [2]: HomeAutomation.RoomAssistant?action=sourceblock&num=2
74
- [3]: HomeAutomation.RoomAssistant?action=sourceblock&num=3
... ...
\ No newline at end of file
0
+```
MediaCentre/BackEnd.md
... ...
@@ -250,11 +250,9 @@ Permissions fixes for [NFSv3][8][?][8]
250 250
251 251
252 252
253
-
253
+```
254 254
mount -t nfs4 -o ro media: /mnt/media
255
-
256
-[[$[Get Code]]][9]
257
-
255
+```
258 256
259 257
260 258
* * *
... ...
@@ -350,7 +348,6 @@ mount -t nfs4 -o ro media: /mnt/media
350 348
[6]: http://www.nexenta.org/
351 349
[7]: MediaCentre.ACLs?action=edit
352 350
[8]: MediaCentre.NFSv3?action=edit
353
- [9]: MediaCentre.BackEnd?action=sourceblock&num=1
354 351
[10]: http://ivtvdriver.org/index.php/Supported_hardware
355 352
[11]: MediaCentre.CX23415?action=edit
356 353
[12]: MediaCentre.CX23416?action=edit
... ...
@@ -373,4 +370,4 @@ mount -t nfs4 -o ro media: /mnt/media
373 370
[29]: MediaCentre.DivX?action=edit
374 371
[30]: MediaCentre.MythTV?action=edit
375 372
[31]: MediaCentre.UniChromePro?action=edit
376
- [32]: MediaCentre.XvMC?action=edit
... ...
\ No newline at end of file
0
+ [32]: MediaCentre.XvMC?action=edit
MediaCentre/Games.md
... ...
@@ -42,6 +42,7 @@ This combination mounts `//media/mediasys` as `/mnt/mediasys`.
42 42
43 43
44 44
45
+```xml
45 46
<?xml version="1.0"?>
46 47
<systemList>
47 48
<system>
... ...
@@ -64,11 +65,10 @@ This combination mounts `//media/mediasys` as `/mnt/mediasys`.
64 65
</system>
65 66
...
66 67
67
-[[$[Get Code]]][6]
68
+```
68 69
69 70
[1]: MediaCentre.RetroPie?action=edit
70 71
[2]: MediaCentre.ROMs?action=edit
71 72
[3]: MediaCentre.AutoFS?action=edit
72
- [4]: MediaCentre.Games?action=sourceblock&num=1
73 73
[5]: MediaCentre.EmulationStation?action=edit
74
- [6]: MediaCentre.Games?action=sourceblock&num=2
... ...
\ No newline at end of file
0
+ [6]: MediaCentre.Games?action=sourceblock&num=2
MediaCentre/KindleFire7.md
... ...
@@ -73,6 +73,7 @@ Wireless charging
73 73
74 74
## Build updated version of ADB
75 75
76
+```bash
76 77
#Needed tools
77 78
sudo apt-get install zlib1g-dev libssl-dev git make gcc
78 79
... ...
@@ -144,7 +145,7 @@ cp ./adb /home/gnome/bin/adb-1.0.32
144 145
145 146
sudo adb-1.0.32 sideload fire-OS-5.1.2-update-kindle-global-37.5.4.2\_user\_542168620.bin
146 147
147
-[[$[Get Code]]][8]
148
+```
148 149
149 150
150 151
... ...
@@ -213,8 +214,7 @@ Or if sshdroid in installed just use `vi`:
213 214
[5]: MediaCentre.SuperTool?action=edit
214 215
[6]: MediaCentre.KingRoot?action=edit
215 216
[7]: https://aaporantalainen.wordpress.com/2015/03/04/newer-adb-for-ubuntu-with-sideloading/
216
- [8]: MediaCentre.KindleFire7?action=sourceblock&num=1
217 217
[9]: MediaCentre.SSHdroid?action=edit
218 218
[10]: MediaCentre.AFWall?action=edit
219 219
[11]: MediaCentre.YouTube?action=edit
220
- [12]: MediaCentre.FireOS?action=edit
... ...
\ No newline at end of file
0
+ [12]: MediaCentre.FireOS?action=edit
MediaCentre/Kodi.md
... ...
@@ -46,13 +46,12 @@ This is a **non-userdata setting** so must be restored after upgrades.
46 46
47 47
## Disable Logging
48 48
49
+```xml
49 50
<advancedsettings>
50 51
<loglevel>-1</loglevel>
51 52
</advancedsettings>
52 53
53
-[[$[Get Code]]][8]
54
-
55
-
54
+```
56 55
57 56
## Buffer Media
58 57
... ...
@@ -61,7 +60,7 @@ Kodi does not buffer local media (including `smb://` and `nfs://`) by default.
61 60
Set [advancedsettings/network/buffermode][9] (v17 Krypton: [advancedsettings/cache/buffermode][10]) to 1 (cache all):
62 61
63 62
64
-
63
+```xml
65 64
<advancedsettings>
66 65
<network>
67 66
<buffermode>1</buffermode>
... ...
@@ -69,13 +68,12 @@ Set [advancedsettings/network/buffermode][9] (v17 Krypton: [advancedsettings/cac
69 68
<!-- <cachemembuffersize>52428800</cachemembuffersize> -->
70 69
</network>
71 70
</advancedsettings>
72
-
73
-[[$[Get Code]]][11]
74
-
71
+```
75 72
76 73
77 74
## Shared Database
78 75
76
+```xml
79 77
<advancedsettings>
80 78
<musicdatabase>
81 79
<type>mysql</type>
... ...
@@ -96,8 +94,7 @@ Set [advancedsettings/network/buffermode][9] (v17 Krypton: [advancedsettings/cac
96 94
<importresumepoint>true</importresumepoint>
97 95
</videolibrary>
98 96
</advancedsettings>
99
-
100
-[[$[Get Code]]][12]
97
+```
101 98
102 99
103 100
... ...
@@ -126,6 +123,7 @@ Give user permission to use and create new Kodi databases.
126 123
127 124
Enables Airplay, [UPnP][14], web interface (no username or password)
128 125
126
+```xml
129 127
<settings>
130 128
<services>
131 129
<airplay>true</airplay>
... ...
@@ -153,8 +151,7 @@ Enables Airplay, [UPnP][14], web interface (no username or password)
153 151
</services>
154 152
</settings>
155 153
156
-[[$[Get Code]]][15]
157
-
154
+```
158 155
159 156
160 157
`${LOCATION}`
... ...
@@ -214,4 +211,4 @@ Add-on
214 211
[12]: MediaCentre.Kodi?action=sourceblock&num=3
215 212
[13]: MediaCentre.MySQL?action=edit
216 213
[14]: MediaCentre.UPnP
217
- [15]: MediaCentre.Kodi?action=sourceblock&num=4
... ...
\ No newline at end of file
0
+ [15]: MediaCentre.Kodi?action=sourceblock&num=4