Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



I just want to inform anyone working on this that you can easily scrape the list of files that are actually available from http://zbconline.com/. You just have to change the file extension from m3u to mp3. Looks like the archive only ever goes back two weeks (ie. stuff not listed on the page apparently isn't available anymore).

Figured if I could get that and scrape the calendar data, it'd be easy enough to match it all up and offer a simple list with checkboxes and a download button, which would offer a reasonable alternative workflow. But the calendar data is offered in a way that I don't know how to scrape.

Adbot
ADBOT LOVES YOU

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



I'm looking for a script that I can paste into and trigger periodically from the task scheduler on my Synology disk station. It would collect local ip addresses and associated mac adresses from the local network it's on (including its own). This might be called the neighborhood? It would compare these pairings with previously collected ones. Any time a new pairing is found (either a new mac or an existing mac gets a new ip), I get notified of a summary of them through mail. A pairing is only discarded when a new ip is found for an existing mac, not eg. when the mac isn't found again when the script runs. Bonus points if it can have an optional config file where I can add human readable aliases for known mac adresses that then get used in the notifications.

I have some windows autoit scripting experience, but nothing linux flavor wise.

The Diskstation is on dsm 7.1.1 if that matters. A folder where scripts can put their files without needing a full path is configured. You can just echo stuff and exit with code 1 to trigger the mail when necessary.

All I have on offer for this is my profound gratitude.

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



ihafarm posted:

Why not just enable mac filtering on the router? You explicitly authorize all clients(barring mac spoofing).
Because I'm not interested in denying anything access to the network. The proper solution for my problem is actually dhcp reservations, which this isp provided router doesn't allow me to do. I also do not want to assign static ips to anything for probably no good actual reason. Everything actually works fine that way apart from one of two times a year the isp does some maintenance thing and upsets the order. I just want a notice that this has happened, instead of being baffled by the number of things suddenly not working, as well as the new addresses I need to use.

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



Volguus posted:

That router, which does DHCP, it doesn't do DNS? So that you can at least use computer names?
Or, better yet, does it have a page with the current assignments? Because if it does (it should, don't they all?), then you can just scrape the web page and autoit is more than fine for this.
I address my thermostat by ip address in order not to have to have recurring costs for their app. If it has a computer name, I've never seen it pop up. The app I use to access my satellite receiver only has a numerical field to identify it. On the receiver itself the same goes for how to mount my nas. Etc. Computer names work in other places, so that's probably yes to dns?

On windows, it's way easier than scraping: there's a nirsoft tool that can collect and export the data. The reason I don't care to do it on windows though it's that I can easily go weeks between powering up my laptop at all, while there is a linux based server running 24/7.

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



ihafarm posted:

Can you disable DHCP on the router? What is it, who’s the isp?
It's a CH7465LG-TN provided by Telenet, the only broadband provider I have access to in this part of Belgium. DHCP cannot be disabled on the router. It also cannot be set to bridge mode or be wholly replaced with a device under my control.

Volguus posted:

One way to find out the IPs on your network from linux is to use nmap:
pre:
sudo nmap -sn 192.168.1.0/24
This assumes that 192.168.1.0/24 is your network. Change as necessary. But, since I don't have a Synology, I have no idea what that thing can run. To send email though, that's gonna be a bit more complicated, and it will depend on what provider you have. May or may not even be possible.
Nmap errors out with command not found, so I guess that's out. Both arp -a and ip neigh give me results, though it's hard to tell if they give me what I need. Arp seems to be missing a number of devices that I know are online. Ip neigh gives me a load of ipv6 addresses and statuses alongside that that would take lots of work to manually figure out if they correspond to the missing devices. Both commands I found by Googling, I don't know if they are the right thing at all. These might only be addresses that have connected to the Synology or something? In which case, poo poo, I thought that part of it would be this easy. If it's significantly more complicated, forget about it.

Email is the easiest thing in this case. The Synology takes care of it. This means if the script contains a line that says echo "Hello", the word Hello will be mailed to me, no additional code necessary. It's possible through a setting to make this email conditional to the script terminating abnormally. So if you have an if clause that contains the echo command and you add exit 1 as the last thing within the if clause, then whatever is echo'd will only be mailed if the condition for the if clause is met. I definitely wouldn't ever have asked to figure out emailing from scratch.

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



Volguus posted:

arp will only display the information that the machine knows about at that time. In time, it may get more data. Nmap actively scans all the IPs in the specified subnet, so it will get pretty much everything. In my network, `dnsmasq.leases` (my DHCP server) has 47 entries, and nmap gives me 45 hosts. I presume that is because 2 of them may be offline. "arp -a", on the other hand, only returns 6 since that's what my machine knows about at this time.

So, in order for you to get the information that you want, you have these options:

1. Get it from the DHCP server. This is the main authority, but one which can be bypassed if a computer does not use it and instead has a static IP assigned. The problem with this seems to be the "how"
2. Scan the network with nmap. This should provide the most up to date data.
3. Display the current apr cache (with "arp -a") or listen for arp traffic (tcpdump or wireshark). This, however, only provides limited information. But, if you listen for long enough time, you will get them all eventually.
Yeah, if that's the state of things, then the whole thing is scuppered by nmap being unavailable or blocked on the synology platform for some reason. Thank you all for looking into what the possibilities were.

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



Volguus posted:

That router, which does DHCP, it doesn't do DNS? So that you can at least use computer names?
Or, better yet, does it have a page with the current assignments? Because if it does (it should, don't they all?), then you can just scrape the web page and autoit is more than fine for this.
Let me just thank you again, the thing about hostnames kept fermenting in my head the whole time and I've now found an android app that gives me those for a bunch of devices on my network that the windows software wasn't aware of. Then learning that some things want you to add a .local suffix to it and some most definitely don't. I've been able to whittle down the places I need to reconfigure when ip addresses change to 1, down from 25-odd. A great success.

E: support for this on android was apparently only added in November 2021 lol

Flipperwaldt fucked around with this message at 22:05 on Mar 2, 2023

Adbot
ADBOT LOVES YOU

Flipperwaldt
Nov 11, 2011

Won't somebody think of the starving hamsters in China?



Advanced Renamer can extract time/date from a pattern in the filename and apply it to eg the file creation date.

Nirsoft Bulk File Changer can copy the file creation date to an EXIF tag.

E: if step 2 is necessary at all that is

Flipperwaldt fucked around with this message at 22:24 on Mar 14, 2023

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply