diff --git a/src/build.ts b/src/build.ts index 3cc4c64..fd02a9e 100644 --- a/src/build.ts +++ b/src/build.ts @@ -1,10 +1,10 @@ -import * as esbuild from "esbuild" -import {watch, cpSync, rmdirSync, readFileSync, ReadStream} from "node:fs" -import { serve } from 'micro'; -import {Server} from "node:http" -import handler from "serve-handler" +import * as esbuild from "esbuild"; +import { watch, cpSync, rmdirSync, readFileSync, ReadStream } from "node:fs"; +import { serve } from "micro"; +import { Server } from "node:http"; +import handler from "serve-handler"; import { Readable } from "node:stream"; -import { WebSocketServer } from 'ws'; +import { WebSocketServer } from "ws"; const script = `let t;function rr() {console.log("connecting to dev server") let a = new WebSocket("ws://localhost:8081"); @@ -22,67 +22,77 @@ a.addEventListener("close", () => { t = setTimeout(()=>{ rr() },1000) -})};rr();`; +})};window.addEventListener("load", () => rr())`; -const argv = process.argv.slice(2) +const argv = process.argv.slice(2); async function buildTs() { - console.log("[dev] Building file..") - await esbuild.build({ - entryPoints: ["./src/web/ts/index.ts"], - outfile: "./src/web/dist.js" - }) + console.log("[dev] Building file.."); + await esbuild.build({ + entryPoints: ["./src/web/ts/index.ts"], + outfile: "./src/web/dist.js", + }); } await buildTs(); -if(argv[0] == "--build") { - try{rmdirSync("./dist")}catch{} - cpSync("./src/web/", "./dist/", {recursive:true}) - rmdirSync("./dist/ts",{recursive:true}) - console.log("[dev] View the dist folder") +if (argv[0] == "--build") { + try { + rmdirSync("./dist"); + } catch {} + cpSync("./src/web/", "./dist/", { recursive: true }); + rmdirSync("./dist/ts", { recursive: true }); + + console.log("[dev] View the dist folder"); } -if(argv[0] == "--dev") { - const wss = new WebSocketServer({ port: 8081 }); - let allConnections = new Map(); - wss.on('connection', function connection(ws) { - const id = Math.random(); - allConnections.set(id, ws as any); +if (argv[0] == "--dev") { + const wss = new WebSocketServer({ port: 8081 }); + let allConnections = new Map(); + wss.on("connection", function connection(ws) { + const id = Math.random(); + allConnections.set(id, ws as any); - ws.on('error', console.error); - ws.on("close", () => { - allConnections.delete(id); - }) + ws.on("error", console.error); + ws.on("close", () => { + allConnections.delete(id); }); - const server = new Server( - serve(async (req, res) => { - if(req.url == "/" || req.url?.endsWith(".html")) { - await handler(req, res, { - directoryListing: false, - public: "src/web/" - }, { - createReadStream(path, options) { - let sx = readFileSync(path).toString("utf8"); - sx = sx.replaceAll("", ``) - return Readable.from([sx]) as ReadStream - }, - }); - } else { - await handler(req, res, { - directoryListing: false, - public: "src/web/" - }); + }); + const server = new Server( + serve(async (req, res) => { + await handler( + req, + res, + { + directoryListing: false, + public: "src/web/", + }, + { + createReadStream(path, options) { + let sx = readFileSync(path).toString("utf8"); + + if (!path.toString().endsWith(".html")) { + return Readable.from([sx]) as ReadStream; } - }) - ) - server.listen(8080) - console.log('[http] Listening HTTP on 8080.') - watch("./src/web", { - recursive: true, - }, async (e,f) => { - if(f == "dist.js") return; - console.log("[dev] Noticed update in " + f + ", of type " + e +".") - allConnections.forEach(z => z.send("refresh")); - await buildTs(); + + sx = sx.replace("", ``); + return Readable.from([sx]) as ReadStream; + }, + } + ); }) + ); + server.listen(8080); + console.log("[http] Listening HTTP on 8080."); + watch( + "./src/web", + { + recursive: true, + }, + async (e, f) => { + if (f == "dist.js") return; + console.log("[dev] Noticed update in " + f + ", of type " + e + "."); + allConnections.forEach((z) => z.send("refresh")); + await buildTs(); + } + ); } diff --git a/src/web/Screenshot_2023-02-04_16-45-32.png b/src/web/Screenshot_2023-02-04_16-45-32.png deleted file mode 100755 index 96dfd04..0000000 Binary files a/src/web/Screenshot_2023-02-04_16-45-32.png and /dev/null differ diff --git a/src/web/blog.html b/src/web/blog.html new file mode 100644 index 0000000..2032a08 --- /dev/null +++ b/src/web/blog.html @@ -0,0 +1,106 @@ + + + + + + + + + + + soph's blog and information + + + + + + + + + + + + + + + + + + + + + + + +

sophie's blog

+ + + +
+ + + + + \ No newline at end of file diff --git a/src/web/blogs/opensource-watch-comparison.md b/src/web/blogs/opensource-watch-comparison.md new file mode 100644 index 0000000..6900ea8 --- /dev/null +++ b/src/web/blogs/opensource-watch-comparison.md @@ -0,0 +1,22 @@ +title = Opensource watch comparison +time = 1721340000 +======================== + +This has been a topic I've been very interested for very long. There's been three main opensource watches, those being the Bangle.js 2, ZSwatch, and Pine64 Pinetime. These all have their pluses and minuses, which I'll talk about in this post. As a disclaimar, I don't own any of these. I'm writing this exact blog post to compare and figure out which one of these is the best one. If there is a best one. + +There is a different talk about other watches, that aren't opensource by themselves, but can be very easily modified to run [opensource firmwares](https://wasp-os.readthedocs.io/en/latest/install.html#device-support) (also see Gadgetbridge's supported gadgets). In my opinion, these watches are sold only for a very small amount of time, and usually don't work on any opensource apps such as Gadgetbridge. I will not be talking about them in this blog post, because I honestly think that they are not a point for comparison. + +## Comparison +| Watch name | Price | Prebuilt? | HR sensor | Environmental sensor? | Pressure sensor? | Flash size | GPS? | Temperature? | External SWD? | Score | +|-------------|----------------|-----------|-----------|-----------------------|------------------|------------|------|--------------|---------------|-----------------| +| Bangle.js 2 | 91,08 EUR | ✅ | ✅ | ✅ | ✅ | 8MB | ✅ | ✅ | ✅ | 7/11 (+0 Price) | +| Pinetime | 24,78 EUR | ✅ | ✅ | ❌ | ❌ | 4MB | ❌ | ❌ | ❌ (sealed) | 6/11 (+4 Price) | +| ZSWatch | Around 40 euro | ❌ | ❌ | ✅ | ✅ | 16MB | ❌ | ✅ | ✅ | 6/10 (+2 Price) | + +## Conclusion +In my opinion, every single one of these watches is a good option. However, if you have extra money to spend, the Bangle.js 2 is EASILY the best option. If you are on a budget, choose the pinetime. And if you have a lot of time and energy to build a ZSWatch, then do that. + +## Links +[Bangle.js 2](https://shop.espruino.com/banglejs2) +[ZSWatch](https://github.com/jakkra/ZSWatch?tab=readme-ov-file) +[PineTime](https://pine64.com/product/pinetime-smartwatch-sealed/) \ No newline at end of file diff --git a/src/web/blogs/raspberry-pi-struggles.md b/src/web/blogs/raspberry-pi-struggles.md new file mode 100644 index 0000000..ed62f25 --- /dev/null +++ b/src/web/blogs/raspberry-pi-struggles.md @@ -0,0 +1,16 @@ +title = raspberry pi struggles +time = 1717925441 +======================== + +recently, i have been experiencing struggles with my raspberry pi +here i will list all of the issues, maybe you have solutions or something +## git randomly breaking +this is entierly spontenous, and happens on every distro i've used for RPi3. it just SEGFAULT's after I update the system, and nothing helps, even uninstalling and reinstalling doesn't work. +## stdio.h +stdio.h has broken on me multiple times, to the point where it starts pulling in fortran sources and other bullshit, forcing me to use qemu on my own PC to compile stuff +## random overheating ??? +my RPi has 0 load, 0 anything. absolutely nothing is being done on it, like 3 processes +and it still randomly overheats, to the point where the case has started to droop. it is literally +melting before my eyes + +there is something either very wrong with my raspberry Pi, or I've broken something. at this point all I've been using has been STM32's and ESP8266's for my projects, or a hetzner dedi. i don't know why I even maintain most of my own hardware at this point, it serves 0 purpose if I could just parsec into a server with a 4090 diff --git a/src/web/blogs/why-i-syncthing.md b/src/web/blogs/why-i-syncthing.md new file mode 100644 index 0000000..705e0ca --- /dev/null +++ b/src/web/blogs/why-i-syncthing.md @@ -0,0 +1,25 @@ +title = Why I ❤️ Syncthing +time = 1711916100 +======================== + +I recently moved from Dropbox to Syncthing. It's been one of the best experiences in a long while. +## Rationale +Dropbox had limited devices, while I wanted to sync multiple devices (such as my phone, laptop and PC and RPi), and it was already hitting that limit. I didn't want to pay for a service which I could self host and use entierly independently of any company. It didn't seem hard to at all to setup Syncthing, as I had found it while scrolling friend's discord servers and finding it there. +## How to do it +Syncthing might seem complicated to use and maintain, but it's actually not at all complicated. +First, you have to have at least two devices. These can be absolutely anything, a VPS, a dedicated server, a PC, a phone, a SBC (such as a RPi, BananaPI, etc). After that you have to install syncthing on one of them (your most reliable one) and then follow https://docs.syncthing.net/intro/getting-started.html to install it. Then, grab your phone, whatever it may be, your second device. Let's say it's a laptop, to ease the setup. You have to install syncthing on that laptop too. Then grab it's device ID (the getting started guide would have thought you this), and then just add the device into the main syncthing. This is painless, happens in less than a minute and works through NAT, many firewalls, etc. I have a RPi with a 2TB harddrive setup in my collage dorms, and one on my dedicated server, and one on my laptop and one of my phone. This gives me insane reliability, if the dedicated server goes down, the syncing will resume once it's back. It's entierly painless, once your RPi goes down your data is still perfectly accessible on your server, laptop and phone. +## The experience 4 weeks in +It has been absolutely amazing. One time I had to switch the main server from a VPS to a dedicated server, which was pretty easy. I have had almost 0 hurdles, only issue I ever had was Android not supporting certain filenames (names with |\\?*<\":>+[]/' characters), which then caused a desync. Once I removed these characters from my filenames, it instantly synced and worked perfectly. I have ran into 0 other issues, since that. Absolutely smooth sailing +## Comparison +| Options | Dropbox | Syncthing | Google Drive (one) | Nextcloud | OneDrive | +| -------------------------- | ------------------------------- | -------------------- | :------------------ | ----------------------------- | ------------------------------ | +| Versioning | 30 days on basic and low plans | Configurable, (♾️) | No idea, not listed | Configurable, (♾️) | No idea, not listed | +| Price | 2.09eur (100gb), 10.99eur (2tb) | Server hosting costs | 12USD (2TB) | Server hosting costs | 1.99USD (100gb), 6.99USD (1TB) | +| Opensource | No | Yes | No | Yes | No | +| 2FA | Yes | No | Yes | Yes | Yes | +| Encryption/Encrypted files | No | Yes | Yes | Yes | No | +| Free data | 2gb | ♾️ | 15gb | ♾️(if no hosting, 1gb to 8gb) | 5gb | +## Final Opinions +If you need less than 15GB, just use Google Drive, Dropbox or Onedrive. These also usually come with effords to sync them properly, and don't work on all devices. If you need more than let's say, 1TB, just buy a server from https://contabo.com/en/ or https://www.hetzner.com/sb/ for about the same price, and a LOT more use out of your money. + +(I am not endorsed by any of these websites.) \ No newline at end of file diff --git a/src/web/index.html b/src/web/index.html index 4c189a2..a17454d 100644 --- a/src/web/index.html +++ b/src/web/index.html @@ -77,32 +77,40 @@
- | + | | +
- I'm Latvian, 17. My name's Sophie. I love listening to music, I have <loading...> song plays. + I'm Latvian, 17. My name's Sophie. I love listening to music, I have <loading...> song plays.
I am a JS/TS developer, mostly specializing in backend work.
- I play minecraft, and upgun with friends. I have developed many bukkit plugins for Paper/Folia/Spigot before, and am pretty well versed in them. + I play minecraft, and upgun with friends. I have developed many bukkit plugins for Paper/Folia/Spigot + before, and am pretty well versed in them.
- Contact me at matrix, discord, github (view projects here), sadgit, or mastodon + Contact me at matrix, discord, github (view projects here), sadgit, or mastodon
Here's my PGP key.
- + Click spacebar to change the themes.