Skip to content

Commit 6da095a

Browse files
Update from Obsidian
1 parent b682bc7 commit 6da095a

File tree

4 files changed

+171
-11
lines changed

4 files changed

+171
-11
lines changed

.obsidian/workspace.json

Lines changed: 48 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,59 @@
44
"type": "split",
55
"children": [
66
{
7-
"id": "d4265ee8c9b67859",
7+
"id": "5472ed7d5f54e7a1",
88
"type": "tabs",
99
"children": [
1010
{
11-
"id": "16962415b3d73cc1",
11+
"id": "db7581b044eb37e3",
1212
"type": "leaf",
1313
"state": {
1414
"type": "markdown",
1515
"state": {
16-
"file": "New Server Setup (Debian).md",
16+
"file": "Disk image backups.md",
1717
"mode": "source",
18-
"source": false
18+
"source": true
1919
},
2020
"icon": "lucide-file",
21-
"title": "New Server Setup (Debian)"
21+
"title": "Disk image backups"
2222
}
2323
}
2424
]
25+
},
26+
{
27+
"id": "08b43c6270dddbb6",
28+
"type": "tabs",
29+
"children": [
30+
{
31+
"id": "a3aea08b505d1cdb",
32+
"type": "leaf",
33+
"state": {
34+
"type": "markdown",
35+
"state": {
36+
"file": "Disk image backups.md",
37+
"mode": "preview",
38+
"source": false
39+
},
40+
"icon": "lucide-file",
41+
"title": "Disk image backups"
42+
}
43+
},
44+
{
45+
"id": "fb4fc36cb03ca014",
46+
"type": "leaf",
47+
"state": {
48+
"type": "markdown",
49+
"state": {
50+
"file": "New Terraria server.md",
51+
"mode": "preview",
52+
"source": false
53+
},
54+
"icon": "lucide-file",
55+
"title": "New Terraria server"
56+
}
57+
}
58+
],
59+
"currentTab": 1
2560
}
2661
],
2762
"direction": "vertical"
@@ -164,20 +199,23 @@
164199
"command-palette:Open command palette": false
165200
}
166201
},
167-
"active": "16962415b3d73cc1",
202+
"active": "db7581b044eb37e3",
168203
"lastOpenFiles": [
204+
"How to change theme for Hugo.md",
205+
"Instaswarm.md",
206+
"New Terraria server.md",
207+
"Disk image backups.md",
169208
"Over-Engineering, oh man....md",
170209
"Remote Applications.md",
171-
"Setting up PI-Hole.md",
172210
"New Server Setup (Debian).md",
173-
"Instaswarm.md",
174-
"How to change theme for Hugo.md",
175211
"Making SSH-Keys.md",
212+
"test.md",
213+
"Templates/default-hugo-post-props.md",
214+
"Setting up PI-Hole.md",
176215
"Super-Spork.md",
177216
"Recovering corrupted USB drive.md",
178217
"Self-Hosted Mumble Voice Server with Docker, Lightweight Discord Alternative.md",
179218
"Rooting a TV Box via UART and Arduino.md",
180-
"Templates/default-hugo-post-props.md",
181219
"fun git procedure.md",
182220
"emulationstation2.pot",
183221
"redit post.md",

Disk image backups.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
title: Disk images
3+
description: Recently I found myself working with SD cards and thumb drives more often than usual. Reformatting and data recovery and all sorts of related things. Here I will explain how I backup data from storage devices.
4+
date: 2026-03-06
5+
draft: false
6+
toc: true
7+
ShowLastmod: true
8+
---
9+
## Plan
10+
Here how simple **backup** works:
11+
- Make raw disk image containing exact bit-by-bit copy of the physical drive.
12+
- Compress it for better storage.
13+
14+
When it comes to **restoring** this data I will just:
15+
- Decompress the `dick image`.
16+
- Write it to the drive.
17+
18+
Also, I must mention that, You should not always write to disk. instead you could mount the `disc image` as a loop device.
19+
20+
## Make raw disk image
21+
this is commonly done with `dd` command on Linux.
22+
```bash
23+
sudo dd if=/dev/sdx of=random_sdcard_backup.img bs=4M status=progress
24+
```
25+
here `sdx` is the name of the device. `lsblk` command can be used to list storage devices and their information (e.g. name).
26+
27+
## Compress disk image
28+
Usually this `.img` file takes up as much storage as the devices storage amount. So compressing it is a good Idea.
29+
There are lot of compression algorithms and one you chouse may vary depending on what king of information is on the drive and what do you intend to use it for. For example if the data on the drive is already pretty compressed then using better compression algorithms like `xz` would not do a lot, other than take a lot longer. I found that `gzip` is the best middle of the ground option. It had been the standard for Linux for decades at this point.
30+
So here is how compression with `gzip` goes:
31+
```bash
32+
gzip random_sdcard_backup.img
33+
```
34+
Here we could use `-k` for the option for keeping the original file. Also `-1, --fast` to compress faster and `-9, --best` to compress better.
35+
36+
37+
## Decompress disk image
38+
Decompressing is similar we just :
39+
```bash
40+
gunzip random_sdcard_backup.img.gz
41+
```
42+
`-k` can again be used to keep the input file.
43+
44+
This can also be done with `gzip` and `-d` option.
45+
46+
## Write to disk
47+
Now this is the actual writing to disk part and it is done with `dd` command, like this:
48+
```bash
49+
sudo dd if=random_sdcard_backup.img of=/dev/sdX bs=4M status=progress
50+
```
51+
Make sure the device path is correct.
52+
53+
`.img` can also be mounted as a loop device like this:
54+
```bash
55+
sudo mount -o loop random_sdcard_backup.img /mnt/sd-loop
56+
```
57+
make sure destination path exists.

New Server Setup (Debian).md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ for monitoring i will be using `btop` looks nice and is displaying some useful g
5151

5252

5353
### Nextcloud setup
54-
Easiest way to run Nextcloud is with container, but since I'm using `btop` i want to monitor everything separately and not as one docker program for example, so i will be installing it manually, following the [official manual](https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#) witch uses [LAMP Stack]()https://www.ibm.com/think/topics/lamp-stack.
54+
Easiest way to run Nextcloud is with container, but since I'm using `btop` i want to monitor everything separately and not as one docker program for example, so i will be instaldling it manually, following the [official manual](https://docs.nextcloud.com/server/stable/admin_manual/installation/source_installation.html#) witch uses [LAMP Stack]()https://www.ibm.com/think/topics/lamp-stack.
5555

5656
#### PHP Install
5757
Recommended PHP version, for now, is `v8.3` and in Debian repos there is only the newest version that can be installed like this:

New Terraria server.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
---
2+
title: New Terraria server
3+
description: Updating existing Terraria server from vanilla containerized server (not even using the compose file) to more professional server using `TShock`, open source software for more control over the server.
4+
date: 2025-12-04
5+
draft: false
6+
toc: true
7+
ShowLastmod: true
8+
---
9+
## Intro
10+
11+
I already had a [Terraria server](https://demetrebadzaradze.github.io/Second-Brain/posts/host-terraria-server-on-linux-server/) set up that I used for a while. But once I came back, I saw a lot of flaws with my previous setup, mainly performance, and not enough customization. So I searched and found this project called [TShock.](https://github.com/Pryaxis/TShock/ ) It is great, and in short, it tweaks a lot of things that are public in the Terraria source code. It also makes a lot of things much better like world saving, administration and it is structurally better than junk I had before.
12+
13+
## Plan
14+
Plan is to have a **TShock** powered terraria server as a container, make it easily runnable and also migrate to it.
15+
16+
## Docker compose set-up
17+
This time i will be using `docker compose`, since it is easy to configure one `.yml` file once and than just compose it up and down, rather than figuring out want environment variable need to be based in a docker run command, every time I start the server. Plus this way I can make server start automatically after boot.
18+
19+
Here is what the `compose.yml` file looks like:
20+
```yaml
21+
services:
22+
terraria:
23+
image: ghcr.io/pryaxis/tshock:latest
24+
container_name: terraria-test
25+
volumes:
26+
- "./tshock/:/tshock"
27+
- "./worlds:/worlds"
28+
- "./plugins:/plugins"
29+
- "/etc/localtime:/etc/localtime:ro"
30+
ports:
31+
- "7777:7777"
32+
# command: -world /worlds/<world name>.wld
33+
restart: "no"
34+
stop_grace_period: 60s
35+
tty: true
36+
stdin_open: true
37+
```
38+
`restart` can be set to `unless-stopped` so it starts on boot.
39+
> **NOTE:** `command` option is commented because initial run of the container is just needed to create the world. After that this option needs to be uncommented and world name needs to be entered appropriately (replacing `<`, `>` and content in the middle).
40+
41+
## Running the server
42+
Now this can be ran in two ways.
43+
44+
1. First is the interactive way with this:
45+
```bash
46+
docker compose run terraria
47+
```
48+
>**NOTE:** Here `terraria` is the name of the service that is defined in the `.yml` file. So replace it accordingly.
49+
50+
2. And none interactive way with:
51+
```bash
52+
docker compose up
53+
```
54+
This just gives read only logs of the container. You can also run this in detached mode with `-d` option. This way is simpler and preferred if you are not going to use any commands on not interact with the program, it is great for just running it.
55+
56+
### First run
57+
Upon first boot, if you don't have the world created and entered in the `.yml`, you will have to create the world. This is an interactive process so run with `run` command instead of `up` and follow the world configuration steps.
58+
59+
### After first run
60+
After initial run world should be created in the appropriate directory (`./worlds`, on host, in this case) with the name you chouse, as a `.wld` file. Then uncomment the the `command` option in `.yml` file and configure whatever you wish. And finally run it as you wish.
61+
62+
## Migrating from old set-up to TShock
63+
All we need is a `.wld` file from the old set-up. Place that into `./worlds` directory (optional, since you can just mount the old path for `/worlds` directory, but clean), uncomment `command` option in the `.yml` and input the appropriate path to this world.
64+
65+
You can then follow the TShock guidance in the chat and finish the setup and then configure the server as you wish.

0 commit comments

Comments
 (0)