-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathremove
More file actions
484 lines (213 loc) · 9.25 KB
/
Copy pathremove
File metadata and controls
484 lines (213 loc) · 9.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
#!/bin/bash
set -u
# Interfaces to skip
SKIP_REGEX='^(lo0|en0)$'
current_iface=""
ifconfig | while IFS= read -r line; do
# Match interface header lines like: en1: flags=...
if [[ "$line" =~ ^([a-zA-Z0-9]+):[[:space:]]flags= ]]; then
current_iface="${BASH_REMATCH[1]}"
if [[ "$current_iface" =~ $SKIP_REGEX ]]; then
echo "Skipping $current_iface"
current_iface=""
continue
fi
echo
echo "Processing interface: $current_iface"
continue
fi
# If we're not currently processing an interface, skip
[[ -z "$current_iface" ]] && continue
# Match IPv6 address lines like:
# inet6 fe80::b291:9b54:98f0:a23c%utun0 prefixlen 64 scopeid 0xd
if [[ "$line" =~ ^[[:space:]]*inet6[[:space:]]+([^[:space:]]+) ]]; then
ipv6="${BASH_REMATCH[1]}"
echo " Removing IPv6 $ipv6 from $current_iface"
sudo ifconfig "$current_iface" inet6 "$ipv6" delete 2>/dev/null \
|| echo " Failed to delete IPv6 $ipv6 on $current_iface"
fi
# Detect the end of an interface block by looking ahead implicitly:
# when we hit a blank line, bring interface down
if [[ -z "$line" ]]; then
echo " Bringing $current_iface down"
sudo ifconfig "$current_iface" down 2>/dev/null \
|| echo " Failed to bring $current_iface down"
current_iface=""
fi
done
# Second pass: make sure every non-skipped interface gets a down attempt,
# even if its block had no blank-line separator.
for iface in $(ifconfig -l); do
if [[ "$iface" =~ $SKIP_REGEX ]]; then
continue
fi
echo "Final down attempt on $iface"
sudo ifconfig "$iface" down 2>/dev/null \
|| echo "Failed to bring $iface down"
done
----------------------------------------------------------------------------------------------------
sudo ifconfig en0 inet6 fe80::1458:4d65:2b6f:c271%en0 delete
sudo networksetup -setv6off "Wi-Fi"
sudo wdutil info
sudo wdutil clean
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist PrivateMACAddressModeSystemSetting -int 1
sudo wdutil privateMAC=1
sudo wdutil privateMAC=0
xcrun simctl list devices
networksetup -listlocations
sudo networksetup -createlocation "Network" populate
sudo networksetup -switchtolocation "Network"
sudo networksetup -deletelocation "Automatic"
scselect
networksetup -getinfo Wi-Fi
networksetup -listallhardwareports
networksetup -getairportnetwork en0
sudo networksetup -setairportpower en0 on
sudo wdutil diagnose
cd /private/var/tmp/
networksetup -listpreferredwirelessnetworks en0
networksetup -getairportnetwork en0
sudo networksetup -setairportnetwork en0 "ATTiepSY4I" "Badgers"
networksetup -listnetworkserviceorder
sudo networksetup -ordernetworkservices "Wi-Fi" "Thunderbolt Bridge"
sudo networksetup -setdhcp "Wi-Fi"
sudo networksetup -setmanual "Wi-Fi" 192.168.1.100 255.255.255.0 192.168.1.254
sudo networksetup -setv6automatic "Wi-Fi"
sudo networksetup -setwebproxy "Wi-Fi" 192.168.1.102 8080
sudo networksetup -setsecurewebproxy "Wi-Fi" 192.168.1.102 8080
sudo networksetup -setsocksfirewallproxy "Wi-Fi" 192.168.1.102 8080
sudo networksetup -getwebproxy "Wi-Fi"
sudo networksetup -getsecurewebproxy "Wi-Fi"
sudo networksetup -getsocksfirewallproxy "Wi-Fi"
sudo networksetup -setwebproxy "Wi-Fi" ""
sudo networksetup -setsecurewebproxy "Wi-Fi" ""
sudo networksetup -setsocksfirewallproxy "Wi-Fi" ""
sudo networksetup -setwebproxystate Wi-Fi off
sudo networksetup -setsecurewebproxystate Wi-Fi off
sudo networksetup -setsocksfirewallproxystate "Wi-Fi" off
networksetup -setairportpower en0 off
networksetup -setairportpower en0 on
system_profiler SPAirPortDataType
log show --predicate 'eventMessage contains "airport"' --info
networksetup -setdnsservers Wi-Fi 172.64.36.1 172.64.36.2 2a06:98c1:54::18:83
networksetup -setdnsservers Wi-Fi Empty
networksetup -listallnetworkservices
networksetup -getdnsservers Wi-Fi
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --list
sudo ifconfig bridge create
sudo ifconfig bridge1 addm en0
sudo ifconfig bridge1 inet 192.168.70.1/24 up
sudo networksetup -setairportnetwork Wi-Fi "NewNetworkSSID" "password"
sudo networksetup -setairportnetwork en0 "NewNetworkSSID" password
sudo networksetup -setairportnetwork en0 "NewNetworkSSID" password
sudo networksetup -setmanual Wi-Fi 192.168.1.64 255.255.255.0 192.168.1.254
sudo networksetup -setmanual Wi-Fi 192.168.1.81 255.255.255.0 192.168.1.254
sudo networksetup -setdnsservers Wi-Fi 103.247.36.36 103.247.37.37
sudo networksetup -setdnsservers Wi-Fi 8.8.8.8 8.8.4.4 2001:4860:4860::8888 2001:4860:4860::8844
sudo networksetup -setdnsservers Wi-Fi 172.64.36.1 172.64.36.2 2a06:98c1:54::18:83
networksetup -getinfo Wi-Fi
sudo networksetup -setdhcp Wi-Fi
sudo networksetup -removepreferredwirelessnetwork en0 ATTiepSY4I
sudo networksetup -setairportpower en0 off
sudo networksetup -setairportpower en0 on
sudo networksetup -setairportnetwork en0 ""
networksetup -createnetworkservice <newnetworkservicename> <hardwareport>
sudo networksetup -createnetworkservice Wi-Fi Wi-Fi
sudo networksetup -createnetworkservice "My Wi-Fi" Wi-Fi
networksetup -listnetworkserviceorder
networksetup -listallnetworkservices
networksetup -listallhardwareports
networksetup -detectnewhardware
ipconfig getifaddr en0
apropos ip
ifconfig en0 | grep flags
sudo ifconfig en0 -multicast
sudo ifconfig en0 multicast
networksetup -listallnetworkservices
networksetup -getinfo Wi-Fi
sudo networksetup -setv6off Wi-Fi
sudo networksetup -setv6automatic Wi-Fi
ifconfig | grep inet6
sudo networksetup -setnetworkserviceenabled Wi-Fi off
sudo networksetup -setnetworkserviceenabled Ethernet off
sudo networksetup -setnetworkserviceenabled Wi-Fi on
sudo networksetup -setnetworkserviceenabled Ethernet on
defaults read /Library/Preferences/SystemConfiguration/preferences.plist
defaults read /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo ifconfig en0 ifdisabled
sudo ifconfig en0 -ifdisabled
sudo arp -a -d
sudo ndp -a -f
sudo route flush
sudo dscacheutil -flushcache
sudo killall -HUP mDNSResponder
netstat -rn
sudo ipconfig set en0 DHCP
sudo ndp -f # Flush NDP cache
sudo arp -a -d # Flush ARP cache
sudo dscacheutil -flushcache # Flush DNS cache
sudo killall -HUP mDNSResponder # Flush mDNS cache
sudo route flush # Flush routing cache
sudo ipconfig set en0 DHCP # Flush DHCP cache
ifconfig en0 | grep flags
sudo ifconfig bridge0 flush
ifconfig | grep inet6 && ifconfig -a | grep inet6
sudo ifconfig en0 inet delete 143.244.220.150
sudo ifconfig en0 inet6 delete 2600:1700:c3e0:35e0:1438:e108:e186:249d
sudo ifconfig en0 inet6 delete 2600:1700:c3e0:35e0:713a:4b1d:2981:6b28
sudo ifconfig en0 inet6 delete 2600:1700:c3e0:35e0::49
sudo ifconfig en0 inet6 delete fe80::8b2:37ba:684:b060
sudo ifconfig lo0 inet6 delete ::1
sudo ifconfig en0 inet6 -autoconf
sudo ifconfig en0 inet6 autoconf
sudo ifconfig en0 inet6 -autoconf
sudo ifconfig awdl0 inet6 -autoconf
sudo ifconfig llw0 inet6 -autoconf
sudo ifconfig utun0 inet6 -autoconf
sudo ifconfig utun1 inet6 -autoconf
sudo ifconfig utun2 inet6 -autoconf
sudo ifconfig utun3 inet6 -autoconf
sudo ifconfig en0 down
sudo ifconfig en0 up
sudo ifconfig awdl0 down
sudo ifconfig awdl0 up
sudo ifconfig llw0 down
sudo ifconfig llw0 up
sudo ifconfig utun0 down
sudo ifconfig utun0 up
sudo ifconfig utun1 down
sudo ifconfig utun1 up
sudo ifconfig utun2 down
sudo ifconfig utun2 up
sudo ifconfig utun3 down
sudo ifconfig utun3 up
route -n get default
sudo route flush
sudo route flush -inet
sudo route flush -inet6
netstat -rn
ipconfig getifaddr en0
networksetup -getairportpower en0
networksetup -setairportpower <device name> <on off>
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.wifi.airport.p2p.plist Disabled -bool YES
sudo ifconfig awdl0 down
sudo ifconfig llw0 down
networksetup -setnetworkserviceenabled "Wi-Fi" off
networksetup -setnetworkserviceenabled "Wi-Fi" on
networksetup -listallhardwareports
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.network.identification.plist
sudo rm -f /Library/Preferences/SystemConfiguration/com.apple.wifi.message-tracer.plist
sudo rm -f /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
sudo rm -f /Library/Preferences/SystemConfiguration/preferences.plist
sudo diskutil resetUserPermissions / `id -u`
man diskutil | grep -i reset
defaults write com.apple.Finder AppleShowAllFiles YES
killall Finder
for iface in $(ifconfig -l); do
ifconfig $iface inet6 | awk '/inet6 / {print $2}' | xargs -I {} sudo ifconfig $iface inet6 delete {};
done
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -deactivate
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -stop
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -help
codesign -dv -vvv /Applications/Firefox.app