Skip to content

Instantly share code, notes, and snippets.

@magicalyu
magicalyu / RebootLinux.bat
Created April 26, 2025 00:32 — forked from jarulsamy/RebootLinux.bat
Reboot to Linux From Windows
:: _Sigh_ Windows dumbness...
powershell .\RebootLinux.ps1
@magicalyu
magicalyu / get-password.ps1
Created January 29, 2025 14:56 — forked from geekman/get-password.ps1
minimal PowerShell code to retrieve passwords from Windows Credentials
#
# PowerShell script to read out generic Windows Credentials
# this is kinda like macOS Keychain, but for Windows
#
# darell tan 2021.04.08
#
[String] $CredNativeCode = @"
using System;
@magicalyu
magicalyu / README.md
Created January 29, 2025 14:56 — forked from andshrew/README.md
VMware Workstation VM encryption passwords saved in the the Windows Credential Manager

Retrieving VMware Workstation VM encryption passwords saved in the the Windows Credential Manager

When creating an encrypted VM, VMware Workstation gives you the option to remember the password. It does this by storing the password in the Windows Credential Manager.

VMware does not provide a way to retrieve this stored password, but it can be accessed via the Win32 CredReadW API function.

There are a number of PowerShell projects including PowerShell Credential Manager which provide access to this API, but in testing I found they were unable to correctly display the VMware password.

This PowerShell example has been tested using Windows PowerShell (v5.1) and PowerShell (v7) using VMwa

@magicalyu
magicalyu / Makefile.dump
Created June 24, 2024 13:21 — forked from hansemro/Makefile.dump
cocotb Makefile with waveform dumping for vcs/icarus/verilator
## include this in your normal cocotb Makefile in place of standard cocotb
## include to support waveform dumping with SIM=<vcs|icarus|verilator>
## For vcs:
## To select between *.vcd and *.vpd waveform dumps, set WAVES=<VCD|VPD>
## variable. This variable can be an environmental varaiable, a variable
## defined in the Makefile, or a variable passed to make.
## For icarus or verilator:
## To select between *.vcd and *.fst waveform dumps, set WAVES=<VCD|FST>
def plot_timings(loader, n_batches, model_time=0.2, max_time=2.5):
fig, ax = plt.subplots()
ax.set_axisbelow(True)
ax.yaxis.grid(which="major", color='black', linewidth=1)
zero_time = time.time()
worker_ids = {}
worker_count = count()
@magicalyu
magicalyu / xbox-one-wireless-protocol.md
Created June 11, 2019 11:08 — forked from alfredkrohmer/xbox-one-wireless-protocol.md
XBox One Wireless Controller Protocol

Physical layer

The dongle itself is sending out data using 802.11a (5 GHz WiFi) with OFDM and 6 Mbit/s data rate:

Radiotap Header v0, Length 38
    Header revision: 0
    Header pad: 0
    Header length: 38
    Present flags