Compare commits

..

No commits in common. "2f328f3b7078aa53002532aec949a01b690011d5" and "219ea021e1ce47f0c68e7889198d7c2715948bc5" have entirely different histories.

12 changed files with 51 additions and 98 deletions

View File

@ -8,21 +8,22 @@ tags: [ "tar", "backups", ".tgz", "tar.gz" ]
Combine many files and directories into a single t-archive file. Combine many files and directories into a single t-archive file.
```sh ```bash
tar cf "$ARCHIVE".tar $DIR tar cf "$ARCHIVE".tar $DIR
``` ```
You can remember this with the mnemonic '*C*reate *F*ile'. You can remember this with the mnemonic '*C*reate *F*ile'.
Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`). Unfortunately, this stores the full file path, so making a tar archive of `/etc/nginx/` will store `etc/nginx` (without the leading `/`.
It's often better to tell tar which path to start from using the `-C` flag. It's often better to tell tar which path to start from using the `-C` flag.
```sh ```bash
tar cf "$ARCHIVE".tar -C /etc/ nginx tar cf "$ARCHIVE".tar -C /etc/ nginx
``` ```
Check the contents of your archive with: Check the contents of your archive with:
```sh ```bash
tar tf "$ARCHIVE".tar tar tf "$ARCHIVE".tar
``` ```
@ -30,7 +31,7 @@ If you want to store 'everything in a directory', then using `*` will not work,
Instead, you can store the target in a variable: Instead, you can store the target in a variable:
```sh ```bash
files=$(ls /etc/nginx) files=$(ls /etc/nginx)
tar cf "$ARCHIVE".tar -C /etc/nginx/ $file tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
``` ```
@ -39,9 +40,7 @@ tar cf "$ARCHIVE".tar -C /etc/nginx/ $file
Extract the tar archive with Extract the tar archive with
```sh > tar xf "$ARCHIVE".tar
tar xf "$ARCHIVE".tar
```
You can remember this with the mnemonic 'e*X*tract *F*ile'. You can remember this with the mnemonic 'e*X*tract *F*ile'.
@ -49,7 +48,7 @@ You can remember this with the mnemonic 'e*X*tract *F*ile'.
Create a zip-compressed archive with the `z` flag. Create a zip-compressed archive with the `z` flag.
```sh ```bash
tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file tar czf "$ARCHIVE".tgz -C /etc/nginx/ $file
``` ```
@ -61,16 +60,18 @@ You can use any file ending you want, but sane people like to use '.tgz' or '.ta
Make archive: Make archive:
```sh ```bash
7za a -tzip -p "$PASSWORD" -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2 PASSWORD=my_password
```
```bash
7za a -tzip -p$PASSWORD -mem=AES256 $ARCHIVE.zip $FILE_1 $FILE_2
``` ```
Note that people can still see every filename in your archive, and can change those files. Note that people can still see every filename in your archive, and can change those files.
They just can't read the contents. They just can't read the contents.
Unzip: Unzip:
```sh ```bash
7za x archive.zip 7za x archive.zip
``` ```

View File

@ -5,7 +5,7 @@ tags: [ "backups", "synch" ]
Install unison on both machines, and make sure both have the same version of unison, with the same version of the ocaml compiler (the smallest difference will cause problems). Install unison on both machines, and make sure both have the same version of unison, with the same version of the ocaml compiler (the smallest difference will cause problems).
```sh ```bash
unison -version unison -version
``` ```
@ -13,14 +13,14 @@ Create the `~/.unison` directory on both machines.
Make a job called `backup`: Make a job called `backup`:
```sh ```bash
JOB=backup JOB=backup
``` ```
Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username. Here is an example job, which synchronizes the `~/music` directory with a remote machine which has the same username.
```sh ```bash
echo " echo "
auto = true auto = true
root=$HOME root=$HOME
@ -42,7 +42,7 @@ The last command means it will ignore any file with a name ending in `.flac`.
The first command means this will run but also confirm which files will be deleted, and which will be transferred, us `batch = true` instead. The first command means this will run but also confirm which files will be deleted, and which will be transferred, us `batch = true` instead.
Or you can deleted that line in the `.prf` file and run it with a flag: Or you can deleted that line in the `.prf` file and run it with a flag:
```sh ```bash
unison -batch *backup*.prf unison -batch *backup*.prf
``` ```

View File

@ -3,24 +3,6 @@ title: "Base 16"
tags: [ "data" ] tags: [ "data" ]
--- ---
Base 16 numbers often use `0x` at the start, so '10' just means '10', but `0x10` means '10 in base 16' which means '16'. ```bash
For small numbers, use `printf`.
```sh
printf "%x" $NUMBER printf "%x" $NUMBER
``` ```
For any number, use `bc`.
```sh
fortune | md5sum | cut -d' ' -f1 | tr [:lower:] [:upper:] | bc
```
- Inputting base 16 uses `ibase=16`.
- Outputting base 10 uses `ibase=10`
```sh
echo 'ibase=16;' $(echo cbb478ac825f0dce7671254be035d0bc | tr [:lower:] [:upper:]) | bc
```

View File

@ -1,7 +1,7 @@
--- ---
title: "radicale and nginx" title: "radicale and nginx"
tags: [ "data", "calendar" ] tags: [ "data", "calendar" ]
requires: [ "nginx", "certbot" ] required: [ "nginx", "certbot" ]
--- ---
Check before you start: Check before you start:

View File

@ -1,7 +1,7 @@
--- ---
title: "sc-im" title: "sc-im"
tags: [ "TUI", "data", "spreadsheet", ".csv" ] tags: [ "TUI", "data", "spreadsheet", ".csv" ]
requires: [ "vim basics" ] required: [ "vim basics" ]
--- ---
- [Sample file](sc-im/sample.sc) - [Sample file](sc-im/sample.sc)

View File

@ -1,7 +1,7 @@
--- ---
title: "Soft Serve Maintenance" title: "Soft Serve Maintenance"
tags: [ "data", "git server", "maintenance" ] tags: [ "data", "git server", "maintenance" ]
requires: [ "git", "nginx" ] required: [ "git", "nginx" ]
--- ---
Over time git repositories become bloated with old data, but never get cleaned. Over time git repositories become bloated with old data, but never get cleaned.

View File

@ -1,7 +1,7 @@
--- ---
title: "Soft Serve through https" title: "Soft Serve through https"
tags: [ "data", "git server", "lfs" ] tags: [ "data", "git server", "lfs" ]
requires: [ "git", "nginx" ] required: [ "git", "nginx" ]
--- ---
## `http` Setup ## `http` Setup

View File

@ -1,7 +1,7 @@
--- ---
title: "Soft-Serve" title: "Soft-Serve"
tags: [ "data", "git server", "lfs", "TUI" ] tags: [ "data", "git server", "lfs", "TUI" ]
requires: [ "git", "nginx" ] required: [ "git", "nginx" ]
--- ---
- [Soft-Serve with https](soft-serve/soft_https.md) - [Soft-Serve with https](soft-serve/soft_https.md)

View File

@ -11,7 +11,6 @@ Select a keymap, and create a new custom map.
```sh ```sh
su root su root
ls /usr/share/kbd/keymaps/i386/qwerty/
basemap=/usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz basemap=/usr/share/kbd/keymaps/i386/qwerty/pl1.map.gz
newmap=/usr/share/kbd/keymaps/custom.map.gz newmap=/usr/share/kbd/keymaps/custom.map.gz

View File

@ -23,8 +23,7 @@ Using four spaces will not work!
## Dependency Files ## Dependency Files
Now we've made a `README.md` file, we can show how a makefile looks in the README file. Now we've made a `README.md` file, we can show how a makefile looks in the README:
Add these lines to the `Makefile`:
```make ```make
README.md: Makefile README.md: Makefile
@ -45,7 +44,7 @@ Note the order:
Notice that the file above can print into the README by using `echo "" >> $@`. Notice that the file above can print into the README by using `echo "" >> $@`.
The `$@` stands for 'the file which we want', and `$<` stands for 'the first dependency file'. The `$@` stands for 'the file which we want', and `$<` stands for 'the first dependency file'.
The `make` program starts by replacing those variables, so when you run `make`, the program looks like this: The `make` program starts by replacing those variables, and the result it:
```make ```make
README.md: Makefile README.md: Makefile
@ -55,6 +54,7 @@ README.md: Makefile
cat Makefile >> README.md cat Makefile >> README.md
echo '```' >> README.md echo '```' >> README.md
``` ```
| Sigil | Meaning | | Sigil | Meaning |
@ -71,6 +71,7 @@ README.md: Makefile
You can assign a variable normally, but must refer to it in brackets. You can assign a variable normally, but must refer to it in brackets.
```make ```make
storage_directory = backups storage_directory = backups
@ -181,3 +182,4 @@ In this case, the makefile can see that `backup` depends on the current backup f
- [File patterns](Makefiles/patterns.md) - [File patterns](Makefiles/patterns.md)
- [Makefile graphs](Makefiles/graph-easy.md) - [Makefile graphs](Makefiles/graph-easy.md)
- [In-build help](Makefiles/help.md) - [In-build help](Makefiles/help.md)
- [Makefile graphs](Makefiles/graph-easy.md)

View File

@ -1,32 +0,0 @@
---
title: "Managing Groups"
tags: [ "system" ]
---
Check which groups you are in, and which are available:
```sh
cat /etc/group
groups
cat /etc/group | grep $USER
```
Remove yourself from all groups, and add yourself back to only `wheel`, `audio`, and your own group:
```sh
sudo usermod --groups wheel,audio,$USER
```
Add yourself to the `wheel` group:
```sh
su root -c "usermod --append --groups wheel $USER"
```
Add yourself to the `network` group:
```sh
sudo usermod -aG network $USER
```
The changes will not take effect until you log in again, so reboot or log into `localhost` with [ssh](../networking/ssh.md).

View File

@ -1,16 +1,21 @@
--- ---
title: "virtualbox" title: "virtualbox"
tags: [ "system" ] tags: [ "system" ]
requires: [ "Managing Groups" ]
--- ---
# Setup # Setup
Load the modules (or just reboot): ## Arch Linux
```sh ```sh
su root sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
modprobe vboxdrv ```
vboxreload
```sh
sudo modprobe vboxdrv
```
```sh
# vboxreload
``` ```
Make dd image into vdi Make dd image into vdi
@ -25,13 +30,7 @@ If this doesn't work, try to make a new bite size with just
sudo dd if=image.dd of=image2.dd bs=512 conv=sync sudo dd if=image.dd of=image2.dd bs=512 conv=sync
``` ```
## Arch Linux ## CLI Management
```sh
pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
```
# CLI Management
List boxes: List boxes:
@ -51,19 +50,22 @@ To pause the machine:
VBoxManage controlvm "rata" pause --type headless VBoxManage controlvm "rata" pause --type headless
``` ```
You can do a number of things to the 'virtual boxes' this way: You can do a number of things to virtualboxes this way:
- `startvm` - startvm
- `pause`
- `resume` - pause
- `poweroff`
- resume
- poweroff
## Creating Disks ## Creating Disks
Creating a VM requires registering it: Creating a VM requires registering it:
```sh ```sh
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
``` ```
```sh ```sh
@ -76,7 +78,6 @@ VBoxManage storagectl Ubuntu19.04 -name IDE --add ide --controller PIIX4 --boot
Create just a disk with: Create just a disk with:
```sh VBoxManageg createhd --filename Ubuntu16.04 --size 5120
VBoxManage createhd --filename "$diskname" --size 5120
```