Skip to content

Instantly share code, notes, and snippets.

@elfmimi
elfmimi / CredReadTest.ps1
Last active May 3, 2023 15:33
POC: PowerShell script to retrieve your access token from Windows Credential Manager
# Howto execute this script:
# Unblock-File .\CredReadTest.ps1
# powershell -ExecutionPolicy RemoteSigned .\CredReadTest.ps1
#
# The following command displays a list of credentials:
# cmdkey /list
Write-Output "CredRead Test Program"
$type_def = @'
@yswallow
yswallow / Mastdon-Heroku-Closing.md
Last active August 25, 2022 15:25
2022年にMastodonインスタンスをHerokuに建てた話

Herokuに建てたMastodon鯖を閉じるとき

目標

月額料金がかからないようにする

はじめ

$ heroku pg
{
"configurations": [
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceFolder}",
"${workspaceFolder}/keyboards/getta25",
"${workspaceFolder}/keyboards/getta25/rev1",
const IDLE1: [u8; 636] = [
0, 0, 126, 126, 24, 60, 102, 66, 0, 12, 28, 112, 112, 28, 12, 0, 116, 116, 20, 20, 124, 104, 0,
124, 124, 0, 112, 120, 44, 36, 124, 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 128, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16, 16, 8, 8, 4, 4, 4, 8, 48,
64, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 0, 0, 0, 0, 192, 96, 48, 24,
12, 132, 198, 98, 35, 51, 17, 145, 113, 241, 113, 145, 17, 51, 35, 98, 198, 132, 12, 24, 48,
96, 192, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 100, 130, 2, 2, 2, 2, 2, 1,
0, 0, 0, 0, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 48, 48, 0, 192, 193, 193, 194, 4, 8,
16, 32, 64, 128, 0, 0, 0, 128, 128, 128, 128, 64, 64, 64, 64, 32, 32, 32, 32, 16, 16, 16, 16,
@74th
74th / Keyboard.md
Last active March 8, 2022 04:05
Lily58インスパイア自作キーボードキットの頒布について

一昨年の冬以降、Lily58 Proを2つ買わせていただき、私にとって自作キーボードにハマるきっかけとなり、非常に楽しく使わせていただいていました。

どうしても以下の点を実現したく、自作キーボードを設計しました。

  • 薄型キースイッチ Kailh Choc V2 を使うこと
  • キー交換可能なようにソケットを使うこと
  • Lily58のように、縦に揃ったキー配置であること
  • Lily58のように、十分キーの数が多いこと
  • Lily48のように、Pro Microをキーの横に配置してキーボード自体を薄くすること
  • キーを片手に2つ追加することで、一般的なキー配置にキーの場所を近づけること
@joba-1
joba-1 / gd32vf103.cfg
Last active October 11, 2020 09:28 — forked from elfmimi/gd32vf103.cfg
OpenOCD script for GD32VF103 with improved reset procedure without power cycle
# Invoke it like this.
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.elf verify reset exit"
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "program binary.bin 0x08000000 verify reset exit"
# openocd -f interface/ftdi/digilent-hs2.cfg -c "ftdi_device_desc {Digilent USB Device}" -f gd32vf103.cfg -c "init; reset run; exit"
# Sure, you may also use other JTAG interfaces.
#
# For platformio copy this file to the openocd target directory
# cd ~/.platformio/packages/tool-openocd-gd32v/share/openocd/scripts/target
# wget -O gd32vf103-elfmimi.cfg https://gist.github.com/joba-1/02454d9d028b37b70be4e4bb4b1d0ce2/raw/gd32vf103.cfg
# Then use these entries in your platformio.ini project file for use with a sipeed usb-jtag adapter:

マイコンと USB コネクタとの接続部分の設計

マイコンに ATMega32u4 を、USB コネクタに Type-C を使った左右分割型キーボードを設計するために必要となりそうな知識をメモ。

なお、ケースが金属製か否かで静電気対策が変わってくる(はず)。

電源部分

マイコンの電源は、マスター側の場合はUSB ケーブルで供給し、スレーブ側の場合は TRRS ケーブルで供給する。

@abarisani
abarisani / usb_fingerprinting.md
Last active May 5, 2022 11:47
Fingerprinting USB enumeration from different hosts

Introduction

The following information illustrates the differences between macOS, Windows and Linux in USB device enumeration sequence.

Specifically the comparison covers USB Mass Storage device enumeration, implemented with the TamaGo USB driver on a USB armory Mk II running armory-ums.

(module MS88SF21 (layer F.Cu) (tedit 5EAC590F)
(fp_text reference U1 (at 0.1 8.25) (layer F.SilkS)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text value MS88SF2 (at 0.5 6.5) (layer F.Fab)
(effects (font (size 1 1) (thickness 0.15)))
)
(fp_text user D+ (at 10.7 8.09) (layer F.Fab)
(effects (font (size 0.5 0.5) (thickness 0.1)))
)
@a1ad
a1ad / SimpleTcpRedirector.py
Last active March 6, 2021 03:10 — forked from sivachandran/SimpleTcpRedirector.py
A simple TCP redirector in python
#!/usr/bin/env python
# JR: made some very minor changes for python3
import socket
import threading
import select
import sys
terminateAll = False