Win32
important tasks
- Launch / Open in VSCode
Win32API / Dotnet .NET Experiments
- https://github.com/hychan48/node-win-32-api-lab/tree/main
- Node win32api / dotnet
- spawnsync, fork, exec
powershell
&"c:/Users/Jason/AppData/Local/Programs/Microsoft VS Code/Code.exe" .
."c:/Users/Jason/AppData/Local/Programs/Microsoft VS Code/Code.exe" .
c:/Users/Jason/AppData/Local/Programs/Microsoft` VS` Code/Code.exe .
# this seems to be the bset
c:/Users/Jason/AppData/Local/Programs/Microsoft` VS` Code/Code.exe package.json
&"$Env:LocalAppData/Programs/Microsoft VS Code/Code.exe" package.json
- look at macros
Docker Volume Mount
- todo add the rest
powershell
docker run -v c:/Users/jason:/tmp -it --rm jrottenberg/ffmpeg -i "http://host.docker.internal/IPX-469/index-v1-a1.m3u8" -codec copy -f mp4 /tmp/out.mp4
# https://hub.docker.com/_/debian
# bookworm / latest
# docker image pull debian:bookworm-slim
## public repo is okay?
docker rm bookworm12
docker stop bookworm12
docker image pull debian:12-slim
# mount volume
docker run -v c:/Users/Jason/.ssh:/tmp/.ssh:ro -it --name bookworm12 --hostname bookworm12 debian:12-slim bash
bash
# docker
which bash
which ssh
which curl[docker-registry.yaml](..%2F..%2F..%2F..%2F..%2FOneDrive%2FDocuments%2F2019%2Fwebdev%2FDocker%2Fdocker-registry.yaml)
echo $? # curl not installed[docker-registry.yaml](..%2F..%2F..%2F..%2F..%2FOneDrive%2FDocuments%2F2019%2Fwebdev%2FDocker%2Fdocker-registry.yaml)
apt update
apt install curl git -y #
# which rsync
cp -r /tmp/.ssh ~/
ls -l ~/.ssh
# check for crlf or disable in bashrc
chmod -R 700 ~/.ssh
rm ~/.ssh/known_hosts*
# validate
ssh -vvv gitjc hostname
ssh -vvv -i ~/.ssh/id_ed25519 ubuntu@git.drawtomusic.ca hostname
ssh -i ~/.ssh/id_ed25519 ubuntu@git.drawtomusic.ca hostname
ssh gitjc hostname
# careful of known_hosts
# install node / pnpm
# install git
curl -fsSL https://get.pnpm.io/install.sh | bash - # from sh
source /root/.bashrc
pnpm env use --global lts
node -v
cd ~/
git clone git@github.com:codeforwings/vite-press-docs.git --depth 1
git clone git@github.com:codeforwings/vite-press-docs.git --depth 1 --branch cloudflare-pages-try
cd vite-press-docs
git status
git pull
pnpm i
pnpm run docs:build
- todo make docker file?
bash
ls ~/.ssh
ls -l ~/.ssh
cat ~/.ssh/id_ed25519.pub
find . -name "package.json"
find . -name "toc.sh"
# capital?
ls docs/.vitePress/toc.json
ls -a docs/.vitePress
ls -a docs/
ls docs/.vitepress/toc.json
cat docs/.vitepress/toc.json
# * or directy and see?
todo / move to Cloudflare
- check 2fa
- check other auth methods
- allow email list
- exclude all
bash
ssh gitjc
curl https://vite-press-docs.pages.dev |grep -w vite-press
Cloudflare Access Page
- https://one.dash.cloudflare.com/896d9011dd172ea4845b35581d07eb92/access/apps/rules
- https://developers.cloudflare.com/cloudflare-one/policies/access/
- https://one.dash.cloudflare.com/896d9011dd172ea4845b35581d07eb92/settings/authentication
- timeout to 15 minutes... from 24
- https://one.dash.cloudflare.com/896d9011dd172ea4845b35581d07eb92/access/apps/edit/ad8fd99f-9b16-400b-9ee9-888efb9adb6c
- timeout to 0
- Include
- Require
- Exclude
can revoke existing tokens etc...
need to delete the others
interesting
there are some wrapperes
might want to make a wrapper / dashboard
parse their api json
Dev drive
- ntfs path to ReFS
Create Junction
ps1
# Fake GitHub Folder
junction $HOME/github d:/dev_drive_git_repos/github
# Linking RootDrive to Drive
# <link> <destination>
junction c:/dev_drive_git_repos/ d:/dev_drive_git_repos/
Uninstall / Remove Junction
ps1
junction -d c:/dev_drive_git_repos/ # remove the link
Windows 11 Exclusion List
## Privacy & Security
Window Security
Virus and Threat Protection
Add Exclusion
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Defender\Exclusions\Paths
powershell cd pop push
ps1
Push-Location
& {
Set-Location -Path H:/github/shared-notes
Get-ChildItem
}
Pop-Location
Save-Repo - Git Auto
- to move
import-module location/md.ps1...
ps1
# part of macro.ps1 that is imported into module
function Save-Repo {
# parameter list... or get from env... yeah... use javascript for this
# git fetch origin
git.exe fetch origin
# git.exe status | Select-String -Pattern modified
git.exe commit -a -m "auto commit"
git.exe push origin
}
```## Fake Alias as Function PS1
* in-line calling
:::code-block
```powershell
&"$HOME/Downloads/ttyd.win32.exe" --version
function ttyd() {&"$HOME/Downloads/ttyd.win32.exe" @args}
ttyd --version
Remove-Item -Path Function:\ttyd
####
# -p, --port Port to listen (default: 7681, use `0` for random port)
ttyd pwsh.exe
# http://localhost:7681/
# https://github.com/tsl0922/ttyd/wiki/Example-Usage
#### ubuntu base image
docker run -it --rm -p 7681:7681 tsl0922/ttyd
exit
kill 1
powershell
&"$HOME/Downloads/ttyd.win32.exe" --version
function ttyd() {
# the & is important. also $HOME ~ fails. note i also swapped the slashes
&"$HOME/Downloads/ttyd.win32.exe" @args
}
ttyd --version
Remove-Item -Path Function:\ttyd
:::
WSL
bash
wsl -- cat /etc/wsl.conf
wsl
cat /etc/wsl.conf
code /etc/wsl.conf
wsl --shutdown
- https://learn.microsoft.com/en-us/windows/wsl/wsl-config
- The
Boot
setting is only available onWindows 11 and Server 2022
.
- The
ini
[boot]
systemd=true
[user]
#default=jason
default=root
; command='service docker start #bootcmd string'
; command='export ${dbus-launch)'
[interop]
# disable windows... causes issues oftenly... let's see
# especially in dev container
enabled=false
appendWindowsPath=false
dconf-warning - virt-manager
bash
# should be this:
# systemd causes issues on wsl..
# dconf-warning - virt-manager
export $(dbus-launch)
wsl version
bash
wsl --version
yaml
WSL version: 2.0.14.0
Kernel version: 5.15.133.1-1
WSLg version: 1.0.59
MSRDC version: 1.2.4677
Direct3D version: 1.611.1-81528511
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22631.3085