Merge branch 'main' of ssh://liamsgit.dev:2222/LiamPietralla/code-snippets
This commit is contained in:
@@ -67,6 +67,14 @@ export default defineConfig({
|
||||
{ text: 'Identify Untagged Resources', link: '/azure/identify-untagged-resources' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'Backblaze',
|
||||
link: '/b2/',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Development Bucket', link: '/b2/development-bucket' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'CSS',
|
||||
link: '/css/',
|
||||
@@ -211,6 +219,14 @@ export default defineConfig({
|
||||
items: [
|
||||
{ text: 'String Literal Types', link: '/typescript/string-literal-types' },
|
||||
]
|
||||
},
|
||||
{
|
||||
text: 'WSL',
|
||||
link: '/wsl/',
|
||||
collapsed: true,
|
||||
items: [
|
||||
{ text: 'Clear Unused Disk Space', link: '/wsl/clear-unused-disk-space' },
|
||||
]
|
||||
}
|
||||
],
|
||||
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Development Bucket
|
||||
|
||||
To create a bucket for development that can be used by all origins we need to enable CORS for the bucket. First create the bucket and some access keys then download the `b2-windows.exe` tool from the website.
|
||||
|
||||
First login using the keys:
|
||||
|
||||
```powershell
|
||||
b2 authorize-account <accountId> <applicationKey>
|
||||
```
|
||||
|
||||
Next lets set the cors rules for the bucket:
|
||||
|
||||
```powershell
|
||||
$rules =
|
||||
@'
|
||||
[
|
||||
{
|
||||
"corsRuleName": "allowall-s3",
|
||||
"allowedOrigins": ["*"],
|
||||
"allowedHeaders": ["*"],
|
||||
"allowedOperations": [
|
||||
"s3_get",
|
||||
"s3_put",
|
||||
"s3_head",
|
||||
"s3_delete"
|
||||
],
|
||||
"exposeHeaders": ["ETag", "x-amz-server-side-encryption", "x-amz-request-id"],
|
||||
"maxAgeSeconds": 3600
|
||||
}
|
||||
]
|
||||
'@
|
||||
b2 update-bucket --cors-rules $rules <bucketName>
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
# Backblaze Snippets and Musings
|
||||
|
||||
#### [Development Bucket](./development-bucket.md)
|
||||
@@ -22,6 +22,10 @@ hero:
|
||||
text: Azure
|
||||
link: /azure/
|
||||
|
||||
- theme: alt
|
||||
text: Backblaze
|
||||
link: /b2/
|
||||
|
||||
- theme: alt
|
||||
text: CSS
|
||||
link: /css/
|
||||
@@ -90,6 +94,10 @@ hero:
|
||||
text: Typescript
|
||||
link: /typescript/
|
||||
|
||||
- theme: alt
|
||||
text: WSL
|
||||
link: /wsl/
|
||||
|
||||
# features:
|
||||
# - title: Feature A
|
||||
# details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
# Clear Unused Disk Space
|
||||
|
||||
WSL will grow but never shrink the size of the virtual disk. This can be a problem if you have a lot of unused space in your WSL virtual disk. You can reclaim this space by running the following command in PowerShell admin:
|
||||
|
||||
```powershell
|
||||
wsl --shutdown
|
||||
|
||||
# Navigate to the location of the ext4.vhdx file. This is usually in C:\Users\<username>\AppData\Local\Packages\<distro>\LocalState\ext4.vhdx
|
||||
|
||||
# Run the following command to compact the virtual disk
|
||||
Optimize-VHD -Path .\ext4.vhdx -Mode Full
|
||||
```
|
||||
@@ -0,0 +1,3 @@
|
||||
# WSL Snippets and Musings
|
||||
|
||||
#### [Clear Unused Disk Space](./clear-unused-disk-space.md)
|
||||
+2
-1
@@ -11,5 +11,6 @@
|
||||
"dev": "vitepress dev --host 0.0.0.0",
|
||||
"build": "vitepress build",
|
||||
"preview": "vitepress preview"
|
||||
}
|
||||
},
|
||||
"packageManager": "pnpm@10.32.1+sha512.a706938f0e89ac1456b6563eab4edf1d1faf3368d1191fc5c59790e96dc918e4456ab2e67d613de1043d2e8c81f87303e6b40d4ffeca9df15ef1ad567348f2be"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user