Guest User

fix_undo_telemetry.sh

a guest
Jul 23rd, 2022
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. # mobile.events.data.microsoft.com
  2. # vortex.data.microsoft.com
  3. TELEMETRY_URLS="[^/]+\.data\.microsoft\.com"
  4. REPLACEMENT="s/${TELEMETRY_URLS}/0\.0\.0\.0/g"
  5.  
  6. debug() {
  7. d1=`perl -MTime::HiRes=time -e 'printf "%.5f\n", time'`
  8.  
  9. sed -i -E "${REPLACEMENT}" ${1}
  10.  
  11. d2=`perl -MTime::HiRes=time -e 'printf "%.5f\n", time'`
  12.  
  13. echo "found: ${1} ($( du -h ${1} | cut -f1 )) $( echo "($d2 - $d1) * 1000" | bc )ms"
  14. }
  15.  
  16. export -f debug
  17.  
  18. d1=`perl -MTime::HiRes=time -e 'printf "%.5f\n", time'`
  19. grep -rl --exclude-dir=.git -E "${TELEMETRY_URLS}" . | xargs -I {} bash -c 'debug "$@"' _ {}
  20. d2=`perl -MTime::HiRes=time -e 'printf "%.5f\n", time'`
  21.  
  22. echo "undo_telemetry: $( echo "$d2 - $d1" | bc )s"
Advertisement
Add Comment
Please, Sign In to add comment