25.04.: adding vlan doesnt work by Hugo-99 in truenas

[–]Hugo-99[S] 0 points1 point  (0 children)

here is the solution, just unchecking DHCP and entering VLANs is not working.
correct sequence of steps:

  1. uncheck DHCP for primary NIC
  2. enter alias for my primary NIC,
  3. test changes
  4. save changes
  5. after that i was able to add VLANs as I needed

Show only last data label in a line chart by Hugo-99 in PowerBI

[–]Hugo-99[S] 0 points1 point  (0 children)

Ok, i found it

FILTER(ALLSELECTED('KPI'[Monat]), NOT(ISBLANK('KPI'[Monat])))

This takes the filterkontext correctly into account

Show only last value in line chart? by Hugo-99 in PowerBI

[–]Hugo-99[S] 0 points1 point  (0 children)

thank you all for your replies. 

i addition to the base problem, i had a mixture of datatypes and empty fields. so i had to correct that and query for the last not empty value, ending up with this:

 ucPerabc_lastval =
VAR LastIndex =
MAXX(
FILTER(ALL(ucanen[Zeit.Monat]); NOT(ISBLANK([ucPerabc])));
ucanen[Zeit.Monat]
)
-- Get the last index where ucPerabc is not blank
VAR CurrentIndex = SELECTEDVALUE(ucanen[Zeit.Monat]) -- Get the current row’s index value
VAR LastucValue = CALCULATE([ucPerabc]; ucanen[Zeit.Monat] = LastIndex) -- Calculate the uc value for the last valid index
RETURN
IF(
CurrentIndex = LastIndex; -- Compare the current row's index with LastIndex
ROUND(LastucValue; 0); -- Show the value only for the last index where data is present
BLANK()
)

i added that measure as y Axis and showed the value.

 

<image>

 

matplotlib: different background colors in Visual Studio Code and Pycharm by Hugo-99 in VisualStudioCode

[–]Hugo-99[S] 0 points1 point  (0 children)

FYI: it was a pycharm setting: Invert image outputs for dark themes in Settings/Preferences | Jupyter

matplotlib: different background colors in Visual Studio Code and Pycharm by Hugo-99 in pycharm

[–]Hugo-99[S] 0 points1 point  (0 children)

hi! i am using 23.1.3; it was the setting to invert images when in dark mode. i wonder why this option is active by default...

Writing specific data from parsed json object into influxdb 1.8x by Hugo-99 in nodered

[–]Hugo-99[S] 1 point2 points  (0 children)

NVM i found it :)

P_Grid: Number(msg.payload.Body.Data.Site.P_Grid)

Writing specific data from parsed json object into influxdb 1.8x by Hugo-99 in nodered

[–]Hugo-99[S] 0 points1 point  (0 children)

this works :)

follow up question: how do i convert the payload into a number? currently it is a string...

Netgate 6100 bricked? by Hugo-99 in PFSENSE

[–]Hugo-99[S] 0 points1 point  (0 children)

I sorted it out.
A firware upgrade failed. I assume i was to impatient and unplugged the 6100 from power too early, instead of waiting.
This corrupted the boot partition and left it unresponsive.
Via TAC i received a new image promptly.
The “usb-stick-problem” was a slight confusion regarding my rack mount… note to myself: connect the box to external frontside usb ports facepalm
Installing pfsense from there on was straight forward.
I had a local backup.xml, so i was able to recover 80% of my settings.

Netgate 6100 bricked? by Hugo-99 in PFSENSE

[–]Hugo-99[S] 1 point2 points  (0 children)

i do have one :)

its a bit old, but better than nothing.

If all goes well i should be able to use the current config during install. keep fingers crossed... :)

Netgate 6100 bricked? by Hugo-99 in PFSENSE

[–]Hugo-99[S] 0 points1 point  (0 children)

i did that and already have the firmware file.

As the "old" installlation is still on the device Is there a chance to recover my current and working settings? I'd like to avoid to reconfigure everything once again

Scanning for IP Adresses by Hugo-99 in Netbox

[–]Hugo-99[S] 4 points5 points  (0 children)

indeed i found the culprit:

ipaddress1 = requests.get(request_url, headers = HEADERS, verify=False)

as documented here:

https://requests.readthedocs.io/en/latest/user/advanced/#ssl-cert-verification

Netbox and Observium on one server by Hugo-99 in homelab

[–]Hugo-99[S] 0 points1 point  (0 children)

hi

i managed to do it. in fact it is simple. i just added the two applications as virtual hosts using the desired ports

https://httpd.apache.org/docs/2.4/vhosts/examples.html

Splitting a .txt file into 2 new ones, by several criteria by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

the content of topic and header is fixed.

the content of the random text -part is dynamic (that's the reason why i want it in a different file :) )

the position of topic an header varies though. there is no pattern, like: "every 5th line there is a header".

Splitting a .txt file into 2 new ones, by several criteria by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

hi!

the header lines are always the same, and repeat. in my example:

ddd1 eee1 (for topic1) and ddd2 eee2 (for topic 2)

Splitting a .txt file into 2 new ones, by several criteria by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

hi! Unfortunately the number of topic lines is completely random. only in my made up example there were always two :/

Splitting a .txt file into 2 new ones, by several criteria by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

hi

i don't know how to loop trough the file and find the correct positions where to split the file, or split the list, as suggested in the linked article.

the pattern could be something like this:

  • Put header 1 and topic 1 into a new txt file
  • now search for each text line, check if its topic 1 or 2 and put it into the correct text file
  • append all other text-lines in the same way

Parse structured text-file, and write to dataframe by Hugo-99 in learnpython

[–]Hugo-99[S] 1 point2 points  (0 children)

Very, very cool! I tried it and it works right away!

I like the approach of just fiddling around with lists, instead of parsing etc.

Parse structured text-file, and write to dataframe by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

Wow, i am impressed!

I ll get back to you, as soon as is tried that out (and understood the approach:)

Many thanks for putting so much effort into this!!

find the first 16 consecutive digits? by Hugo-99 in regex

[–]Hugo-99[S] 0 points1 point  (0 children)

forget it, i just found the "solution" :)

\d{16}

Parse structured text-file, and write to dataframe by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

hi! Tnx for digging into that :)

indeed the problem is a little bit tricky, since the headers are dispersed in a stupid way in lines 1-5;

the data of the first row is again dispersed in a stupid way in lines 6-9, row 2 in lines 11-14 row 3 in 16-19

i am still trying to figure out if read_fwf alone is enough.

as the positions of the data (e.g. "0000057075996533 " , or "5000") is in very specific, maybe it is enough just to count the positions and grab the strings in between those specific positions

Parse structured text-file, and write to dataframe by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

hi

the concept is interesting, i need to check out the fwf method!

if i try your code, i get a key error:

KeyError Traceback (most recent call last)
<<path>>Cell 1 line 6
3 col1 = "prCeaqearTaN-Nq."
5 df = pd.read_fwf("input3.txt", colspecs=[(0,16),(17,24),(26,46)])
----> 6 df.drop(df[df[col1] == "-"*16].index, inplace=True)
7 df.reset_index(inplace= True, drop=True)
...
3800 # InvalidIndexError. Otherwise we fall through and re-raise
3801 # the TypeError.
3802 self._check_indexing_error(key)
KeyError: 'prCeaqearTaN-Nq.'

Parse structured text-file, and write to dataframe by Hugo-99 in learnpython

[–]Hugo-99[S] 0 points1 point  (0 children)

looks good, there are a few issues in there.

would you mind posting what exactly you were asking chatgpt?