oscarmlage oscarmlage

Microposts

Short notes, mainly with photos, quick thoughts, links, and small updates from my day-to-day.

TIL

#TIL that with #Obsidian and the #Templater plugin, it’s possible to automatically create a new note and a related issue in #Gitea or #Forgejo at the same time. Made my day.

You can define a custom function that makes a curl request as tp.user.curl():

const { exec } = require('child_process');

module.exports = async (args) => {
    return new Promise((resolve, reject) => {
        exec(args.command, (error, stdout, stderr) => {
            if (error) {
                console.error(`Error: ${error.message}`);
                reject(error);
            } else if (stderr) {
                console.error(`Stderr: ${stderr}`);
                reject(stderr);
            } else {
                console.log(`Result: ${stdout}`);
                resolve(stdout);
            }
        });
    });
};

Then the function call:

<%*
const curlCommand = `curl -s -X POST -H "Content-Type: application/json" -H "Authorization: token ${token}" -d "{\\"title\\": \\"${title}\\", \\"body\\": \\"${content}\\"}" ${url}`;
const exec = await tp.user.curl({ command: curlCommand });
%>

When you execute this template, the curl request will be triggered, creating the issue as specified.

TIL

Suddenly, all the books in my Kindle disappeared, which was kind of scary. I connected it to my computer, opened Calibre, and the books seemed to be fine on the device. After disconnecting it, the library was able to load again. I thought I had lost all my reading progress, but it seems to be fine in the end.

#kindle #surprises

TIL

I’ve had a small problem with a Nextcloud instance. I’m still not sure why, but it has continuously marked several directories as «locked», and the disk space usage has increased from 300GB to almost 2TB.

[…]

Now I’m trying to delete those directories manually —the hard way— and restore the connection between the server and the client. But I’m still worried about the issue.

[…]

6 hours later…

TIL

Today I learned how to modify a fluorescent tube ceiling light to replace it with two LED bulbs.

#TIL #lights #DIY

TIL

Today I’ve built a new template for Obsidian Templater that allows the microposts creation inside Hugo running a simple command:

---
title: null
date: 2024-05-22 00:26:11
draft: false
tags: micropost
---

I’m really starting to love this kind of things. #obsidian #TIL

TIL

Looks like today is all about aliases... and tmux! Here's a little helper for all the lazy folks out there using `tmuxp` daily – for those as lazy as me even after a restart:

```bash
for i in $(ls ~/.tmuxp); do tmuxp load $(basename ${i} .yaml) \&; done
```

Lazy productivity at its finest! 😴💻

TIL

I've discovered a simple way to integrate running tests for a project within popups in , and I can toggle them with a single shortcut.

It might sound trivial, but it saves me a lot of keystrokes every day.

And my mind is happier too because I can quickly hide all those Fs.

TIL

Sometimes even SQL reveals itself as a powerful magic wand. When you think you need to conjure a small script to recover a specific field from all the records in a table from the abyss of your backup, you're amazed because... it's just SQL! 💫

TIL

TIL: How to SSH shim a dockerized Gitea by passing SSH through from the host to the container.

On host:

1. Share user (GID/UID) with the container env
2. Add new keys and mount .ssh as new volume
3. Mock the gitea binary on host to pass the SSH original command to the container

For the client:

1. Optionally add a new key to interact with the server
2. Add the pubkey to Gitea using the web interface
3. Be sure you're using the key and enjoy your clone :)

TIL

Just found out about BetterDisplay and used it to activate HiDPI resolution on my . The difference is insane!

🔘github.com/waydabber/BetterDis

(zoom in on the image if you're curious about it)

Subscribe: Feedsxmlns="http://www.w3.org/2000/svg"width="24"height="24"viewBox="0 0 24 24"fill="none"stroke="currentColor"stroke-width="2"stroke-linecap="round"stroke-linejoin="round"class="icon icon-tabler icons-tabler-outline icon-tabler-rss"> Microposts