Best TCP port number range for internal applications [closed]

I decided to download the assigned port numbers from IANA, filter out the used ports, and sort each “Unassigned” range in order of most ports available, descending. This did not work, since the csv file has ranges marked as “Unassigned” that overlap other port number reservations. I manually expanded the ranges of assigned port numbers, … Read more

How can I check if an ip is in a network in Python?

Using ipaddress (in the stdlib since 3.3, at PyPi for 2.6/2.7): >>> import ipaddress >>> ipaddress.ip_address(‘192.168.0.1’) in ipaddress.ip_network(‘192.168.0.0/24′) True If you want to evaluate a lot of IP addresses this way, you’ll probably want to calculate the netmask upfront, like n = ipaddress.ip_network(‘192.0.0.0/16’) netw = int(n.network_address) mask = int(n.netmask) Then, for each address, calculate the … Read more

Getting MAC Address

Python 2.5 includes an uuid implementation which (in at least one version) needs the mac address. You can import the mac finding function into your own code easily: from uuid import getnode as get_mac mac = get_mac() The return value is the mac address as 48 bit integer.

Find UNC path of a network drive?

In Windows, if you have mapped network drives and you don’t know the UNC path for them, you can start a command prompt (Start → Run → cmd.exe) and use the net use command to list your mapped drives and their UNC paths: C:\>net use New connections will be remembered. Status Local Remote Network ——————————————————————————- … Read more

Wireshark localhost traffic capture [closed]

If you’re using Windows it’s not possible – read below. You can use the local address of your machine instead and then you’ll be able to capture stuff. See CaptureSetup/Loopback. Summary: you can capture on the loopback interface on Linux, on various BSDs including Mac OS X, and on Digital/Tru64 UNIX, and you might be … Read more

Are parallel calls to send/recv on the same socket valid?

POSIX defines send/recv as atomic operations, so assuming you’re talking about POSIX send/recv then yes, you can call them simultaneously from multiple threads and things will work. This doesn’t necessarily mean that they’ll be executed in parallel — in the case of multiple sends, the second will likely block until the first completes. You probably … Read more

iPhone Simulator – Simulate a slow connection?

How to install Apple’s Network Link Conditioner These instructions current as of October 2019. Warning: If you just upgraded to new version of macOS, make sure you install the very latest Network Conditioner (in Additional Tools for Xcode) or it may silently fail; that is, you will turn it on but it won’t throttle anything … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)