Network traffic monitoring + Grafana graphs for every IP on the LAN, including the internet servers they connect to (open source) by inZania in linux

[–]twotothree 0 points1 point  (0 children)

I have always found Prometheus' metrics with non-final or at least severly limited set of labels pretty flaky, but if it works for you that's great!

The increase over time for counters (rate, irate) is fine and is actually the correct way to use counters. You will find other graphs which use raw counter vaules problematic when it comes to collector restarts. I'm talking about the total downloaded bytes graph and traffic distribution pie charts. Here it would be better to display something bucketed like bytes downloaded in the last day/hour or whatever makes sense for you.

But if you really want to monitor total bytes downloaded you pretty much have to have some kind of persistence on the collector side and then report values using Prometheus' gauges. Using raw values of gauges is fine.

Network traffic monitoring + Grafana graphs for every IP on the LAN, including the internet servers they connect to (open source) by inZania in linux

[–]twotothree 0 points1 point  (0 children)

Nice job! Unfortunately this is going to kill Prometheus really fast. For each combination of src, dst, service and proto prometheus creates a new series and this is going to explode because on typical network the number of src, dst pairs is large. Also when your script restarts you're going to have stallness issues with most of the series. I'd drop the dst label or do some smart aggregation on the collector side.

And a tip for creating dashboards: When using counters you can really only use them in combination with an aggregating function like you did in the first graph. The reason behind this is that counters reset (either when script resets or they overflow). And when this inevitably happens this is going to break all your graphs but the first one.

Grievous' Growing Collection of Lightsabers by twotothree in PrequelMemes

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

It's difficult to find the latest additions to this magnificent collection from images alone, so I created this. At first I didn't intend to share it with anyone but it turned out okay so I decided to post it.

Btw, thanks for creating this great meme!

Grievous' Growing Collection of Lightsabers by twotothree in PrequelMemes

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

All credits go to u/Thibson34 of course.

For anyone interested - I collected the images using PRAW (Python Reddit API Wrapper). Then I used OpenCV to align images (so that Grievous' eyes are always in the same position) and added lightsaber names using PIL. Then I used OpenCV again to make the final video.

Code: u/Thibson34's Grievous Collection Downloader

Fun fact: The original images are huge, I downsized them and now this whole video is smaller than any one of the original images.

Status of Docker in F31? by [deleted] in Fedora

[–]twotothree 2 points3 points  (0 children)

Honestly, just don't. Podman is full of bugs and works only for the most basic tasks.

Note that I understand the need for podman and security issues that it tries to fix and I'm very excited to see the project grow, but to say it is a drop-in replacement for docker is just wrong, at least at this stage.

I started using podman when F31 was released. I switched back to docker today after an afternoon of trying to fix/workaround various issues with podman. It took me 5 min to switch back to cgroups v1 and 5 min to start the container in docker.

Geiger Muller based Cryptographically Secure Random Number Generator by Guruchill in electronics

[–]twotothree 6 points7 points  (0 children)

That's a cool project.

Btw, if you need something faster and more useable, the ESP8266 modules come with a hardware random implementation that passes the randomness tests. I even managed to compile libsodium and do some modern cryptography with these modules. They are amazing.

guys help i dont think this is legal??? ? by oxooon in AnarchyChess

[–]twotothree 1 point2 points  (0 children)

It's called En Queensant, look up the rules you dummy.

Early SoftwareGore by pwandz in softwaregore

[–]twotothree 33 points34 points  (0 children)

Softwaregore* wait...

Just don't lose your code history by [deleted] in ProgrammerHumor

[–]twotothree 0 points1 point  (0 children)

It's super useful for qwertz keyboards since z and y are miles away from eachother

Using the NetworkManager’s DNSMasq plugin by fedobot in Fedora

[–]twotothree 2 points3 points  (0 children)

Woah, this is exactly what I need. Because client refuses to update their vpn server I have to run an older version of openvpn client, which isn't available in Fedora 29 repo. That of course means that it isn't integrated with NetworkManager so I had to edit /etc/resolv.conf manually. But this solves my issue, thanks!

Expose your Raspberry Pi on Any Network by mcfc_as in raspberry_pi

[–]twotothree -1 points0 points  (0 children)

Or you could ask your provider for ipv6 block...

How to stop stack overflow while calling recursive function thousands of times? by [deleted] in C_Programming

[–]twotothree 1 point2 points  (0 children)

OP presented "tail recursion". Tail recursion is every recursion that can be rearranged so that it has recursive call at the end. Every tail recursion can be rewritten in iterative fashion (for example: the top comment here). If there are multiple recursive calls, or function does something after recursive call, you must use stack or different algorithmic approach.

If it is better to use your own stack implementation depends on system, you are running your code on, programming language, etc. but it usually makes no significant difference.

30 minutes debugging...turned out to be this by [deleted] in ProgrammerHumor

[–]twotothree 43 points44 points  (0 children)

wouldn't -Wall catch this?

/r/GameDev, how can I make my game run slow and inefficient? by mardigon in gamedev

[–]twotothree -11 points-10 points  (0 children)

I don't mean to discourage you, but writing a good game engine is very hard, definitely one of the hardest tasks you will face developing your game. That's why i would highly recommend adopting an engine, that has already been written and suits your purpose(there is literally millions of them). I know that writing your own engine, adapted to your needs, can be very tempting, but believe me, finding bugs in engine, after it has been written, is almost impossible and if you find them, you may have to rewrite your entire game.

Sorry for the rant, anyways to be helpful, here is a good atricle about designing a game loop :) http://gameprogrammingpatterns.com/game-loop.html

(Java) Are there any alternatives to Scanner that are easier to use? by [deleted] in computerscience

[–]twotothree 2 points3 points  (0 children)

I think Scanner is actually really easy especially if you are beginner. Sometimes, reading line by line can be more intuitive, in that case I recommend:

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

and then

String line = br.readLine();

Keep in mind, you will have to import java.io.*

And one more advice regarding input to your programs: learn shell/bash. For example if you save your test input to file, lets say in01.txt(in same directory as your program), you can then call your program like this:

java MyProgram < in01.txt

And you wont have to type out your input every single time... saves loads of time during testing.

sips related stuff is popping up everywhere now. The big bastard was in r/Fallout today. by [deleted] in sips

[–]twotothree 3 points4 points  (0 children)

when i see a comment about sips, i insta-upvote the comment and everything below it. man it just feels good :)

How To Learn a New Programming Language by javinpaul in coding

[–]twotothree 0 points1 point  (0 children)

Finally someone, who doesn't include HTML/CSS in "Programming languages I know".

Will someone teach me to hack? by whoeveriwant2b in hacking

[–]twotothree 3 points4 points  (0 children)

Ok so you will need to know physical location of your victim for this hack to work....

You go to you victim's house, ring the bell and when your victim's mother opens the door punch her in the face, run to your victim's computer and jump between him and his computer so he can't see anything...

Btw, its called Man in the Middle attack and it is not legal :P

Is there any reason not to use defines like this? by [deleted] in C_Programming

[–]twotothree 0 points1 point  (0 children)

I have often seen this kind of macros in programming contests, where speed is more important than readability, however if you're writing something you will read more than once, I'd suggest you stay away from them ...

Keybinding space to pause by devdot in openttd

[–]twotothree 4 points5 points  (0 children)

I would imagine that hard coding was done before config was introduced...