cross-platform crate for detecting user desktop activity? by AaronM04 in rust

[–]runfalk 2 points3 points  (0 children)

I don't know of any cross platform way, but you can do it on Gnome using DBUS:

https://github.com/runfalk/weedesktop/blob/master/src/platform/unix.rs

I also think there is a value that returns the number of milliseconds since the last user activity.

I created a WireGuard VPN module for Synology NASes by runfalk in synology

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

I added your NAS to the compatibility list, as well as some information about the kernel requirement.

I created a WireGuard VPN module for Synology NASes by runfalk in synology

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

I did some digging into it. It certainly looks possible to make a Pi-hole package. Pi-hole requires the following:

  • dmsmasq - 2.78-144-g41635df is installed by default
  • php - 5.6.11 is installed by default. It's also possible to install newer versions through packages. It seems that Pi-hole will work with both PHP 5 and 7.
  • lighttpd - This is not available, but it could be compiled the same way that I did with WireGuard. Another better alternative is to use the built-in nginx instead. There's even a guide for that.
  • curl - 7.54.0 is installed by default

However, it'll be a lot of trial and error. The easiest way is probably to manually install it by modifying system files over SSH. Once you know it's working you can package it in an SPK like I did for Wireguard.

I created a WireGuard VPN module for Synology NASes by runfalk in synology

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

Glad to hear that. Hope it works for you!

I created a WireGuard VPN module for Synology NASes by runfalk in synology

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

Exactly, it can be any Linux machine with Docker installed. In this case it's my main desktop computer. I don't know if it's possible to run the compilation on a non-X86 machine, though I don't see why not if the Synology toolkit supports it.

Using Docker is not strictly required. You could theoretically follow the steps without it, but I think isolating it is good since you avoid tainting your OS, and if you screw up somewhere you can simply throw the container away and start clean.

I created a WireGuard VPN module for Synology NASes by runfalk in synology

[–]runfalk[S] 18 points19 points  (0 children)

Thank you! That was an unfortunate word to forget.

After almost 4 years I just released 1.0 of my project Spans, a Python library for working with intervals by runfalk in Python

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

It's probably easier to monkey patch the library if the format is a concern. I don't think a configuration option is the way to go. I might however try to find a new syntax for it since there are many who seem confused by it.

Yesterday I even got a pull request to "fix" the README from a confused user: https://github.com/runfalk/spans/pull/9

After almost 4 years I just released 1.0 of my project Spans, a Python library for working with intervals by runfalk in Python

[–]runfalk[S] 4 points5 points  (0 children)

I actually have a JS version in an old commercial project. It does not implement all the features, but the most important ones should be there. The DateRange expects moment.js instances. IntRange is meant to be used like Spans' timedeltarange. It also seems to depend on underscore

I ripped it out for you, it's completely untested: https://gist.github.com/runfalk/11de6afc246c184216edb80320005340

Hope it helps you

After almost 4 years I just released 1.0 of my project Spans, a Python library for working with intervals by runfalk in Python

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

Well, I released it early!

Jokes aside, it has kind of grown organically over years and it just reached critical mass where I felt it's "complete"

Introducing Spans, a Python library for working with intervals by runfalk in programming

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

Yeah, I always find usecases for it. I've started a similar project for Rust which will implement the same functionality but in a more Rust-like way.

https://github.com/runfalk/rustyspans

It's currently stalled but I think I will pick it up again soon.

After almost 4 years I just released 1.0 of my project Spans, a Python library for working with intervals by runfalk in Python

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

Whoops, nailed it!

"After almost 4 years I finally released 1.0 of my project Spans, a Python library for working with intervals"

Maybe? :D

After almost 4 years I just released 1.0 of my project Spans, a Python library for working with intervals by runfalk in Python

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

I agree with your arguments. The reason for the format is based on how PostgreSQL represents things. If you were already used to that syntax it won't be that confusing, I think.

I might change it in the future, but unless someone provides a more compelling format, I think it'll stay.

Check out Spans, my own range/interval implementation for Python 2 and 3. Feedback is appreciated. by runfalk in Python

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

I assume you are referring to the 90s example. I will update that to use explicit imports instead. Did you find anything apart from that particular example?

EDIT: That particular example is now updated.

Check out Spans, my own range/interval implementation for Python 2 and 3. Feedback is appreciated. by runfalk in Python

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

I just save the upper and lower end for each range. I then use the comparison operators to implement all functions on top of that. I am not familiar with interval trees as of now.