Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
You are on a server and all of a sudden you need your public IP address. You can do it using cURL and terminal:
$ curl ifconfig.co
142.17.150.17

The website will just spit out the IP address with no bullshit around it! It is more specifically used by sysadmins.

#linux #sysadmin #curl #ifconfig #ifconfigco
View open ports without netstat or other tool:
# Get all open ports in hex format
declare -a open_ports=($(cat /proc/net/tcp | grep -v "local_address" | awk '{ print $2 }' | cut -d':' -f2))
# Show all open ports and decode hex to dec
for port in ${open_ports[*]}; do echo $((0x${port})); done


#linux #ports #netstat #tcp #open_ports #sysadmin