mirror of
https://github.com/AlexBocken/mykb.git
synced 2024-11-22 11:19:37 +01:00
Compare commits
4 Commits
e17201e8e9
...
a4e9e4ae1b
Author | SHA1 | Date | |
---|---|---|---|
a4e9e4ae1b | |||
022dc742bb | |||
6f9e095d7f | |||
d9e33fc1de |
25
docs/LaptopSetup.md
Normal file
25
docs/LaptopSetup.md
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
# LaptopSetup
|
||||||
|
|
||||||
|
General Tips and tricks for setting up Laptops in particular. Assuming Arch Linux/systemd.
|
||||||
|
|
||||||
|
## Power/Hibernation
|
||||||
|
|
||||||
|
We want to not edit pacman-provided files but provide drop-ins.
|
||||||
|
Hence create the folder `/etc/systemd/logind.conf.d` if not already present.
|
||||||
|
|
||||||
|
All the following settings will be written into `/etc/systemd/logind.conf.d/logind.conf`
|
||||||
|
|
||||||
|
### Let DWM handle PowerOff
|
||||||
|
|
||||||
|
```conf
|
||||||
|
[Login]
|
||||||
|
HandlePowerKey=ignore
|
||||||
|
```
|
||||||
|
|
||||||
|
### Hibernate on Lid close
|
||||||
|
|
||||||
|
```conf
|
||||||
|
[Login]
|
||||||
|
HandleLidSwitch=hibernate
|
||||||
|
HandleLidSwitchExternalPower=hibernate
|
||||||
|
```
|
@ -15,8 +15,8 @@ Note: for BIOS systems a dummy 1M parition would be also required. For UEFI this
|
|||||||
|
|
||||||
## Create LVM
|
## Create LVM
|
||||||
```sh
|
```sh
|
||||||
cryptsetup luksFormat /dev/sda3
|
cryptsetup luksFormat /dev/sda2
|
||||||
cryptsetup open /dev/sda3 cryptlvm
|
cryptsetup open /dev/sda2 cryptlvm
|
||||||
pvcreate /dev/mapper/cryptlvm
|
pvcreate /dev/mapper/cryptlvm
|
||||||
vgcreate vg /dev/mapper/crypylvm
|
vgcreate vg /dev/mapper/crypylvm
|
||||||
```
|
```
|
||||||
@ -102,7 +102,7 @@ and add to `GRUB_CMDLINE_LINUX`: (can have multiple, space-separated arguments s
|
|||||||
```/etc/default/grub
|
```/etc/default/grub
|
||||||
GRUB_CMDLINE_LINUX="cryptdevice=UUID=device-UUID:cryptlvm"
|
GRUB_CMDLINE_LINUX="cryptdevice=UUID=device-UUID:cryptlvm"
|
||||||
```
|
```
|
||||||
and replace "device-UUID" with the uuid we got for `/dev/sda3` from the previous `ls` command. Of course remove all the trailing `ls` output.
|
and replace "device-UUID" with the uuid we got for `/dev/sda2` from the previous `ls` command. Of course remove all the trailing `ls` output.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB --recheck
|
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB --recheck
|
||||||
@ -120,7 +120,7 @@ set prefix=($root)/boot/grub
|
|||||||
insmod normal
|
insmod normal
|
||||||
normal
|
normal
|
||||||
```
|
```
|
||||||
and replace device-UUID with the same device-UUID as before, (again, a `ls -l /dev/disk/by-uuid >> /boot/grub/grub-pre.cfg` can help here to get the UUID for `/dev/sda3`)
|
and replace device-UUID with the same device-UUID as before, (again, a `ls -l /dev/disk/by-uuid >> /boot/grub/grub-pre.cfg` can help here to get the UUID for `/dev/sda2`)
|
||||||
|
|
||||||
Now we can overwrite our previously generated grubx64.efi with a luks2 compatible one:
|
Now we can overwrite our previously generated grubx64.efi with a luks2 compatible one:
|
||||||
```sh
|
```sh
|
||||||
@ -135,7 +135,7 @@ Create a keyfile:
|
|||||||
```sh
|
```sh
|
||||||
dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock
|
dd bs=512 count=4 if=/dev/random of=/crypto_keyfile.bin iflag=fullblock
|
||||||
chmod 600 /crypto_keyfile.bin
|
chmod 600 /crypto_keyfile.bin
|
||||||
cryptsetup luksAddKey /dev/sda3 /crypto_keyfile.bin
|
cryptsetup luksAddKey /dev/sda2 /crypto_keyfile.bin
|
||||||
```
|
```
|
||||||
Add this to the initramfs:
|
Add this to the initramfs:
|
||||||
```/etc/mkinitcpio.conf
|
```/etc/mkinitcpio.conf
|
||||||
@ -167,8 +167,8 @@ cryptsetup luksFormat /dev/sdX
|
|||||||
cryptsetup open /dev/sdX YourDiskNameHere
|
cryptsetup open /dev/sdX YourDiskNameHere
|
||||||
mkfs.ext4 /dev/mapper/YourDiskNameHere
|
mkfs.ext4 /dev/mapper/YourDiskNameHere
|
||||||
```
|
```
|
||||||
If you do not wish to have to enter the additional password on boot-up you will have to create a keyfile like we did for our /dev/sda3 above.
|
If you do not wish to have to enter the additional password on boot-up you will have to create a keyfile like we did for our /dev/sda2 above.
|
||||||
Of course this will lessen security as any additional hard-drives can also be decrypted if `/dev/sda3` has been decrypted or cracked.
|
Of course this will lessen security as any additional hard-drives can also be decrypted if `/dev/sda2` has been decrypted or cracked.
|
||||||
|
|
||||||
Systemd can autodetec keys in `/etc/cryptsetup-keys.d` if they have the pattern `YourDiskNameHere.key`. Create this directory if not already present:
|
Systemd can autodetec keys in `/etc/cryptsetup-keys.d` if they have the pattern `YourDiskNameHere.key`. Create this directory if not already present:
|
||||||
```sh
|
```sh
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
# Neomutt
|
# Neomutt
|
||||||
|
|
||||||
|
|
||||||
## Markdown to HTML rendering
|
## Markdown to HTML rendering
|
||||||
To write more normie-friendly emails, non-plain-text emails are probably better.
|
To write more normie-friendly emails, non-plain-text emails are probably better.
|
||||||
For this, a conversion from Markdown to HTML with Mathjax support seems best.
|
For this, a conversion from Markdown to HTML with Mathjax support seems best.
|
||||||
@ -12,7 +13,7 @@ Ensure `pandoc` is installed. (`which pandoc || sudo pacman -S pandoc`)
|
|||||||
|
|
||||||
Add to your muttrc (either in `~/.mutt/muttrc` or `~/.config/mutt/muttrc`. From now on assuming `~/.config/mutt` as config folder)
|
Add to your muttrc (either in `~/.mutt/muttrc` or `~/.config/mutt/muttrc`. From now on assuming `~/.config/mutt` as config folder)
|
||||||
|
|
||||||
```
|
```muttrc
|
||||||
macro compose m \
|
macro compose m \
|
||||||
"<enter-command>set pipe_decode<enter>\
|
"<enter-command>set pipe_decode<enter>\
|
||||||
<pipe-message>pandoc -f gfm -t plain -o /tmp/msg.txt<enter>\
|
<pipe-message>pandoc -f gfm -t plain -o /tmp/msg.txt<enter>\
|
||||||
@ -77,7 +78,7 @@ Create a second macro for which you use a different template, that excludes the
|
|||||||
This way you can create smaller emails with pure markdown syntax and when necessary can send mathematical formulas, resulting in larger mails.
|
This way you can create smaller emails with pure markdown syntax and when necessary can send mathematical formulas, resulting in larger mails.
|
||||||
|
|
||||||
For this add the following to the muttrc:
|
For this add the following to the muttrc:
|
||||||
```
|
```muttrc
|
||||||
macro compose l \
|
macro compose l \
|
||||||
"<enter-command>set pipe_decode<enter>\
|
"<enter-command>set pipe_decode<enter>\
|
||||||
<pipe-message>pandoc -f gfm -t plain -o /tmp/msg.txt<enter>\
|
<pipe-message>pandoc -f gfm -t plain -o /tmp/msg.txt<enter>\
|
||||||
@ -117,8 +118,19 @@ $endfor$
|
|||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
```
|
```
|
||||||
|
## Khard Adress Book integration
|
||||||
|
Sadly, khard does not have a great TUI as abook, but it benefits from being able to sync with CardDav servers like Nextcloud.
|
||||||
|
|
||||||
### Usage with abook
|
For seamless integration such as adding emails and autocompleting from the address book, add the following to your muttrc (either in `~/.mutt/muttrc` or `~/.config/mutt/muttrc`. From now on assuming `~/.config/mutt` as config folder)
|
||||||
|
```muttrc
|
||||||
|
set query_command = "echo %s | xargs khard email --parsable --"
|
||||||
|
macro index,pager a \
|
||||||
|
"<pipe-message>khard add-email<return>" \
|
||||||
|
"add the sender email address to khard"
|
||||||
|
```
|
||||||
|
For syncing with CardDav servers like Nextcloud look into [NextCloud](./nextcloud.md).
|
||||||
|
|
||||||
|
## abook Adress Book integration
|
||||||
|
|
||||||
Add the following to the muttrc. The first line set the default query to use abook, while the second line allows us to quickly add the sender of a mail that we currently read to the adress book using `A`.
|
Add the following to the muttrc. The first line set the default query to use abook, while the second line allows us to quickly add the sender of a mail that we currently read to the adress book using `A`.
|
||||||
|
|
||||||
|
31
docs/nextcloud.md
Normal file
31
docs/nextcloud.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#Nextcloud
|
||||||
|
## Installation
|
||||||
|
We're assuming an Arch Linux installation, but the steps should be similar for other distributions.
|
||||||
|
There are two possible ways to serve Nextclouds PHP code: uWSGI and PHP-FPM.
|
||||||
|
We'll be using PHP-FPM as this is the recommended way and nginx is easier to setup with it, especially if you wish to enable additional plugins such as LDAP.
|
||||||
|
|
||||||
|
TODO
|
||||||
|
|
||||||
|
## Setup a drop-off folder in Nextcloud
|
||||||
|
|
||||||
|
1. Create a folder in Nextcloud, e.g. `Drop-off`.
|
||||||
|
2. Click on the share icon and under share link select "File-drop". This will create a link that you can share with others.
|
||||||
|
3. Optional: If you want to password protect the link, click on "Advanced settings" under the Sharing tab for the folder detailsand use a password of your choice.
|
||||||
|
|
||||||
|
### Human-readable link with redirect
|
||||||
|
If you want a nice human-readable link you can use your own nginx for this.
|
||||||
|
Add to your existant server block with port 443 in `/etc/nginx/sites-available/nextcloud` or your domain of choice with the following content:
|
||||||
|
|
||||||
|
```nginx
|
||||||
|
location /dropoff {
|
||||||
|
return 301 <your nextcloud share link>;
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Sync contacts with khard
|
||||||
|
TODO
|
||||||
|
|
||||||
|
See [neomutt.md](./neomutt.md) for more details on how to use khard with neomutt for autocompletion.
|
||||||
|
|
||||||
|
## Sync Calendar with Calcurse
|
||||||
|
TODO
|
2
index.md
2
index.md
@ -3,6 +3,7 @@ Install instructions, configuration methods and much more for the setup of an us
|
|||||||
Happy to accept pull requests for new topics!
|
Happy to accept pull requests for new topics!
|
||||||
|
|
||||||
# Desktop Programs
|
# Desktop Programs
|
||||||
|
- [Laptop Setup](docs/LaptopSetup.md) General tips and tricks around the quirks of Arch on a Laptop.
|
||||||
- [qutebrowser](docs/qutebrowser.md)
|
- [qutebrowser](docs/qutebrowser.md)
|
||||||
highly customizable keyboard focused webbrowser using vim bindings
|
highly customizable keyboard focused webbrowser using vim bindings
|
||||||
- [vimwiki](docs/vimwiki.md)
|
- [vimwiki](docs/vimwiki.md)
|
||||||
@ -27,6 +28,7 @@ Happy to accept pull requests for new topics!
|
|||||||
- [anki sync server](docs/anki_sync_server.md) personal sync server for anki, a spaced repetition learning program
|
- [anki sync server](docs/anki_sync_server.md) personal sync server for anki, a spaced repetition learning program
|
||||||
- [docker](docs/docker.md) General tips and tricks around the container manager
|
- [docker](docs/docker.md) General tips and tricks around the container manager
|
||||||
- [Searx](docs/Searx.md) A meta searchengine which respects privacy. Arch setup guide.
|
- [Searx](docs/Searx.md) A meta searchengine which respects privacy. Arch setup guide.
|
||||||
|
- [Nextcloud](docs/Nextcloud.md) A self-hosted cloud solution. Installation (on Arch), configuration, and usage tips.
|
||||||
|
|
||||||
=======
|
=======
|
||||||
- [calcurse sync](docs/calDAV.md) Sync calcurse with you phone etc.
|
- [calcurse sync](docs/calDAV.md) Sync calcurse with you phone etc.
|
||||||
|
Loading…
Reference in New Issue
Block a user