Merge branch 'main' of ssh://liamsgit.dev:2222/LiamPietralla/code-snippets
This commit is contained in:
@@ -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)
|
||||
Reference in New Issue
Block a user