forked from andonome/lk
more cleanup
This commit is contained in:
@@ -10,7 +10,7 @@ tags: [ "Documentation", "data" ]
|
||||
|
||||
> git config --global user.name "Malin Freeborn"
|
||||
|
||||
## New Git
|
||||
# New Git
|
||||
|
||||
Start a git:
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "groff"
|
||||
tags: [ "Documentation", "data" ]
|
||||
tags: [ "Documentation", "Data" ]
|
||||
---
|
||||
# Basic Documents
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "khard"
|
||||
tags: [ "Documentation", "data" ]
|
||||
tags: [ "Documentation", "Data" ]
|
||||
---
|
||||
Get the basic config:
|
||||
|
||||
|
@@ -1,33 +0,0 @@
|
||||
---
|
||||
title: "mdadm"
|
||||
tags: [ "Documentation", "RAID" ]
|
||||
---
|
||||
# RAID5
|
||||
|
||||
You will need 4 disks and the `mdadm` package.
|
||||
The total size will be equal to the disks x 3, because one will be used for redundancy.
|
||||
|
||||
> sudo mdadm --create --verbose /dev/*md127* --level=5 --raid-devices=*4* */dev/sdb /dev/sdc /dev/sdd /dev/sde*
|
||||
|
||||
Note the variable parts:
|
||||
|
||||
- The name of the device could be `/dev/md12` or whatever
|
||||
- The number of devices could be larger, but must be at least 4 for raid 5
|
||||
- We end by listing all devices in the new `md` device.
|
||||
|
||||
Now look at how the raid status:
|
||||
|
||||
> cat /proc/mdstat
|
||||
|
||||
This will increase until the entire thing is fine.
|
||||
|
||||
Check the health of your `mdadm` array:
|
||||
|
||||
> sudo mdadm --detail /dev/md127
|
||||
|
||||
You should see `State : clean`. If you see it is `degraded`, then a disk has broken.
|
||||
|
||||
## Replacing a Disk
|
||||
|
||||
> sudo mdadm --add /dev/md127 /dev/sdb1
|
||||
|
@@ -1,57 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
export TASKDDATA=/var/lib/taskd
|
||||
|
||||
echo Change CN to hostname
|
||||
sleep 2
|
||||
|
||||
sudo vim /usr/share/doc/taskd/pki/vars
|
||||
|
||||
cd /usr/share/doc/taskd/pki/
|
||||
|
||||
sudo ./generate
|
||||
|
||||
mkdir -p $TASKDDATA
|
||||
|
||||
cp *.pem $TASKDDATA
|
||||
|
||||
chown -R root /var/lib/taskd
|
||||
|
||||
sudo cp *pem $TASKDDATA
|
||||
|
||||
chown -R taskd:taskd $TASKDDATA
|
||||
|
||||
taskd config "$user".cert=/var/lib/taskd/client.cert.pem
|
||||
taskd config "$user".key=/var/lib/taskd/client.key.pem
|
||||
taskd config "$(hostname)".cert=/var/lib/taskd/server.cert.pem
|
||||
taskd config "$(hostname)".key=/var/lib/taskd/server.key.pem
|
||||
taskd config "$(hostname)".crl=/var/lib/taskd/server.crl.pem
|
||||
taskd config ca.cert=/var/lib/taskd/ca.cert.pem
|
||||
|
||||
taskd config --force server $(hostname):53589
|
||||
|
||||
systemctl start taskd
|
||||
|
||||
|
||||
echo name a group
|
||||
read group
|
||||
|
||||
echo name user
|
||||
|
||||
read user
|
||||
|
||||
taskd add org $group
|
||||
|
||||
taskd add user $group $user
|
||||
|
||||
./generate.client $user
|
||||
|
||||
echo "
|
||||
taskd.server=alfred:port
|
||||
taskd.credentials=$group/$user/key
|
||||
taskd.certificate=~/.task/'$user'.cert.pem
|
||||
taskd.key=~/.task/'$user'.key.pem
|
||||
taskd.ca=~/.task/ca.cert.pem" >> /var/lib/taskd/config
|
||||
|
||||
tar cf $user.tar "$user"* ca.cert.pem
|
||||
|
@@ -1,7 +1,58 @@
|
||||
---
|
||||
title: "task"
|
||||
tags: [ "Documentation", "data" ]
|
||||
tags: [ "Documentation", "Organization" ]
|
||||
---
|
||||
|
||||
Set up the configuration file:
|
||||
|
||||
> task
|
||||
|
||||
Add a task:
|
||||
|
||||
> task add update linux
|
||||
|
||||
See which task is next:
|
||||
|
||||
> task next
|
||||
|
||||
Note the id number.
|
||||
|
||||
Mark a task as started:
|
||||
|
||||
> task start 1
|
||||
|
||||
Once finished:
|
||||
|
||||
> task 1 done
|
||||
|
||||
# Projects
|
||||
|
||||
Add a project:
|
||||
|
||||
> task add project:house buy potted plant
|
||||
> task add proj:house.repair buy screwdriver
|
||||
> task add proj:house.repair buy shelf brackets
|
||||
> task add pro:house.paint buy white paint
|
||||
> task add pro:house.paint buy red paint
|
||||
> task add pro:house.paint buy black paint
|
||||
> task add pro:house.paint buy brushes
|
||||
|
||||
## Summary
|
||||
|
||||
> task pro:house sum
|
||||
|
||||
> task burndown.daily pro:house
|
||||
|
||||
The summaries will show how fast a project is being completed, and when you can expect it to finish at the present rate.
|
||||
|
||||
# Tags
|
||||
|
||||
> task add +buy toothbrush
|
||||
|
||||
You can then see only tasks which involve buying something with:
|
||||
|
||||
> task +buy
|
||||
|
||||
# Contexts
|
||||
|
||||
Set three contexts by their tags:
|
||||
@@ -26,16 +77,6 @@ View list of tasks completed in the last week:
|
||||
|
||||
> task end.after:today-1wk completed
|
||||
|
||||
# Timewarrior
|
||||
|
||||
> timew start ed 'learn timewarrior'
|
||||
|
||||
> timew stop
|
||||
|
||||
> timew summary
|
||||
|
||||
> timew tags
|
||||
|
||||
# User Defined Attributes
|
||||
|
||||
Make a UDA 'size'.
|
||||
@@ -48,3 +89,11 @@ Make a UDA 'size'.
|
||||
|
||||
> uda.size.default=medium
|
||||
|
||||
# Tricks
|
||||
|
||||
This command shows tasks I'm most interested in:
|
||||
|
||||
> task next +ACTIVE or +OVERDUE or due:today or scheduled:today or pri:H
|
||||
|
||||
The command is long, so `alias` is your friend.
|
||||
|
||||
|
@@ -1,183 +0,0 @@
|
||||
---
|
||||
title: "taskd"
|
||||
tags: [ "Documentation", "data" ]
|
||||
---
|
||||
(instructions currently not working)
|
||||
|
||||
Switch to root to make things easier.
|
||||
|
||||
> yay -S
|
||||
|
||||
> export TASKDDATA=/var/lib/taskd
|
||||
|
||||
Edit `/usr/share/doc/taskd/pki/vars` so that ``CN'' = the hostname (IP is fine).
|
||||
|
||||
> cd /usr/share/doc/taskd/pki
|
||||
|
||||
Execute the `generate` file to generate a selfsigned certificate for the server. These will be \*.pem-files. Copy all \*.pem-files to /var/lib/taskd.
|
||||
|
||||
Make sure a copy of ca.cert.pem remains to generate user-certificates later.
|
||||
|
||||
# Taskd Configurations
|
||||
|
||||
> taskd config --force client.cert $TASKDDATA/client.cert.pem
|
||||
|
||||
> taskd config --force client.key $TASKDDATA/client.key.pem
|
||||
|
||||
> taskd config --force server.cert $TASKDDATA/server.cert.pem
|
||||
|
||||
> taskd config --force server.key $TASKDDATA/server.key.pem
|
||||
|
||||
> taskd config --force server.crl $TASKDDATA/server.crl.pem
|
||||
|
||||
> taskd config --force ca.cert $TASKDDATA/ca.cert.pem
|
||||
|
||||
# Change Taskd Log Location
|
||||
The default is /tmp/log, which obviously you don't want.
|
||||
|
||||
> touch /var/log/taskd.log
|
||||
|
||||
> chown taskd:taskd /var/log/taskd.log
|
||||
|
||||
> taskd config --force log /var/log/taskd.log
|
||||
|
||||
Finally, set up the servername - the same one as in the certificates. Mine is ``testarch''.
|
||||
|
||||
> taskd config --force server testarch:9001
|
||||
|
||||
# Adding users
|
||||
Let's add the group ``home'', then the user ``ghost'', will go in that group.
|
||||
|
||||
> taskd add org home
|
||||
|
||||
> taskd add user home ghost
|
||||
|
||||
`3f9e6154-25cb-4e45-88bb-45e98feef904`
|
||||
|
||||
> taskd add user home alfred
|
||||
|
||||
`4fbb319c-c493-437a-ab7a-028f5b75e522`
|
||||
|
||||
The user then gets a key.
|
||||
|
||||
Finally, make sure that taskd can read its own data>
|
||||
|
||||
> chown -R taskd:taskd /var/lib/taskd/orgs
|
||||
|
||||
... or perhaps the entire directory of /var/lib/taskd/.
|
||||
|
||||
Then it's back to /usr/share/doc/taskd/pki
|
||||
|
||||
Generate some userfiles:
|
||||
|
||||
> ./generate.client ghost
|
||||
|
||||
> ./generate.client alfred
|
||||
|
||||
The bob and ghost \*pem files have to be added to the given users' home directories.
|
||||
|
||||
# Setting up Users
|
||||
|
||||
> sudo apt-get install taskwarrior taskd
|
||||
|
||||
> task
|
||||
|
||||
Then move the \*pem files into the .task directory of the user.
|
||||
|
||||
Don't forget to add the ca.key.pem from `/usr/share/doc/taskd/pki`!
|
||||
|
||||
# Attempt 2
|
||||
|
||||
Well, none of that worked.
|
||||
|
||||
New info from [taskwarrior](https://gitpitch.com/GothenburgBitFactory/taskserver-setup#/1/4)
|
||||
|
||||
Default port = 53589
|
||||
|
||||
starting with
|
||||
|
||||
> taskd init
|
||||
|
||||
> taskd config server localhost:53589
|
||||
|
||||
View supported settings with `taskdrc`.
|
||||
|
||||
!!! Start with taskdctl start
|
||||
|
||||
Do a non-daemon version with
|
||||
|
||||
> taskd server --data $TASKDDATA --daemon
|
||||
|
||||
# Systemd Unit file
|
||||
|
||||
This needs to be edited for "$TASKDDATA", "$TASKDUSER", and "$TASKDGROUP".
|
||||
|
||||
|
||||
```
|
||||
|
||||
Unit]
|
||||
Description=Secure server providing multi-user, multi-client access to Taskwarrior data
|
||||
Requires=network.target
|
||||
After=network.target
|
||||
Documentation=http://taskwarrior.org/docs/#taskd
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/taskd server --data $TASKDDATA
|
||||
Type=simple
|
||||
User=$TASKDUSER
|
||||
Group=$TASKDGROUP
|
||||
WorkingDirectory=$TASKDDATA
|
||||
PrivateTmp=true
|
||||
InaccessibleDirectories=/home /root /boot /opt /mnt /media
|
||||
ReadOnlyDirectories=/etc /usr
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
|
||||
```
|
||||
|
||||
Enable all this by copying the file to `/etc/systemd/system`, reload daemon, then start it.
|
||||
|
||||
Key for ghost:
|
||||
29bd8a06-2cc0-4163-905d-6216257a3031
|
||||
|
||||
e29bffe0-72d8-45f2-b1f9-f29397cfab16
|
||||
|
||||
# Different:
|
||||
|
||||
$ task config taskd.certificate -- ~/.task/first_last.cert.pem
|
||||
$ task config taskd.key -- ~/.task/first_last.key.pem
|
||||
$ task config taskd.ca -- ~/.task/ca.cert.pem
|
||||
|
||||
# Trust
|
||||
|
||||
For troubleshooting we can set:
|
||||
|
||||
> taskd.trust=ignore [hostname]
|
||||
|
||||
> taskd.trust=allow all
|
||||
|
||||
> taskd.trust=strict
|
||||
|
||||
# User Defines Attributes - UDA
|
||||
|
||||
Each UDA has two to four attributes: type (numeric or string) and label are necessary:
|
||||
|
||||
> task config uda.THING.type {numeric,string}
|
||||
|
||||
> task config uda.THING.label Thg
|
||||
|
||||
Constrain these attributes to a comma-delineated set with:
|
||||
|
||||
> task config uda.THING.values brown,orange,green
|
||||
|
||||
You can also show how important the Attribute makes something:
|
||||
|
||||
> urgency.uda.THING.coefficient=2.8
|
||||
|
||||
# Aliases
|
||||
|
||||
Alias `delete' to `rm' with:
|
||||
|
||||
task config alias.rm delete
|
||||
|
@@ -1,42 +0,0 @@
|
||||
#!/bin/bash
|
||||
# script currently not working
|
||||
|
||||
export TASKDDATA=/var/lib/taskd
|
||||
|
||||
sudo mkdir -p $TASKDDATA
|
||||
sudo chown taskd:$(whoami) $TASKDDATA
|
||||
sudo chmod 775 $TASKDDATA
|
||||
|
||||
cp -r /usr/share/doc/taskd/pki/ $TASKDDATA
|
||||
|
||||
cd $TASKDDATA/pki
|
||||
|
||||
sed -i s/localhost/$(hostname -f)/ vars
|
||||
|
||||
./generate
|
||||
|
||||
cp client.cert.pem $TASKDDATA
|
||||
cp client.key.pem $TASKDDATA
|
||||
cp server.cert.pem $TASKDDATA
|
||||
cp server.key.pem $TASKDDATA
|
||||
cp server.crl.pem $TASKDDATA
|
||||
cp ca.cert.pem $TASKDDATA
|
||||
|
||||
taskd config --force client.cert $TASKDDATA/client.cert.pem
|
||||
taskd config --force client.key $TASKDDATA/client.key.pem
|
||||
taskd config --force server.cert $TASKDDATA/server.cert.pem
|
||||
taskd config --force server.key $TASKDDATA/server.key.pem
|
||||
taskd config --force server.crl $TASKDDATA/server.crl.pem
|
||||
taskd config --force ca.cert $TASKDDATA/ca.cert.pem
|
||||
|
||||
cd $TASKDDATA/..
|
||||
taskd config --force log $PWD/taskd.log
|
||||
taskd config --force pid.file $PWD/taskd.pid
|
||||
taskd config --force server $(hostname -f):53589
|
||||
|
||||
taskd add org public
|
||||
|
||||
# 1515de89-cc81-4af6-a6a4-41c1430620b0
|
||||
|
||||
journalctl -u taskd
|
||||
|
@@ -1,11 +1,7 @@
|
||||
---
|
||||
title: "timew"
|
||||
tags: [ "Documentation", "data" ]
|
||||
tags: [ "Documentation", "Data" ]
|
||||
---
|
||||
# Setup
|
||||
|
||||
Below commands mostly deal with timew alone. With taskwarrior installed as well, `locate on-modify-time`, then add it to ~/.task/hooks and make it executable.
|
||||
|
||||
# Summaries
|
||||
|
||||
Try:
|
||||
@@ -153,3 +149,8 @@ with:
|
||||
|
||||
> python timew-dbcorrections.py
|
||||
|
||||
# Setup
|
||||
|
||||
With taskwarrior installed as well, `locate on-modify-time`, then add it to ~/.task/hooks and make it executable.
|
||||
This will track the time of any tasks used with [taskwarrior](task.md).
|
||||
|
||||
|
Reference in New Issue
Block a user