Generate a random number between 1 and 10000, then use printf to convert it to hexadecimal, then ping google.com and print the last line of the output.
shuf -i 1-10000 -n 1 | xargs -I {} printf 'printf "%x" {}; ping -w1 google.com' | bash | tail -1