Categories
Uncategorized

BearExporter

Codeberg release

I released the code for a Python script called BearExporter over on Codeberg.

It’s a Python script to export all of your Bear notes to Markdown files you can use with Obsidian, read in the terminal, or whatever. I originally started on this when I started using the MintBook and realized I did not have a good way of seeing any of my notes from a Linux computer.

And yes, you can export your notes in plenty of other ways, the idea with this script is that you can automate/schedule it to run whenever you want, as often as you want, for up-to-date files wherever you might need them.

As the old saying goes “it works for me!” but I know it’s not amazingly well-written code, but it is available. I’m not exactly skilled at Python but I’ll try to improve it as time allows.

The README file probably goes way too in-depth about all the shortcomings. There are times I’m proud of the code I write, and then there are times I get something to (barely) work for me and figure others might find a use for it.

I originally tried this bear_backup script but it wasn’t what I was after. But maybe it’s what you need? I should probably steal/borrow a few ideas from it to enhance my code.

Anyway, enjoy the code, use it ignore it, improve it, or tell me what to do better. :)

Categories
Uncategorized

Know Your Rights – Stopped by Police

The ACLU has a great guide about what to do if your are stopped by police. (And more general guides about your rights as well.)

Here’s a printable PDF guide for what to do if you are stopped. Print one and carry it with you. Print them out and give them to people you care about (which should be everyone) so they too can know what to do.

Being stopped by police is a stressful experience that can go bad quickly. Here we describe what the law requires and also offer strategies for handling police encounters. We want to be clear: The burden of de-escalation does not fall on private citizens — it falls on police officers. However, you cannot assume officers will behave in a way that protects your safety or that they will respect your rights even after you assert them. You may be able to reduce risk to yourself by staying calm and not exhibiting hostility toward the officers. The truth is that there are situations where people have done everything they could to put an officer at ease, yet still ended up injured or killed.

Ask if you are free to leave. If the officer says yes, calmly and silently walk away. If you are under arrest, you have a right to know why.

And here’s a PDF of the whole page… as a backup. Just in case.

Categories
Uncategorized

OpenSCAD Springy Example

Previously on… the Fediverse! I posted about this springy thing I was designing, and I said:

I’m trying to come up with a good way of creating this in OpenSCAD… I have something using a bunch of hull’d cylinders but I’m wondering if there is a better/easier way to do it.

First of all, I love OpenSCAD. I also love sharing. I was really pleased to see people coming up with ideas. Hey, maybe we should make a weekly OpenSCAD Coding Club!

deshipu suggested Inkscape for a 2D vector and then importing.

Bryan Fink suggested rotate_extrude which I often forget about. I would have never thought to use it for this. See Bryan’s example.

Makerblock came through and wrote a whole post about this thing!

Alistair Buxton also wrote some code you should check out and used the 2D parts of OpenSCAD I usually ignore.

And oh yeah! Here’s mine:

See the code here! This also spurred me to finally make that OpenSCAD repo on Codeberg. I’d like to fill it with bit and pieces of things. I already share a bunch of designs on Printables but this repo will be more code focused and have things that are not finished projects. (Though I may also add finished projects.)

Basically I only know how to do these things because others did them and were willing to share. I’m doing my part… are you!?

Categories
Uncategorized

Nginx Proxy Manager

I recently setup Nginx Proxy Manager and here’s how I did it. Oh, first I’ll explain what it is. A proxy is a person appointed or authorized to act for another…. well, that’s for people, but with computers it’s pretty similar. One computer acts as a go-between for you and the computers/services on your network. Remember when I mentioned Jellyfin? Well to get access to my Jellyfin server running on my home network I poked a hole in my router using “port forwarding” which allowed me to connect to it from anywhere I had an Internet connection.

So if you’re at home and visit whatsmyip.org it will show you the public IP address of the router from whatever company provides your Internet service. (In some cases this address will change, but if you’re luckily it will remain the same. If it changes you’ll need to know about “Dynamic DNS” but I’ll skip that for now.)

Anyway, I was using port forwarding for Jellyfin, but I wanted to add a few more things I could access and rather than faff about with a whole lot of port forwarding I just forwarded one thing (port 80) to Nginx Proxy Manager which runs on a Raspberry Pi at my house. This single little computer routes all the requests you see in the image above.

I used subdomains to determine what goes where, as I have multiple computers on my network, and some run multiple services on different ports. So if your home IP address is 1.2.3.4 and you normally connect to 1.2.3.4:8096 (ip_address:port_number) you can set up the proxy to accept requests from media01.example.com (on port 80, which is the default) to go to the internal computer at 192.168.1.79.8096 (assuming you own example.com, added a subdomain, and pointed it at your home IP address that is!)

I should note that when I did the port forwarding for the computer running Nginx Proxy Manager I got this scary warning about breaking things… and nothing broke.

Why would you want to use a proxy manager instead of just doing port forwarding? Well, besides making things clean (not having to worry about port numbers) you can use Let’s Encrypt with Nginx Proxy Manager and it’s extremely easy to add secure TLS certificates so your traffic is encrypted. Without this anything you log into on your home network is done via plain HTTP which is not encrypted, so it’s like writing your password on a postcard.

I mentioned I am running this on a Raspberry Pi. It’s an older one, a Model 2 or 3 I believe, but honestly its all that is needed. The nice thing about “Home Cloud” stuff is that you probably won’t have a lot of users. For my stuff it’s pretty much just me. Maybe a few family members might access things at some point but I’m not too worried about the Pi not being able to handle it. If the SD card dies and the Pi stops working at some point the worse that will happen is I won’t be able to access things from outside the house until I fix it. So failure isn’t catastrophic. Our (outgoing) home Internet connection will not be affected.

Categories
Uncategorized

Editing a Bear Theme

I’m still using Bear Notes because I have not found something I like better. (And yes, I have tried!) As long as I am going to keep using Bear for now, I figured I should fix one small thing that has been bothering me.

In the image above you’ll see a note using the Panic Mode theme. It’s a theme I really like. Bear Pro has over 28 themes and it all comes down to personal preference, right? I like Panic Mode but the selection highlight color is terrible. With my old eyes it’s very difficult for me to see… so I fixed it.


Above is what it looks like now on my Mac. That bright green is way easier for me to see! It’s a small change but makes a huge difference in my ability to see the selected text clearly.


To make this change you need to edit a file inside the Bear application. You can right click and choose “Show Package Contents” or just use the terminal and type:

open /Applications/Bear.app/Contents/Frameworks/BearCore.framework/Versions/A/Resources/

and the folder should open in the Finder.


Find the theme file you want and edit it. But hey, quit Bear first, and you might want to copy the file to your Desktop, make a copy–just in case–and them make your edits.


I’ve only changed one line to change the highlight color. I saved the file and copied it back into place. You’ll need to enter an admin password to copy the file since it’s going inside an application. (Specifically I changed “selection color” from #405268 to #55DF2F.)

If you use Bear on more than one Mac you’ll need to copy the file into each application. Obviously you cannot make this change on iOS but the highlight color on iOS is different and not the same low-contrast color you see in the above first example so it’s all good on iOS for me.

Oh Yeah! This change will get overwritten when you update/upgrade Bear, so keep than in mind, keep a copy of your file, or make a note about what you’ve changed.

Theme editing should be easier of course, but hey… compromises, right? And yes, there are other themes as well.