Skip to content

Instantly share code, notes, and snippets.

View zhangfeiran's full-sized avatar

Feiran Zhang zhangfeiran

  • Company
  • Location
View GitHub Profile
Set WMI = GetObject("WinMgmts:root\WMI")
Set Objs = WMI.ExecQuery("SELECT * FROM MSStorageDriver_ATAPISmartData")
For Each Obj In Objs
a = Obj.VendorSpecific
Next
For i = 2 To UBound(a)
If a(i) = 4 Then
MsgBox "Start stop count " & (a(i+11)+a(i+10)+a(i+9)+a(i+8)+a(i+7)+a(i+6))*256+a(i+5) & " times"
End If
If a(i) = 9 Then
@zhangfeiran
zhangfeiran / 500kb-breaker.py
Created August 25, 2018 16:30
500kb-breaker.py
import psutil,time,os
while True:
a = psutil.net_io_counters(pernic=True)['WLAN'].bytes_recv / 1048576
time.sleep(1)
b = psutil.net_io_counters(pernic=True)['WLAN'].bytes_recv / 1048576
print(b - a)
if b - a < 0.8:
os.system('netsh wlan connect name=Tsinghua-5G ssid=Tsinghua-5G')
time.sleep(8)