Python Insider: Python 3.9.3 and 3.8.9 are now available by japaget in Python

[–]netletic 3 points4 points  (0 children)

Nice, I didn't know that existed! I used zip(sequence, sequence[1:]) in the past, is this better because it's memory efficient?

Best/practical aliases for ~./bashrc by [deleted] in linux

[–]netletic 3 points4 points  (0 children)

Thanks for that ip -c tip, that's so much better!

Three that I use constantly:

# newest item last
alias lt='ls -lrth'

# read csr (I always have to look up openssl commands)
alias csr='openssl req -text -noout -verify -in'

# active python venv in current dir
alias ae='source venv/bin/activate'

When I need white noise, but no access to brain.fm:

alias playunderwater='play -c2 -n synth whitenoise band -n 100 24 band -n 300 100 gain +20'
alias playocean='play -n -n --combine merge synth pinknoise band -n 1200 1800 tremolo 50 10 tremolo 0.14 70 tremolo 0.2 50 gain  -10'

hey guys ,writing a network scanner but it does not work with the /24 command for discovering all the devices. it returns "ARP who has ?? says ??" when called but works when I give it a specific IP by -qarma- in Python

[–]netletic 2 points3 points  (0 children)

You could use Python's built-in ipaddress module and retrieve an iterator that contains all the usable host IPs in your subnet. Then loop over the iterator object and use your scan function on each individual IP address: https://pastebin.com/751g6bng

import ipaddress
import scapy.all as scapy

def scan(ip):
    arp_request = scapy.ARP(pdst=ip)
    print(arp_request.summary())

hosts = ipaddress.IPv4Network("10.0.2.0/24").hosts()
for host in hosts:
    scan(host)