Switch between multiple Claude Code subscriptions (personal / work / API key) on macOS using Keychain.
Lightweight alternative (~80 lines of bash) to heavier solutions. No dependencies beyond Python 3 and macOS security CLI.
Three pieces:
This is how you can take an OpenVPN .ovpn config file and extract the certificates/keys required to import the profile into NetworkManager.
| function New-PSObject { | |
| param( | |
| $properties | |
| ) | |
| return New-Object psobject -Property $properties; | |
| } | |
| $objects = | |
| (New-PSObject @{ |
| docker system prune -f --all | |
| wsl --shutdown | |
| Optimize-VHD -path ${env:LOCALAPPDATA}\Docker\wsl\data\ext4.vhdx -Mode Full |
| apt-get update && \ | |
| apt install wget apt-transport-https -y && \ | |
| wget https://packages.microsoft.com/config/ubuntu/20.10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb && \ | |
| dpkg -i packages-microsoft-prod.deb && \ | |
| apt-get update && \ | |
| apt-get install -y dotnet-sdk-5.0 && \ | |
| dotnet tool install --global dotnet-counters && \ | |
| /root/.dotnet/tools/dotnet-counters monitor --process-id 1 |
| POST /_sql/translate | |
| { | |
| "query": """SELECT * FROM "prod-iis-*" ORDER BY "sc-status" DESC""", | |
| "fetch_size": 99999 | |
| } | |
| =================================================== | |
| GET /_sql?format=csv | |
| { | |
| "query": """ | |
| $rc = $(git branch --all| Select-String "/rc-\d+$" | sort { [int]($_ -replace '\D+') } | select -ExpandProperty Line -Last 1) -replace '\D+' |
| Latency Comparison Numbers (~2012) | |
| ---------------------------------- | |
| L1 cache reference 0.5 ns | |
| Branch mispredict 5 ns | |
| L2 cache reference 7 ns 14x L1 cache | |
| Mutex lock/unlock 25 ns | |
| Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
| Compress 1K bytes with Zippy 3,000 ns 3 us | |
| Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
| Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
| version: '3' | |
| services: | |
| elasticsearch: | |
| image: docker.elastic.co/elasticsearch/elasticsearch:6.3.0 | |
| restart: always | |
| container_name: elasticsearch | |
| environment: | |
| - cluster.name=docker-cluster | |
| - bootstrap.memory_lock=true | |
| - "ES_JAVA_OPTS=-Xms512m -Xmx512m" |