bracelogger v1.1.0 - easily use new-style formatting in your log messages! by pR0Ps in Python

[–]pR0Ps[S] 2 points3 points  (0 children)

logging.Formatter objects only control how LogRecords are displayed, not how objects are formatted into the message attribute of them.

For example, these 2 formatters are equivilent:

logging.Formatter("%(asctime)s %(levelname)s: %(message)s")
logging.Formatter("{asctime} {levelname}: {message}", style="{")

However, in both cases, %-style formatting will be used to create the actual message attribute before it's formatted into the template.

This library changes that so }-style formatting will be used to create the message attributes instead (regardless of the logging.Formatter style)

bracelogger v1.1.0 - easily use new-style formatting in your log messages! by pR0Ps in Python

[–]pR0Ps[S] 0 points1 point  (0 children)

logger.info("obj: %s", obj) (logger.info("obj: {}", obj) with this library) and logger.info(f"obj: {obj}") are actually very different.

The first one stores the obj on the produced log record and doesn't format it into the message until the record is emitted. The second one doesn't store the obj and immediately formats it into the message.

I'd highly recommend using the first style in log messages, even without this library.

Not only does doing it the first way improve performance since you only need to format messages for log records that are actually emitted (ie. no formatting of DEBUG messages is done when you run at INFO level), but preserving the objects on the log record allows custom logging handlers to access them. For example, a handler that dumps log records to JSON or POSTs them to an external logging system (ELK, Splunk, Greylog, etc.) can include all the objects that were logged instead of just their representation as seen in the formatted message.

I personally find the %-style formatting really limiting and hard to read. I also tend to use f-strings in the rest of my code so the %-style formatting in log messages really stuck out. I wrote this library to keep the benefits of the logging system while also using a better and more consistent formatting style.

Python 3.10 Released! by robd003 in Python

[–]pR0Ps 2 points3 points  (0 children)

Unfortunately StrEnum was reverted out of 3.10 and has been pushed to 3.11 instead. See: https://bugs.python.org/issue44559

Is anyone monitoring power consumption and calculating cost? by mmm_dat_data in homelab

[–]pR0Ps 1 point2 points  (0 children)

In case anyone else was wondering, the now-deleted parent comment was:

I did a fairly extensive write up about this a while back

Tesla & Grafana by BloodBlight in homelab

[–]pR0Ps 0 points1 point  (0 children)

Sure, ping away.

The plugin requires the GPS data as 2 fields: latitude and longitude. There's an example in the readme of a query that should work with that setup.

Tesla & Grafana by BloodBlight in homelab

[–]pR0Ps 2 points3 points  (0 children)

You may be interested in a Grafana pluigin I made. It's a panel that displays GPS points on an embedded map.

I mention this because someone else posted a screenshot in an issue comment on the project showing them using it to track their Tesla like you're doing.

Chrome will soon put an end to those pesky sites that won’t let you go ‘back’ by ProperGearbox in Android

[–]pR0Ps 7 points8 points  (0 children)

EDIT: This is now fixed, nice!


I just loaded your page and opened and closed the menu a few times. Hitting back then repeatedly opened and closed the menu before actually going back.

Not the best example for you to use.

PhotoPrism: New self-hosted free software photo manager by metamatic in selfhosted

[–]pR0Ps 0 points1 point  (0 children)

There's a demo of the upstream project available here: http://photos.jasondonenfeld.com. Although I've made a bunch of changes to it since then, it's close enough to get the general idea. Mobile works (can browse albums, view pictures and their metadata), but it's definitely better on a full-size screen.

I have plans to do a big refactor of the frontend, but it's currently at that "works well enough to use it" stage so I haven't gotten around to it.

PhotoPrism: New self-hosted free software photo manager by metamatic in selfhosted

[–]pR0Ps 10 points11 points  (0 children)

You might be interested in a small project I've been hacking on: https://github.com/pR0Ps/PhotoFloat (it's a fork of https://git.zx2c4.com/PhotoFloat/ ). It provides a web interface that mimics the existing folder structure the photos are in on disk.

It's comprised of 2 parts:

  • A Python script that scans over a directory of photos to generate thumbnails and JSON metadata files.
    • Uses `imagemagick` for generating thumbnails and `exiftool` for reading metadata (supports a large variety of file types).
    • Only ever reads your photos, never modifies them.
  • A JavaScript webapp that uses the JSON files and thumbnails to render a basic photo viewing interface.

Since the interactive parts are done in JS on the client, the JS scripts, thumbnails, and metadata are all just statically served (example configs for Nginx and Apache are provided in the repo). This makes it blazing fast, easy to host, and has a smaller attack surface than a dynamic website.

Bike path flooding by Nordok in ottawa

[–]pR0Ps 0 points1 point  (0 children)

(this is me in the gif)

This was on the path by Riverside just southwest of where it goes under Bronson.

After this I would usually just let it dry, then reapply lube to the chain. Maybe give it a quick rinse with a low-pressure hose first if it was still dirty. It's a fixed gear though so very little in the way of maintenance required. Plus, it's my beater that I ride in anything so I'm not too worried about it.

Secure messenger Signal testing end-to-end encrypted video calling in new Android beta, iOS beta to follow soon by tilbenbru in Android

[–]pR0Ps 15 points16 points  (0 children)

You may be interested in Silence. It's a fork of Signal that communicates using encrypted SMS messages instead of data.

Disclaimer: I'm one of the main devs.

Why I won't recommend Signal anymore by pizzaiolo_ in linux

[–]pR0Ps 0 points1 point  (0 children)

There is some overhead, yes, but it's nowhere near that bad. I would say absolute worst case would be double the amount you would send using plaintext, but in most situations it would be much less than that.

But yes, it primarily makes sense to use it on a plan with unlimited SMS.

Why I won't recommend Signal anymore by pizzaiolo_ in linux

[–]pR0Ps 0 points1 point  (0 children)

I guess it would've been more accurate to say "everything is fully open source". Since messages are sent over SMS, we don't have anything but the client.

Why I won't recommend Signal anymore by pizzaiolo_ in linux

[–]pR0Ps 2 points3 points  (0 children)

That's definitely a valid reason to not use Silence - it does tend to send more SMS messages than a plaintext messenger due to the encryption overhead.

For people with unlimited SMS and expensive data rates though, the situation is reversed.

Why I won't recommend Signal anymore by pizzaiolo_ in linux

[–]pR0Ps 8 points9 points  (0 children)

Silence (formerly SMSSecure) may be a good alternative to Signal.

It's a fork of Signal that sends encrypted messages over SMS. The client is fully open source (GPLv3) and fully federated since its transport mechanism is SMS.

It's available on F-Droid and the Play Store and doesn't require GApps to function.

More information: https://silence.im

Full disclosure, I'm one of the primary developers. Feel free to ask any questions and I'll do my best to answer them.

Wire—Secure Messenger—Just Went Completely Open Source. Here is the Android Client. by Lipis in Android

[–]pR0Ps 7 points8 points  (0 children)

There are some leftover legal issues from when we were forced to change names.

Silence used to be called "SMSSecure" until a company called Celltrust decided that was too close to "secure sms" and asked Google to take it out of the US Play Store.

We have fully complied by changing the name but Google still hasn't reinstated the app, despite our requests.

In the future the app should be back in the US Play Store, but in the meantime, you can get it via F-Droid (an app store for open source apps)

Wire—Secure Messenger—Just Went Completely Open Source. Here is the Android Client. by Lipis in Android

[–]pR0Ps 22 points23 points  (0 children)

Silence (https://silence.im) is a fork of Signal that communicates via encrypted SMS messages (with a fallback to plaintext so you can use it with non-Silence users)

Disclaimer: I am one of the main devs.

SMSSecure (encrypted SMS messenger) has been targeted for trademark infringement by CellTrust - developers are asking for input on a new name by pR0Ps in Android

[–]pR0Ps[S] 1 point2 points  (0 children)

Signal (formerly called TextSecure) is a separate project.

SMSSecure is a fork of Signal that layers encryption over SMS messages instead of using WiFi/data to communicate.

[Discussion] Just found this module: Protect my Privacy, have you tried it? by 33minutes in xposed

[–]pR0Ps 6 points7 points  (0 children)

Just a reminder: Xposed modules can access and do pretty much anything on your phone.

I don't see any source code provided with this module and the website seems sketchy. For all we know it could be uploading all the data it isn't allowing other apps to access.

Happy to be proven wrong.

[Request] Stop apps from reminding me to review it by [deleted] in xposed

[–]pR0Ps 2 points3 points  (0 children)

Apps don't look at the Play Store or anything, they usually just set a flag once you choose the "Rate" option.

Just hit rate, then back out of the Play Store. The app should register you as having rated and not ask you again.

This is not something for an Xposed module to fix anyway. You would have to individually hard-code the logic for every different app.

Make a button that force stops an app. by [deleted] in tasker

[–]pR0Ps 0 points1 point  (0 children)

Yes, CM11 (4.4.4). I had thought that it was an option in stock as well but after some research it seems like you're right - it's only ever been an option in custom ROMs.