Skip to content

Instantly share code, notes, and snippets.

@LincDavis
Last active July 3, 2023 06:05
Show Gist options
  • Save LincDavis/5b7971cc847dc5ca8d2d1b86dc369a02 to your computer and use it in GitHub Desktop.
Save LincDavis/5b7971cc847dc5ca8d2d1b86dc369a02 to your computer and use it in GitHub Desktop.
Diagnostic script
#! /bin/ksh
# This script copyrighted (C) 2014-2018 by Linc Davis. All rights reserved.
PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/libexec;IFS=$' \t';LC_ALL=C;TERM=xterm-256color;TMPDIR=`getconf DARWIN_USER_TEMP_DIR`;eval HOME=~$USER;unset BLOCKSIZE COLUMNS DYLD_INSERT_LIBRARIES DYLD_LIBRARY_PATH FIGNORE FPATH HISTFILE LD_LIBRARY_PATH TMOUT;stty -echo;printf $'\e[8;16;55t\e]2;Diagnostic Script \xc2\xa9 2014-2018 Linc Davis\a';osascript -lJavaScript -e ' w=Application("Terminal").windows[0];w.backgroundColor="black";w.normalTextColor="black";w.cursorColor="yellow";w.fontSize=14;';clear;p=(1904 20 51 0.2 8 10 25 9215 1.0 1000 25 1536 400 40 500 300 85 20 2.0 262144 20 2000 524288 604800 5 1024 25 10 10 8 10 $(printf '%.2s' `uname -r`) 1800 `sysctl -n hw.logicalcpu` 16 `id -u` 10 (3360141552 2033013220 174611125 188739418 2052836284 1075906481 3825718575 2300025090 1148937583 998162157 251475945 682956541 927568548 820662417 4241232455 1991908505 3842510280 3977296738 308326518 734968811 2881593577 3505613185 2011804606 2744472450 2096931782 2744923784 1633899514 3906210243 2889776626 2760600606 2995622555 2897718090 4139467666 1700120144 1051611322 1648728658 3324257250 611182208 669172048 3840699747 47378461 1563668620 1913010178 21614981 3317727426 2804616813 3023133321 2454547884 3875065669 1414269023 2146742307 2986938149 143180065 35978667 3750893214 4057397868 3217312339 4094747275 510902573 3402409903 1854863555 3303202798 3980761837 3615694239 3315417941 658259764 3919897779 3099425515 2201853850 3963940199 2306272388 2666586405 3421663691 3618000133 4294043818 3684872501 2190268618 2011084572 111903873 1771548258 3412733082 3764591419 3536604875 1626810686 726997059 3089972979 965789760 1958045828 3601961299 3939321264 3390509433 24440299 1111943634 1502939913 903507633 2755255132 1013713749 3639955287 2653384246 3427341633 133031465 1402503255 2460335390 4010722210 3330289254 607533800 3603030264 375162695 953534657 3694511832 3390880884 3550734337 3284111723 4260352026 1679316479 2193208314 1235694912 1932720162 409973292 4248580396 1981779047 1805964115 3792832809 3727397485 3318920532 1310215028 1921181810 109105900 3376821650 3318818604 859499809 605316200 1020536223 3232581519 2334349229 3067551913 3018700574 2041093625 2733568428 2496133483 4094528007 4160453711 3082177689 2503580807 2323930572 2930526215 3399450297 1164775004 3637272653 777649792 1353210385 3836345965 2746485114 1601103986 2981603713 521823316 1561159557 2673555063 4033778457 746170378 2643404996 1149243300 995083354 1226672687 667378382 4075192329 3670276510 3299216348 1841055884 1090485649 1605549829 1084088435 2473644975 952526793 656959714 3245077171 3841016027 2912631181 2083559019 3625461743 3021245439 2363960837 4044216846 437388889 1623908994 1009358836 3828686270 942988028 3778080291 879166715 1147404123 2490917226 3071778363 4048689778 2910635962 2613535613 4183900114 2480451690 3191974903 72090863 1320861637 279338563 4000659386 2530979426 1401247618 3085096083 3154333685 2403725682 908491363 1133891987 3664989557 154149346 3824050961 1047645429 2982761435 3957991969 2216136891 3822954955 3889851778 279962554 2239586183 2932934162 1847442617 34515999 3642087926 692420124 4058791145 3808851459 1571458668 1089636345 2385449540 2199169857 81546269 2606994792 1247174099 4055043500 1799611813 373980237 1729475163 243488571 2048819260 3099290484 1650054758 3579750759 818650142 3522950681 895363712 191606943 4191044848 1291963638 4016216329 309312656 3361115350 3511182577 2678676874 466132960 1510440764 103947945 993525156 2357654692 3872124609 2300510951 1510257042 1667743738 3423649941 2286523815 2803700861 581561683 2746466359 3034899150 638239040 3435471484 2059092204 1082780527 1399319867 3524949524 1602298225 2925575065 757530713 1771807727 2031034526 2146074145 1936967685 3795794146 2714102141 1527865465 3658106393 3525286124 3672779027 3057036944 830855136 4097629469 2923812917 1275574132 783155124 4264016201 2629234589 1667978496 1730703540 3346339634 970976212 563662987 3575663622 2391839691 43590648 2698791206 812399490 2837236935 60232629 1294495927 2187358862 1544118669 554121294 175350128 162057097 3619415585 2435252211 1879881542 222376568 2557256990 1427870910 1250418571 3302541514 192352240 3025797930 3315736960 4181926529 2335868048 410105640 1002221603 218699348 2347181717 694425604 4102434062 37428618 2772845580 2597194616 2818525868 3563183488 3430552430 499617068 3273779524 1675014494 1660706593 480771255 3614264283 3893609370 98896710 2641293985 2735844738 1890084998 380615393 3850840404 4186869406 2298499089 3180363661 2611538906 4138006483 1116499364 832753319 255310038 2370683383 36195354 1829596129 1135082786 2083544424 1397255543 1390569062 1642482820 2400572721 2949765037 1708953511 94571169 218059987 3595733975 4294891786 1844733751 3170712884 3059014601 3484139038 1881294995 3500075558 3127607528 1187806771 4138747940 2460954868 3464490505 4029921598 894565306 1919121011 1855642237 892418881 3499366086 4289653325 334581144 2682286546 701237231 2570364875 2099443919 1647964433 1536968318 58788461 2767303772 4016108568 2609326102 2258414072 1101479640 481885922 1212066722 1707241580 307213054 1752720279 1095494074 105738869 3466807010 724646769 3635771575 292052159 2442914445 2190055897 3881734947 3728923944 678313962 1281867281 4124236870 53825452 3134941737 4221292522 2183746256 1851932188 2124784392 2610664747 2802793776 421375160 3678937970 4216468613 1461490543 2134391578 4000930051 3212667125 3340218596 1589673643 169074047 1592850892 3788370612 330681270 2681289265 508171720 1243383339 2296390983 3165327857 2602661277 1756522027 813996801 3173080548 1168694724 3357201488 1572624117 3411359730 1185058867 2901309563 2004875112 2263381375 3233018571 556927970 4284229805 49922936 1965271970 3157155693 3626643960 528403615 2635146989 4259220271 3489871515 2929571840 2046350318 974055863 1374785742 537108324 2897716880 4288990193 481821500 2618031204 3910634755 2910240653 4084518825 4161022133 449733927 1928962746 4146097030 2967598643 3519293137 3039233234 3664723109 1268920403 2082334690 3349991298 1955057613 3609918069 836203353 2076129053 ) (879294308 4071182229 461455494 3953060756 216630318 2254479735 364192525 2331732828 2427690278 3361796797 3887726299 930028549 2830975514 3627668074 1083382502 1274181950 394731943 3038793022 1855907737 3469280363 2758863019 1565429098 2707474481 3668832669 200870336 1848501757 464843899 3694147963 1315979676 1781640753 1293284965 398441049 2636415542 3445643597 941105980 137249019 1233118628 2456546649 2806998573 2778718105 2370036484 77112498 842973933 544941381 1995816654 3743051555 3691224471 1770634273 2824893286 3730953884 495358405 710721696 3142704480 290641261 3867330796 1383871077 1501830148 1591517921 676087606 827728504 1445213025 2051385900 627108361 821485203 2810021953 891421492 3545718986 1726226152 2045352620 1862971771 2428299547 3343799110 796956247 4139687208 1503053263 3301885676 891055588 77374180 1866638499 95484570 3424434743 930719081 3423398678 3051698494 998894468 1071658030 1121431055 1698653368 695903914 3829477473 1443423563 4136085286 354022165 483910120 199883012 3374894509 3555256303 1051159591 1581764341 1602219417 2033408783 2573594465 2857725553 132335822 892310726 2176602139 2384203231 2466887275 3242354755 3825896858 3936987127 4145709178 1322107948 1506521430 1666586439 1707497389 2423513700 2586050363 50854030 643960326 1116988227 1894334785 1240520345 3234353297 523110921 2883943871 2451978492 3873345487 ) (KiB/s{,,,,,,,} relative{,} ms/s{,,,,} % total{,} MB /s{,,,} ) ({{Net,I/O}\ {in,out},Energy\ impact,{G,C}PU\ usage},\ {lifetime,sampled} I/O\ latency CPU\ usage Open\ files Mach\ ports Memory File\ opens Forks{,', 'failed} System\ errors ) (50{,} 25{,} 1000{,,,} 15{,} 100{,} 150{,} 25 15 5120 25000 1000 5 1 0 100 ) ({Soft,Hard}ware Memory Diagnostics Power FireWire Thunderbolt USB SPI Bluetooth SerialATA Extensions Applications Frameworks PrefPane NVMe Displays PCI UniversalAccess InstallHistory ConfigurationProfile AirPort Storage ManagedClient Fonts WWAN ) 6);k=($'\xe2\x9f\xb6\x20' NA '^_d|AES|atr|udit|mdmc|mrt|msa|dnse|ax|ensh|fami|FileS|fing|ft[pw]|gedC|kdu|etS|is\.|alk|ODSA|otp|htt|pace|pcas|ps-lp|rexe|rlo|rsh|smb|snm|teln|upd-[aw]|uuc|vix|webf' Enabled ServiceID "`IFS=:;echo "${p[39][*]}"`" "`IFS=:;echo "${p[40][*]}"`" '^_d|llag|tostr|tsA|[ST]M[HL]' kMDItem 'com\.apple\.' "\n\t\e[97mPassword entry declined or failed. Continuing\xe2\x80\xa6" {~,}/Library/Preferences/ {Info\\,MobileMeAccounts,loginwindow,.GlobalPreferences}.plist Network\ {home,directory} FileVault spindump 'n cause: -' '(: data und|O |gnment |tfs returned )err|jnl: |disk.+(abo|: (med|res))' 'USBF:.+bus' 'HFS|IO((ATA|Fi|NV|PC|Sto|Th).*F|USBM).+' 'PRAGMA database_list;PRAGMA quick_check(1);' '/{var/db/r,S*/*/R}*/com.apple.*.{BS,Bas,Core[AF],Es,J,Mob,OSXU,Rem,ful,up}*.bom' '(IOCo|.+lling_).+|:' PlistBuddy\ -c $'\x20\xe2\x96\xb9\x20' "\n\e[?25l\e[4C\eH\e[97mThank you for running this diagnostic test.\n\n\tYou're logged in as a standard user, not as an\n\tadministrator. Some parts of the test will not\n\trun. To run the full test, log in as an admin-\n\tistrator.\n\n\tTo abort the test, just close this window.\n\n\tPlease press any key to continue." '.*/(L[^/]+/(Ca[^/]+s|A[^/]+t/A[^/]+k)|P[^/]+/[^/]+\.p[^/]+y)\$' CFBundle{Identifier,DisplayName} $'\n Diagnostic test results'"`printf \\ %.0s {1..36}`"$'https://www.lincdavis.com\n' 'AEPr|AER|oMixE|ce_dy|ddedA|jorO|Speech\.f|\.ICA|DuetA.+Conf|mobilem|nesAc|nProtob|PUC|reLig|vecL|wListS' '.+SB[FH].+' '(.*listenerC|TBT W).*' '.*(: SDXC|mount).*' $'\xe2\x80\xa6' 'emacs|libex|Temp|\/(Content|Example|SDK|Version)s\/' '\/(etc|Preferences|Launch[AD].+|San.+)\/' '^\/(Ap|Dev|Inc|.+\/Perl\/|Prev|ServerD)' '(iTu|ok).+dle$|\.(component|fs|mailbundle|mdimporter|osax|qlgenerator|saver|wdgt|(web)?plugin|xpc)$' '\/(Composition|Device|Printer|SDK|Template|SmartCardService)s\/|Library\/(Devel|Perl)|(ApplicationF|CoreD|InternetS|SystemV|WifiC|mDNSR).+\.b|(MediaB|TW|Tcl|Tk|Apple(Pro|Sau)|CoreCh).*\.f|libt[ck].*\.dy' '\.(bundle|component|dylib|framework|fs|kext|mdimporter|osax|plugin|ql[^/]+|saver|wdgt|xpc)$' 'ageT|Boot|GPUB|kext.c|mMig|nesL|oreA|Stag|TCC|tDev|Upd|WebCl' '~|\/(AFP|ntp|resolv)\.conf$' '^(AS.+ (En.+ )?text(, with v.+)?$|(Bo|PO).+ sh.+ text ex|XM)' '\.(app|backend|driver|ds|dylib|filter|framework|prefPane|tool|webplugin|xpc)$' '^ {5}|[{}()]| = [0<]|AK[DL]|dMig|dUIM|iToo|le(A[cq]|Hi|I[CD]|Lo|Te)|Mous|Nav[PS]|nOrd|NS(Aut|Lin|Pers|Tab|Use)|Scro|Spel|Sync|tiAl|Units|untr|yRep|zeOn' '(\.(appex|kext|pluginkit|wdgt|xpc)\/(Contents\/)?Info|Launch[AD].+)\.plist$' '\n ['{Timed\ out,Output\ overflow,User\ aborted}']\n' $' display notification "The test is done." with title "Diagnostic Script" ' '\.(app|bundle|dylib|framework|fs|kext|loginPlugin|prefPane|slotd|xpc)$' 'Apple Root CA' '\/App.+\/(GarageBand|Xcode)\.app\/' "\n\e[4C\eH\e[97mThank you for running this diagnostic test.\n\n\tSome parts of the test need your authorization\n\tto run. To authorize the full test, enter your\n\tpassword below. To decline, press \e[7mreturn\e[0;97m three\n\ttimes. A limited version of the test will run.\n\n\tTo abort the test, just close this window.\n\n" '.+(cann|erro|fail|unabl).+' Diagnostic\ Test '+Report %m-%d-%y %H%M.txt' :Accounts:0:Services '/L.+/(Scr.+/Templ.+\.app|Pri.+\.plugin)$' '\.(framew|lproj)|\):' 'plist:|:.+(Mach|scrip)' 'AirPortB|iBooksX|launch(d\.peruser\.[0-9]+|ctl\.(Aqua|Background|System))$' "`printf \\ %.0s {1..21}`" `printf '\xe2\x95\x90%.0s' {1..90}` o\ cha 'Co|: N' '^\.\/((usr\/)?s?bin|usr\/lib(exec)?)\/' '{,/usr}/*bin /usr/lib*' '.+(wLis.+|c\/cups)');U=('ps -c -o'{uid,comm}' -p"$NF"|sed 1d' {cksum,file\ -b,stat\ -f%{Sm,z},'iconv -c -f ascii'}' \""F"\"' 'echo \""d"\"|cksum' 'mdls -name '${k[8]}${k[32]}' \""$0"\"' "${k[28]}"\ Print{' \""F"\"','\\ :'${k[32]}' \""$0"\"/*/'${k[13]}} 'codesign -dvv \""$0"\" 2\>\&1' 'sort|tr \\\\f \\\\n' 'find /S*/L*/R* /var/db/rec* -type f -name \""$0"\".bom');f=(\\n%s{"${k[29]}",\\n\\n}%s\\n +%n$'\e[3g\e[8C\eH\e[1;96mTest started at %l:%M %p\e[97m%n%n%t\e7Status: \eH / \eH parts done at \eH sec\e[A' %s{\ ,\\n"${k[0]}"{,%s\\n"${k[0]}"{,%s\\n"${k[0]}"}}}%s\\n '\f\t'"${k[39]}"'and %d more line(s)\f' '\fContents of %s\f'"${k[0]}"'mod date: %s\f'"${k[0]}"'size (B): %d\f'"${k[0]}"'checksum: %d\f%s' '%.1f GiB: %s\n' '\e8\t\e[9'{2mDone,3m{Timed\ out,Output\ overflow}}'\e[K\n\n\t\e[97mThe test report is in the file\n\t"%s".\n\n\t\e[91mPlease close this window.\e[8m' 'I/O (MiB/s): %.1f read, %.1f written\n' "+${k[69]}${k[34]}${k[69]}%n Date${k[29]}%D${k[68]}Time${k[29]}%H:%M${k[68]}Revision${k[29]}${p[0]}%n${k[69]}%n" {'Swap space used:',{Wir,Pag}'ed memory: '}' %.1f\n' "\n Elapsed time${k[29]}%d sec\n" 'Load averages per core: %.1f, %.1f, %.1f\n' '\e8\t\t\t%3d' '\e8\t\e[92m%3d\t\e[97m%3d' 'Network (MiB/s): %.1f in, %.1f out\n');c1=(system_profiler pmset\ -g nvram fdesetup find\ -Ex atq df vm_stat 'log show --last '${p[29]}h\ -p ps crontab kextfind top pkgutil "${k[28]}" echo cksum kextstat launchctl stat sysctl\ -n defaults{,\ -currentHost}\ read lsbom mdfind\ -onlyin sqlite3 pluginkit scutil 'dtrace -q -x aggsortrev -n' security plutil awk 'dscl /Search -read' networksetup mdutil lsof test 'osascript -lJavaScript -e' netstat mdls fs_usage cat file powermetrics 'codesign 2>&1' serverinfo lpstat : diskutil mdimport ifconfig /usr/*c/*/*/e[ft]*k);s=(' 1d;s/.//;s/[0-9A-Za-z._]+@[0-9A-Za-z.]+\.[0-9A-Za-z]{2,4}/EMAIL/g;/faceb/s/(at\.)[^.]+/\1NAME/g;/Users\/Shared/!s/(\/Users\/)[0-9A-Za-z]+/\1USER/g;s/[-0-9A-Fa-f]{22,}/UUID/g;s/ [^ */]+(\.local)/ HOST\1/g;' 's/^ +//;/de: [^N]|t:|s..n:|t..n: ([^E]|.+\()/p;' '{ sub(/^ +/,"") } $1~/^[BMT]/&&/[nrs]:/;$1~/^P/&&$2~/N/&&$3!~/^I/;$1~/^Se/&&$3~/sy/&&$4!~/^[0-9CDFGHJKLMNPQRSTVWXY]{11,12}$/{$4="[invalid]";print } /y:/&&$2<'${p[4]} ' s/:$//;2,6d;/[my].+:/d;s/^ {4}//;H;${g;s/\n$//;/s: (E[^m]|[^EO])|x([^08]|02[^F]|8[^0])/p; }' '1,2d;s/^ {4}//;s/:$//;/^ V/!H;${g;s/\n\n$//;/F|\): .+[1-9]/p; };' '($1~/^Cy/&&$3>'${p[9]}')||($1~/^Cond/&&$2!~/^N/)' 's/^ {8}//g;/:$/{ N;/: .+: /d;s/ *://;b0'$'\n'' };/^ *(V.+ [0N]|Man).+ /{ s/ 0x.... +/ /;s/[()]//g;s/(.+: )(.+)/ (\2)/;H; };/^ *Built-In:/H;$b0'$'\n'' d;:0'$'\n'' x;/\n *Built-In: +Y/d;s/\n\n//;/^ *(Apple.{29}|Port|T.{11}Bus( [0-2])?) \(/d;s/\n.*//;s/ /'$'\xe2\x80\x95''/g;/^[0-9A-Za-z]/!s/[0-9A-Za-z]/ &/;/\)$/p;' 's/^.*C/C/;H;${g;/: N.+: N/!p; };' '1!s/- (.+) = ([^GO].+)$/\1: \2/p' '{ $1="" } 1' '/f\.$/q;$s/^.+On\.$/On/;p' 'BEGIN{FS="\f";d="^'"${k[9]}${k[67]}"'" } { if($2~/[1-9]/) printf "'"${f[4]}"'",$1,"status: "$2;else if(!d||$1!~d) print $1 }' '$1>1 { $NF=$NF" x"$1 } /\*/{if(!f) f="\n\t* Code injection" } { $1="" } 1;END{print f }' 'NR==2&&$4<='${p[7]}' { print $4 }' 'BEGIN{FS=":" } $1~"wir"&&$2>'${p[22]}' { printf "'"${f[16]}"'",$2/2^18 } $1~/P.+ts/&&$2>'${p[19]}' { printf "'"${f[17]}"'",$2/2^18 } ' " /${k[44]}/d;/${k[45]}|${k[51]}/p " ' { q=$1;$1="";u=$NF;$NF="";gsub(/ +$/,"");print q"\f"$0"\f"u }' '/^ {6}[^ ]/d;s/:$//;/([^ey]|[^n]e):/d;/e: Y/d;s/: Y.+//g;H;${g;s/ \n (\n)/\1/g;s/\n +(M[^ ]+)[ -~]+/ (\1)/;s/\n$//;/( {8}[^ ].*){2,}/p; }' 's:^:/:p;' '!/, .+:/{print;n++ } END{if(n<'{${p[12]},${p[13]}}') printf "^'"${k[9]}"'.+" }' '|uniq' '1;END{print "'"${k[64]}"'";if(NR<'${p[14]}') print "^/[Sp].+|'${k[9]}'";split("'"${p[38][*]}"'",c);for(i in c) print "\t"c[i]"$" }' '1;END{print "'"${k[64]}"'";if(NR<'${p[21]}') print "^/[Sp].+|'${k[9]}'" } ' " /${k[65]}/d;/${k[66]}/s/:.+//p " '&&echo Yes' '>&-||echo No' '/\.dylib$/p ' /{"${k[41]}","${k[72]}"}/s/\.//p /"${k[46]}"/\!p ' /#:|[-0-9A-F]{36}/!p ' " /${k[45]}/p " ' { print $3"\t"$1 } ' $' s/\\\t.+//p' 's/1/On/p' '/Prox.+: [^0]/p' '$2>'${p[2]}' { $2=$2-1;print }' 'function f(x) { y=a[split(x,a,"/")];if(y~/B$/) y=0;if(y~/K$/) y=int(y)/1024;if(y~/M$/) y=int(y);if(y~/G$/) y=int(y)*1024;return y } BEGIN{M1='${p[16]}';M2='${p[18]}';M3='${p[8]}';M4='${p[3]}';N='${p[33]}' } NR==14&&($3>N||$4>N||$5>N) { sub(/$/," (per core)");for(n=3;n<6;n++) $n=$n/N;printf "'"${f[19]}"'",$3,$4,$5 } NR==15&&int($7)<M1;NR==19 { i=f($3)/10;o=f($5)/10;if(i>M3||o>M4) printf "'"${f[22]}"'",i,o } NR==20 { r=f($2)/10;w=f($4)/10;if(r>M2||w>M2) printf "'"${f[13]}"'",r,w }' '/r\[[0-9]+\] /{if($3~":") next;if($3!~/^1(0|72\.(1[6-9]|2[0-9]|3[0-1])|92\.168)\./) print $3;exit }' '!/^T/{printf "(static)";exit }' 'BEGIN{FS="\f" } $1&&$2 { printf "'"${f[4]}"'",$1,$2 }' 'NR==1&&!/:/&&!/^D/;(/k:/&&$3!~/(255\.){3}0/)||(/v6:/&&$2!~/A/)' 'BEGIN{FS=": " } $1~"S"&&$2~/Of|N/{print $2;exit } $1~"Ot" { exit } !/^ {14}[^ ]/{next } ($1~"Ne"&&$2!~/^In/)||($1~"T"&&$2<'${p[20]}')||($1~"Se"&&$2!~"2") { print } $1~"Si" { if(a[2]) next;split($2,a," ");if(a[1]-a[4]<'${p[5]}') print }' 'BEGIN{FS="\f" } { sub(/_[0-9]+\.'${k[20]}'\.txt$/,"\.'${k[20]}'",$3);sub(/^.*\//,"",$3);n=split($3,a,".");sub(/_2[01].+/,"",$3);print $2" "$3" "a[n]$1 }' 'BEGIN{split("'"${p[41][*]}"'",m);FS="\f";M=2^10 } $1<9 { $2=int(($2+M/2)/M) } $2<=m[$1] { next } $1<15&&$3!="kernel_task" { p="'"${U[0]}"'";q=(p|getline $4);close(p);if(!q) next } $1<20&&$1!=15 { o[$1]=o[$1]"\n "$3" (UID "int($4)"): "$2 } $1==15 { o[$1]=o[$1]"\n "$3": "$2 } $1==20&&$5!~"^/dev" { o[$1]=o[$1]"\n "$3" (UID "$4") '"${k[0]}"'"$5" (status "$6"): "$2 } $1==21&&$5 { p="'"${U[1]}"'";p|getline n;close(p);if(n) $5=n;o[$1]=o[$1]"\n "$5" '"${k[0]}"'"$3" (UID "$4"): "$2 } $1~/2[23]/{o[$1]=o[$1]"\n "$3" (UID "$4", error "$5"): "$2 } END{n=split("'"${k[5]}"'",u,":");split("'"${k[6]}"'",l,":");for(i=1;i<=n;i++) if(o[i]) print "\n"l[i]" ("u[i]")\n"o[i] }' '/^ {8}[^ ]/' 'BEGIN{L='${p[17]}'; } !/^[[:space:]]*(#.*)?$/{if(++l<=L) f=f"\f "$0 } END{F=FILENAME;if(!F||F~/'"${k[47]}"'/) exit;p="'"${U[2]}"'";p|getline C;close(p);split(C,A);C=A[1];p="'"${U[3]}"'";p|getline T;close(p);p="'"${U[4]}"'";p|getline D;close(p);p="'"${U[5]}"'";p|getline S;close(p);if(T!~"text") { if(T=="Apple Desktop Services Store"&&F~/\/.DS_Store$/) exit;p="'"${U[6]}"'";if(T~/^Apple b/) p="'"${U[9]}"'";f="";l=0;while(p|getline g) { gsub(/[^\t -~]/,"",g);if(++l<=L) f=f"\f "g };close(p) };if(!f) f="\f ['${k[1]}']";if(T!~/'"${k[48]}"'/) F=F"\f'"${k[0]}"'"T;printf "'"${f[8]}"'",F,D,S,C,f;if(l>L) printf "'"${f[7]}"'",l-L;print "" } ' " /${k[42]}/d;/${k[43]}/p " ' s/0/Off/p' 's/^.{52}(.+[)]).+/\1/p' '/id: N|te: Y/{i++ } END{print i }' 'BEGIN{split("'"${p[37][*]}"'",W) } NF { b="";d="";sub(/:.*/,"");p="'"${U[11]}"'";while(p|getline C[++i]) { split(C[i],t,"=");A[i]=t[1];B[i]=t[2];if(A[i]~/^Id/) b=B[i];if(A[i]~/^A/) { d=B[i];sub(/[^:]+: /,"",d);break } };close(p);if($0~/'"${k[49]}"'/&&d) { p="'"${U[7]}"'";p|getline c;close(p);sub(/ .+/,"",c);for(i in W) if(c==W[i]) next };if($0~/\.(app|ds)$/&&!d) next;if($0!~/\./) next;if($0!~/\.dylib$/&&!d) { p="'"${U[8]}"'";p|getline b;close(p);if(b~/ [(]|: co/) b="";sub(/^.+= (\")?/,"",b);sub(/\"/,"",b);if(!b) { p="'"${U[10]}"'";p|getline b;close(p);if(b~/ .+:/) b="" };if(!b) b="'"${k[1]}"'"; };if(b&&d) printf "'"${f[5]}"'",$0,b,d;else if(b&&!d) printf "'"${f[4]}"'",$0,b;else if(!b&&d) printf "'"${f[4]}"'",$0,d;else print }' '/ en/!s/\.//p' 'NR>=13 { gsub(/[^0-9]/,"",$1);print }' '$10~/\(L/&&$9!~"localhost" { sub(/.+:/,"",$9);print $1": "$9|"sort|uniq" }' '/^ +r/s/.+"(.+)".+/\1/p' 's/([-+.?])/\\\1/g;p' 's/^.+\/(.+)\.wdgt$/\1/p ' $' /l: /{ /DVD/d;s/.+: //;b0\\\n };/s: /{ / [VY]/d;s/^ */- /;H; };$b0\\\n d;:0\\\n x;/APPLE [^:]+$/!p;' '/^find: /!p;' 'BEGIN{OFS="\f" } /^p/{if(f) { print f,c,u };getline;sub(/^./,"");c=$0;getline;sub(/^./,"");u=$0;f=0;next } /^f/{f++ } END{print f,c,u }' 'BEGIN{FS="= " } /Path/{print $2 }' 's/(\.wdgt).+/\1/p' '/[/]/s/.{5}//p' '1;END{if(NR<'${p[15]}') printf("^/(S|usr/(X|li))") }' '/2/{print "WARN" } /4/{print "CRITICAL" }' '$1>'${p[27]} ' $3~/^[1-9][0-9]{0,2}(\.[1-9][0-9]{0,2}){2}$/&&$5+$7 { i++;n=n"\n"$1": "$3 } END{if(i>1) print n }' 'NF==10&&$6+$8+$9+$10>='${p[30]}' { print $1": "$6+$8+$9+$10 }' '/^(u?tun|tap)[0-9]+:/{sub(":","",$1);i=$1;getline;if($3=="-->") a[j++]=i;next } END{for(j in a) print a[j] }' '/B.+r: ..f/{ s/.+(...)$/\1/p;q; };/es: ./{ s/^.+://;s/,.+//;b0'$'\n'' };/^ +C.+ted: +[NY]/H;/:$/b0'$'\n'' d;:0'$'\n'' x;/: +N/d;s/://;s/\n.+//p;' '1d;/:$/b0'$'\n'' $b0'$'\n'' /(D|^ *Loc.+): /{ s/^.+: //;H; };/[my]: /H;d;:0'$'\n'' x;/[my]: [AM]|(^|\n)\/V/d;s/(^|\n) [ -~]+//g;s/(.+)\n(.+)/\2:\1/;s/\n//g;/[ -~]/p;' $' s/\$/\f(0|-(4[34])?|[(]pe[)])$/p ' '|sort'{'|uniq'{,\ -c},\ -nr} ' BEGIN{FS=":";s="stat -f%z " } $1!~" "&&$1~"lo" { s$1|getline S;close(s$1);sub(/^\/.+\//,"",$1);print $0" ("S" B)" }' '/^ {5}|[{}()]|"[_0-9A-F]{35,}"/d;/'"${k[9]}|${k[50]}"'/d;s/;$//p' '1;NR=='${p[1]}' { print "'"${k[39]}"'";exit }' '/^501$/d;s/^0$/root/;p' 'BEGIN{a=" " } /^Thread c/{a="*";exit } END{print a } ' p ' s/:[^:]+$//;p ' '|wc -l' '/\.kext\/(Contents\/)?'${k[13]}'$/p' '/\.'{xpc,'(appex|pluginkit)'}'\/Contents\/'${k[13]}'$/p' '/\.wdgt\/'${k[13]}'$/p' '/Launch[AD].+\.plist$/p' '{ gsub(", ","\n") } 1' 'BEGIN{FS="\f" } /./{printf "'"${f[9]}"'",$1/2^30,$2 } ' "|grep -Eo ' (DY)?LD_[^ ]+'" 's/.+\.//p' 'BEGIN{FS="\t" } NR>1&&$NF!~/0x|\.([0-9]{3}|[-0-9A-F]{36})$/{print $NF"\f"a[split($(NF-1),a," ")] }' '|tail -n'${p[6]} '|head -n'${p[10]} ' { p="'"${U[13]}"'";while(p|getline a) print a;close(p) }' '$1<'${p[28]}' { exit } 1' '1{ H;g; };/^ +(([MNPRSV]|De|Li|Tu).+|Bus): .|d: Y/d;s/:$//;$d;p;' 'BEGIN{RS=",";FS=":" } $1~/"name"/&&$2!~/__MSG.+[Ee]__/{gsub(/["\\]/,"",$2);print $2 }' 'BEGIN{FS=":" } $1=="HomeDirectory" { sub(/.+\>/,"",$2);if($2=="file") print "'${k[19]}' 1";if($2~/afp|nfs|smb/) print "'"${k[17]}"': " toupper($2) } $1~/^AppleMetaN/{split($2,a,"/");if(a[2]!="Local") print "'"${k[18]}"': " a[2] }' '/[^ .]/p' '{ print $1}' '/^ +N.+: [1-9]/{i++ } END{if(i) print "system: "i }' 'NF { print "'{admin,user}' "$NF;exit }' '1,/se.+s =/d;/[}]/q;p' '3,4d;/^ +D|Of|Fu|0/d;s/^ |:$//g;$!H;${x;/:/p; }' 'BEGIN{FS=": " } NR==1 { sub(":","");h="\n"$1"\n" } /:$/{l=$1;next } $1~"S"&&$2!~3 { getline;next } /^ {6}I/{L[++i]=l" "$2 } END{if(i) print h;for(j=0;j<'${p[24]}';j++) print L[i-j] }' '/./H;${x;s/\n//;s/\n/, /g;/,/p; }' '{ if(int($6)>'${p[25]}') printf "'"${f[15]}"'",$6/1024 }' 'BEGIN{FS="\"" } $3~/ t/&&$2!~/'{${k[2]},${k[7]}}'/{print $2 }' 'BEGIN{FS=":" } $2'{'~/^ SQL/','!~"=1"'}' { print $1 }' '<<<"'"${k[25]}"'"' {,'1d;'}'/r%/,/^$/p' 'NR<='${p[26]}' { o=o"\n"$0;next } { o="";exit } END{print o|"sed 1d" }' 'END{print $'{3,4}' }' '/^0/{ s/.{7}//;N;/\nok$/q;/\n[*]/{ s/\n.+$//;N; };s/\n/'$'\f''/p; };' 'NR==1||$2==-1 { next } !NF||$2==-2 { exit } { print $(NF-'{3,2,8,7,0,1,14}')"\f"substr($0,1,32)"\f"$(NF-15) }' '$1~/^C/{exit } $3!=1500 { print "\n"$0 }' '|grep -Elq "^ +Me.+E SD C"' '1{ H;g;s/://; };/^ +So/d;$d;p;' /^t/p ' BEGIN{FS="\f" } /\.[0-9]+ W /{gsub(/^.+ | +$/,"");sub(" W ",FS);$1*=100;if($2) t[$2]+=$1;t["Total"]+=$1 } END{for(p in t) print int(t[p]+.5),FS,p }' '/^...C/{ s/^.+\"([^"]+)\".+/\1/p;q; }' '/^[(]/{ s/^[(][0-9]+[)] //;s/$/:/;N;/: [)]$/d;s/\n.+ ([^ ]+).$/\1/;p; }' '/[{}]/d;H;${g;/E[^\n]+[1-9]/p; } ' " /\/(Contents|Encodings|Firm.+s|Ling.+a|Tcl|Tex.+)\/|\.framework[./]/d;/${k[56]}/p " ' BEGIN{FS="=" } ! ($2||/'"${k[35]}"'/) { print;next } $1~/^E/{sub(/\/(Content|Version)s\/.+/,"",$2);p=$2;next } $1~/^Signa/{for(i=1;i<4;i++) { getline;a[i]=$2 };if(a[3]!="'"${k[57]}"'") printf "'"${f[4]}"'",p,a[1] }' 'BEGIN{FS="[()]" } { print $4 }' '/\//!d;/'"${k[58]}"'/d;s/^ +.|.,?$//g;p' 's/1/No/p' 'NR>1&&NF>8&&$1~/^20/{sub(/.{88}/,"");gsub(/0x[0-9A-Fa-f]+/,"[hex]");gsub(/\<[^>]+\>/,"<*>");sub(/ [0-9]+ re/," N re");gsub(/[0-9]{6}\.[0-9]{6} /,"");print }' '$0~"'"${k[21]}"'" { print $NF }' '2>&'{1,-} ' s/\(.+//p' 's:^[^/]+::p' '/h.+de +([124-9]|3.)/s/^.+ //p ' $' 1{ s/^/\\\n/;s/://;s/$/\\\n/p; };1!s/^ */ /p' '/M.+=/{ s/^.+= //;/^Apple Inc\.$/!p; }' 'BEGIN{p="'"${U[12]}"'" } { print|p }' '/: a/s/:.+//p' '/y>UserN/{ N;s/g>[^>]+</g>USER</; };p ' /${k[9]}\[Ffp\]/p $'p;$c\\\n'${k[9]}'pkg.ServerApp' 'H;${g;/'{"${k[70]}","${k[71]}"}'/!p; } ' /{"${k[74]}","${k[40]}"}/\!p);N4=${#s[@]};for i in {1..19};do s[N4+i-1]='11q;s/^/'$i$'\f/;s/ *\f */\f/g;p;';done;c2=(${k[9]}loginwindow\ LoginHook Print\ ${k[12]}${k[15]} 'Application("System Events").loginItems.path()' '~/L*/Ca*/'${k[9]}'Saf*/E* -d 2 -name '${k[13]} '~ $TMPDIR.. \( -regex "'"${k[31]}"'" -o \( -flags +sappnd,schg,'{,sunlnk\,}'uappnd,uchg -o ! -user '${p[35]}' -o ! -perm -400 \) -print \) -prune ' '-nl -print' -u $'\''' process="kernel"&&sender matches "'${k[24]}'"&&! eventMessage matches "'"${k[38]}"'"&&(! sender="IOThunderboltFamily"||! eventMessage matches "'"${k[37]}"'" ) '$'\'' "-f'%N: %l' Desktop {,~}/L*/Keyc*" therm sysload boot-args status $'\''' process="kernel"&&((sender="kernel"&&! eventMessage matches "'"${k[27]}"'" )||eventMessage contains "[Error]" ) '$'\'' '-F -R -cd -l2 -n0 -s10' 'acrx -o%cpu,comm,ruid' "' syscall::open*:entry {@a[execname,uid,copyinstr(arg0),errno]=count()} syscall::execve:return, syscall::posix_spawn:return {@b[execname,uid,ppid]=count()} syscall::fork:return, syscall::vfork:return, syscall::posix_spawn:return /arg0<0/ {@c[execname,uid,arg0]=count()} syscall:::return /errno!=0/ {@d[execname,uid,errno]=count()} tick-10sec { normalize(@a,10);normalize(@b,10);normalize(@c,10);normalize(@d,10);printa(\"20\f%@d\f%s\f%d\f%s\f%d\n\",@a);printa(\"21\f%@d\f%s\f%d\f%d\n\",@b);printa(\"22\f%@d\f%s\f%d\f%d\n\",@c);printa(\"23\f%@d\f%s\f%d\f%d\n\",@d);exit(0); } '" -f\ -pfc '{,~}/L*/Lo*/Diag* -type f -regex .\*[cght] ! -name .?\* ! -name \*ag' '/S*/*/Ca*/*p'{c,-s}\* /\ ${k[8]}ContentTypeTree\=${k[9]}{'bun*\|\|'${k[8]}'FSName=*.mailbun*\|\|'${k[8]}'Kind=Scripti*\|\|'${k[8]}'Kind=*Plug*',mach-o-dylib} 'Print\ :Label' "/p*/e*/{*.{conf,local,sh},auto_*,{cron,fs}tab,hosts,mach_i*/*,pam.d/*,pf*/*,rc*,ssh/*_config,sudoers{,/*}} {/p*,/usr/local}/e*/periodic/*/* /L*/P*{,/*}/com.a*.{Bo,sec*.ap}*t {/S*,}/L*/Launch[AD]*/{.??,}*{,/*} /S*/*/Sa*/*{.conf,/*.sb} ~/L*/LaunchA*/* ~/.launchd.conf" sched $'\''' messageType>15&&process!="kernel" '$'\'' ${k[12]}${k[9]}alf\ globalstate --proxy -fdiskio\ -t10 vm.swapusage --dns -q\ --configured ${k[9]}spaces\ spans-displays dump-trust-settings\ {-s,-d,} '~ '${k[8]}'Kind\=Package' '-R -ce -l1 -n5 -o'{'prt -stats prt','mem -stats mem'},command,uid -kl -l -s\ / --files '+c0 -i4TCP:0-1023' ${k[9]}dashboard\ layer-gadgets '"`ls -A /L*/A*/A*/P*/ALR*`"' '-app Safari '{{WebKitDNSPrefetching,UserStyleSheet}Enabled,CustomUserAgent} '~/L*/{Con*/*/Data/L*/,}Preferences -type f -size 0c -name *.plist.???????' kern.memorystatus_vm_pressure_level -f$'\f%Sc\f%N -t%F' $'\''' process="kernel"&&sender matches "'"${k[36]}"'"&&eventMessage matches[c] "'"${k[60]}"'" '$'\'' $'\''' process="kernel"&&sender="AppleSMC"&&eventMessage contains "'"${k[21]}"'" '$'\'' $'\''' process="watchdogd"&&eventMessage contains " unresp" '$'\'' '/S*/*/Caches /[LU]* \( -regex "'"${k[31]}"'" -o -flags +restricted -print \) -prune' list --nwi -listnetworkserviceorder 'Print\ ':{"${k[32]}","${k[33]}"} ${p[35]} {'$TMPDIR../C ~/','/{S*/,}'}'L*/{,Co*/*/*/L*/}{Cache,Log}s -type f -size +'${p[11]}M --group{,-pkg}s /Users/$USER '~/L*/A*/'{'Fi*/P*/*/a','Chrom*/D*/E*/*/*/'}'*.json' '{,~}/L*/{Container,Preference}s -type f ! -size 0 -name *.plist ' -s ac -f%z$'\f'%N '/ "'${k[8]}'DateAdded>=\$time.now(-'${p[23]}')&&'${k[8]}${k[32]}'=*"' -m\ / '' "${k[26]}"' -mtime -'${p[23]}s print{,-disabled}\ {system,{gui,user}/${p[35]}} '-n1 --show-initial-usage --show-process-io --show-process-gpu --show-process-netstats --show-process-energy ' Eax '~/L* /L*/Ca*/*.'${p[35]}' $TMPDIR.. /v*/db -regex "'"${k[31]}"'" -prune -o -type f \( -name *.cache -o -name *.Q*V2 -o -name *.C*base -o -name *.*db -o -name *.loc*e -o -name *.sqlite -o -name *.st*a \) -print ' '/{A,L*/Fr}* -type d \( -name *.app -o -name *.f*k \) -prune' -v -dvv -o -g ${k[12]}${k[16]} '/l*/i*' -get{dnsservers,info,MTU} --nc\ {list,statistics} -Wind -mv '-Fcu +c0 -l' -v -L --integrity-check "${k[73]}"' -regex '"${k[74]}"' -prune -o -type f -exec cksum {} +');N1=${#c2[@]};for ((j=0;j<${#p[42][@]};j++)) do;c2[N1+j]=SP${p[42][j]}DataType;done;N5=${#c2[@]};for i in 0 1;do for j in {0..16};do c2[N5+17*i+j]='Print\ '${k[63]}:$j:${k[3+i]}\ ${k[11]}${k[14]};done;done;l=({Restricted\ ,Lock,Pro}files PPP\ tunnel{,\ errors} {Safari,App,{Non-loading,Loaded}\ kernel,Firefox,Chrome}\ extensions boot\ args ${k[19]}\ 2 Account Agent\ string TUN/TAP\ tunnels Sleep\ mode Power\ adapter lost+found Login\ hook 'I/O per process' 'High file counts' UID {System,Login,User}\ services\ {load,disabl}ed {Global,User}' login items' {Admin,Root}\ access Font\ issues Firewall Proxies DNS TCP/IP Wi-Fi Volumes {Root,User}\ {crontab,at\ queue} Spotlight{,\ importers} Listeners Widgets Parental\ Controls Prefetching Network\ errors {Userland,I/O,HCI,Kernel}\ messages Code\ insertion Networks {User,System}\ caches/logs {XPC,Sandbox}\ cache Shutdown\ codes Heat Diagnostic\ reports {Property\ list,Database}' integrity checks' Restrictive\ permissions Bundles{,' (new)'} Trust\ settings Activity 'Free space (MiB)' Stylesheet Libraries Non-responders Memory\ pressure Data\ packages Modified\ {bundles,binaries} 'Global prefs ('{user,system,host}\) Server Separate\ spaces 'VM (GiB)' Startup\ items SD\ card iCloud\ services Battery Signatures System\ load EFI Ethernet Print\ jobs);N3=${#l[@]};for i in {0..15};do l[N3+i]=${p[42][i]};done;A1() { E3 0;c="${c1[$1]} ${c2[$2]}";shift 2;E1 $*;E2&&c="sudo $c";v=`eval "$c $d"`;[[ "$v" ]]; };A2() { E3 0;[[ "$v" ]]||return 1;c="${c1[$1]}";[[ "$c" =~ ^(awk|sed ) ]]&&c="$c '${s[$2]}'"||c="$c ${c2[$2]}";shift 2;E1 $*;x=xargs;E2&&x="sudo $x";v=`<<<"$v" tr -u '\n' '\0'|eval $x -0 -J{} -L1 -P1 "$c" {}"$d"`;[[ "$v" ]]; };eval "`typeset -f A2|sed 's/A2/A3/;s/P1/P'${p[33]}/`";A4() { E3 0;[[ "$v" ]]||return 1;c="${c1[$1]}";[[ "$c" =~ ^(awk|sed ) ]]&&c="$c '${s[$2]}'"||c="$c ${c2[$2]}";shift 2;E1 $*;x=xargs;E2&&x="sudo $x";v=`<<<"$v" tr -u '\n' '\0'| $x -0 -L1 -P${p[33]} ksh -c "$c"' "$0"'"$d"`;[[ "$v" ]]; };B1() { v=No;! ((v[1]))&&{ v=;P1=1; }; };eval "`typeset -f B1|sed s/1/2/g`";B3() { v[$1]="$v"; };B4() { I=$1;J=$2;shift 2;E1 $*;v[J]=`eval <<<"${v[I]}" cat"$d"`; };B5() { [[ "${v[$1]}${v[$2]}" ]]&&v="${v[$1]}"$'\n'"${v[$2]}"||v=; };B6() { v=`paste -d$'\f' <(printf "${v[$1]}") <(printf "${v[$2]}")|awk -F$'\f' '{printf "'"${f[$3]}"'",$1,$2}'`; };B7() { v=`egrep -v "${v[$1]}"<<<"$v"|sort`; };eval "`typeset -f B7|sed 's/7/8/;s/-v//'`";B9() { [[ "${v[$1]}" ]]; };B10() { P2=0; };B11() { ((p[31]>=$1)); };B12() { v=`comm -23 <(sort<<<"${v[0]}") <(sort<<<"${v[$1]}")`; };C0() { E3 1;[[ "$v" ]]&&sed<<<"$v" s/^/$1/; };C1() { E3 1;[[ "$v" ]]||return;((${#v}<=p[36]))&&[[ ! "$v" =~ $'\n' ]];I=$?;((I))&&x='/[^ ]/s/^ */ /p'||x='s/^ +| +$//g;p';v=`sed<<<"$v" -En "$x"`;[[ "$v" == 0 ]]||printf "${f[I]}" "${l[$2]}" "$v"|sed s/^/$1/; };C2() { [[ "`pwd`" == "$HOME" ]]&&return;trap '' 0 6 29 30 31;[[ "`jobs -p|grep -Fw $R1`" ]]&&kill $R1;print -u3 -f "${f[10+Z]}" "${v[16]}"||Z=3;exec>>"${v[3]}";while read -p -t.1 L;do echo "$L";done|sort -k1,1 -ns|sed -E "$s"|nl -ba -s' ' -w4;((Z))&&printf "${k[51+Z]}";printf "${f[18]}" $SECONDS;bzip2 -k "${v[3]}";open -g "${k[61]}";osascript>&- <<<"${k[55]}";sudo -k; };C3() { ((++Y[$1]));Y[0]=$((Y[0]>Y[1]-$1?Y[0]:Y[1]+1));print -u3 -f "${f[21]}" "${Y[1]}" "${Y[0]}"; };C4() { trap C2 0;trap '' 2;trap 'Z=2;exit' 6;trap 'Z=1;exit' 29;trap 'C3 0' 30;trap 'C3 1' 31;JOBMAX=$((p[33]+2));v[2]=1;[[ `groups` =~ \ admin( |$) ]];v[1]=$?;((v[1]))&&{ printf "${k[30]}";read -rsn1; }||{ printf "${k[59]}";export SUDO_PROMPT=$'\t\e[97m%u: \e[0m\e[?25h';sudo -v 2>&-;v[2]=$?;printf '\e[?25l';((v[2]))&&{ printf "${k[10]}";sleep 1.5; }; };clear;[[ "$TMPDIR" ]]&&cd "`mktemp -d -t "${k[61]}"`"||exit;{ dd 2>&- bs=$((2**p[43])) count=$((2**(p[34]-p[43])));kill -6 $$; }|&;exec>&p 3>&2 2>/dev/null;v[16]=`date "${k[62]}"`;v[3]="${k[61]}/${v[16]}";mkdir -m700 "${k[61]}";date>"${v[3]}" "${f[14]}";date "${f[2]}"|sed>&3 's/ / /';SECONDS=0;{ caffeinate -ims -w$$&while ((SECONDS<p[32]));do print -u3 -f "${f[20]}" $SECONDS;sleep 1;done;kill -29 $$; }&R1=$!;R2=`jobs -p`; };D0() { I=$1;shift;A1 $@;C0 $I; };eval "`typeset -f D0|sed 's/D0/D1/;s/A1/A2/'`";D2() { I=$1;J=$2;shift 2;A1 $@;C1 $I $J; };eval "`typeset -f D2|sed 's/D2/D3/;s/A1/A2/'`";eval "`typeset -f D3|sed 's/D3/D4/;s/A2/A3/'`";E0() { while [[ `jobs -p|grep -Fvw "$R2"` ]];do sleep 1;done; };function E1 { typeset a b;d=;while [[ "$1" ]];do b="${s[$1]}";shift;[[ "$b" =~ ^([&|<>]|[2-9]>&|$) ]]&&{ d+=" $b";continue; };:|sed 2>&- -E "$b"&&a=sed\ -Eln||a=awk;d+="|$a '$b'";done; };E2() { ((P2))&&{ sudo -v;print -u3 -f '\e[?25l'; }; };E3() { ((u[$1]))&&return;kill -$((30+$1)) $$;u[$1]=1;u[! $1]=0; };C4;B1&&{ E3 0;B2;C1 0 32; }||{ E3 0;C1 0 31; };A1 12 15;B4 0 0 38;C1 4 70;A1 1 11;B4 0 0 8;C1 4 90;A1 9 16;B4 0 0 76 16 N4+15 45;C0 4;B2&&{ D0 4 28 17 146 45;A1 40 30;B4 0 0 76 N4+14 45;C0 4;A1 43 85;B4 0 0 117;B3 24;for i in {0..6};do for j in 0 1;do B4 24 0 82+36*j 123+i 76 N4+2*i+j 45;C0 4;done;done;D2 8 19 21 0&D2 8 40 10 42&D2 8 42 5 103&D2 5 46 35 45 55&D2 1 92 52 105 158&};D2 6 0 4 57 30 79&D0 4 35 102 61 76 N4+16 45&A1 4 71;D4 6 64 30 72 115 79;A1 4 87;A3 42 77 114;A4 25 77 145 116 122;B4 0 0 41;C1 6 65;A1 4 65;D4 6 58 19 74 91;B10;A1 13 66 155;A2 13 67;B4 0 0 74 156;B3 32;B4 32 0 97;B3 33;A3 23 18 160 28;B4 0 8 57 74 22 102;B2;A1 16 25 33;B7 8;B4 0 0 34;A3 31 47;B10;B4 0 0 152 154;C0 6;B4 33 0;A3 23 18 159 29 74;B3 34;B2;A1 4 106 33 74;B12 34;B4 0 0 34 79;C1 2 78;B4 32 0;A4 13 44 15 18;B4 0 4 74;B4 4 0 85;A3 14 61 57;B4 0 5 19 102;B4 4 0 89;A3 14 24 57;B4 0 6 19 102;B4 4 0 86;A3 14 61 57;B4 0 7 102;B5 6 7;B4 0 11 74 73 102;B4 4 12 32 57 23 102;B4 4 0 87;A3 14 61 57;B4 0 17 20;A1 4 88;D4 2 77 44 89 153 74 79;B4 4 0 138;A4 44 90 139;B4 0 0 79;C1 2 89;A1 4 64;D4 7 57 19 74 76 91;{ for i in 0 1 2;do A1 18 79+i 107 94||continue;B10;B7 11;B4 0 0 11;C1 8 23+i*2;D2 8 24+i*2 18 82+i 112+$((i>0));done; }&{ A1 7 77 14;B3 28;A1 20 31 111;B5 0 28;C1 4 84; }&{ for i in {0..2};do A1 29 35+i 104+i;B3 25+i;done;B6 25 27 7;B6 0 26 7;B4 0 0 110;C1 5 69; }&D2 4 22 15 63 80&D2 4 71 6 76 13&D2 4 75 20 52 66&D2 4 93 46 91 103 75 76&D0 1 0 N1+2 3&D0 1 0 N1+16 17&D0 1 0 N1+3 4&D2 1 88 0 N1+4 5&D2 4 62 1 10 7&D2 6 16 1 77 149&D0 6 1 26 150&D2 1 17 1 73 151&D2 6 11 2 12 9&D2 6 12 3 13 10&D2 6 2 0 N1+20 46 84&D2 6 44 34 43 53&D2 6 59 19 20 26&D2 6 60 19 21 26&D2 6 80 21 93 78&D2 5 34 21 28 35&D2 5 35 27 29 36&D2 5 82 45 33 25&D2 5 38 0 N1+21 43&D2 6 18 42 94 79 77&D2 8 29 14 1 62&B11 18||D2 7 30 37 2 90&D2 8 41 10 42&D2 8 43 5 103&D2 7 13 32 68 101&D2 7 48 36 47 25&D0 7 0 N1+23 132&D2 2 10 41 70 100&D2 2 9 41 69 100&D2 7 49 21 48 49&D2 7 72 21 49 35&D2 7 14 21 50&D2 7 21 19 9 37&D2 7 79 21 92 78&D2 7 81 22 92 78&D2 7 83 21 34 142&D0 7 0 N1+18 108&D2 7 76 24 38&{ A1 17 41 50;B7 5;C1 2 8; }&for i in {11..14};do { A1 0 N1+i 72 74;[[ $i =~ 1[13] ]]&&B7 12;B4 0 0 52;C1 2 N3+i; }&done;{ A1 24 22 48;B7 12;B4 0 0 52;C1 2 67; }&{ A1 4 78;j=$?;A1 24 75 74;((j))||B7 12;B4 0 0 119 52;C1 2 68; }&{ B4 4 13 27 57 65;A1 24 23;B7 13;B4 0 0 52;C1 2 73; }&{ A1 49 104 145 141;B7 12;C1 2 45; }&{ A1 26 101 64;B7 17;B4 0 31 147;B4 0 0 148;B6 0 31 4;C1 2 6; }&{ B4 4 22 88 63 102;A1 21 46 56 74;B7 22;B4 0 0 58;C1 2 47; }&D2 0 N3+1 0 N1+1 2&D2 0 N3 0 N1 1&for i in 0 1;do D0 4 12 40-i 54 16 N4+18-i 45&done;D2 1 N3+10 0 N1+10 59&D2 1 N3+15 0 N1+15 59&D0 1 0 N1+17 99&D0 5 0 N1+25 132&for i in {5..8};do D2 1 N3+i 0 N1+i 6&done;D2 1 N3+9 0 N1+9 71&D2 1 86 0 N1+22 131 25&B11 15&&D2 6 33 0 N1+24 51&{ A1 27 59;B4 0 18 120;B4 0 29 121;A1 33 60 136;B8 18;B9 0||{ D3 5 3 47 82 25;A1 27 98 135; };B4 0 19 83;D3 5 4 27 99 137;D2 5 15 50 7 70;B9 19&&A1 27 32 39&&{ B3 20;B4 19 0;A2 33 95 40;B3 21;B6 20 21 3; };C1 5 36;A1 38 100;B3 30;B4 0 0 68;C1 5 56;B4 30 0 69;C1 5 50;B4 19 0;B9 0&&D3 5 37 33 96 42;B9 29;B4 29-11*$? 0;B9 0&&D1 5 33 97 130; }&{ A1 4 19;B3 14;A2 19 53;B3 15;B4 14 0;A2 31 81;B6 0 15 3;B4 0 0 44 75 95 12;C1 3 63; }&D2 3 54 8 14 143 75 76 98 96&{ D2 3 52 8 8 143 75 76 98 96&&D2 3 39 48 58 31; }&{ D2 3 53 8 54 143 75 76 98 96&&D0 3 0 N1+7 99; }&D2 3 61 8 55 144 75 76&D2 3 74 8 56 140 75 76 98 96&D2 3 51 8 27 143 75 76 98 96&B11 18||{ A1 4 3 60&&{ B3 9;A2 14 61;B4 0 10 21;B4 9 0;A2 14 62;B4 0 0 21;B6 0 10 4;C1 7 5; }; }&{ for i in {0..16};do A1 14 N5+i 133&&{ A1 14 N5+i+17 93;B5 23 0;B3 23; };done;B4 23 0;C1 7 87; }&B11 15;D2 7 66 4 5-$? 84&D2 7 1 4 51 84 67&D2 2 7 11 6 52&D0 2 0 N1+19 109&D2 7 55 9 86 92 74&D2 1 91 51 105 157&E0;
@elias65
Copy link

elias65 commented Oct 8, 2016

Hello,

I'm trying the script for myself and want to inform you that the script doesn't work.
The script stops with the following error:

bash: command substitution: line 1: syntax error near unexpected token 'A1'

Also the last 3 revisions before have the same error.

System: macOS Sierra, Build: 16A323

@LincDavis
Copy link
Author

LincDavis commented May 3, 2017

Folks, you're entitled to run this script if you like, but I don't provide support for it except to those whom I personally ask to run it, and then not through this repository. Even less do I support any forks that might appear. The script is not intended to be a public resource. It's only here so that the revisions can be tracked by those who want to vet the code.

The fact that this site allows forking does not mean that I allow it. I'm the copyright holder, not GitHub. Modifying this code is not allowed without my permission. It's not under any kind of open-source license.

@CommanderB1
Copy link

Hello Linc 🙂

You helped me many years ago - on the ASC forums - and determined that my iMac hard drive was in imminent danger of failing. I had it replaced and all my troubles disappeared. I've never forgotten your kindness, so thank you!

I've recently reviewed this article - might what is said actually be true? https://sites.google.com/site/howtotellifyourmacishacked/is-etrecheck-malware

I have run EtreCheck on this computer in the past. Can you suggest how I can ascertain that there is no 'infection' present now?

Hardware Overview:

Model Name: iMac
Model Identifier: iMac18,3
Processor Name: Quad-Core Intel Core i5
Processor Speed: 3.8 GHz
Number of Processors: 1
Total Number of Cores: 4
L2 Cache (per Core): 256 KB
L3 Cache: 6 MB
Memory: 8 GB
System Firmware Version: 429.100.7.0.0
SMC Version (system): 2.41f2

I'm using macOS Big Sur
System Version: macOS 11.3.1 (20E241)
Kernel Version: Darwin 20.4.0

--
Thanks
David B.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment