This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import oci | |
import sys | |
import argparse | |
from typing import List, Dict, Optional | |
class OCIVMAlarmManager: | |
def __init__(self, compartment_id: Optional[str] = None, non_interactive: bool = False): | |
""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import re | |
import getpass | |
# Set new values here | |
newFanSpeed = "0" | |
newInfillPattern = "gyroid" | |
# Get the current user's username (Windows) | |
username = getpass.getuser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import json | |
# Define new values for the first JSON file (infill settings) | |
new_infill_pattern = "gyroid" | |
new_infill_density = "15%" | |
# Define new values for the second JSON file (fan speed) | |
new_fan_speed = ["0"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the currently logged in user's username | |
$username = [Environment]::UserName | |
# Set the new pattern value here, e.g., "adaptivecubic" or "gyroid" | |
$newInfillPattern = "gyroid" | |
# Construct the file path | |
$filePath = "C:\Users\$username\AppData\Roaming\BambuStudio\system\BBL\process\fdm_process_common.json" | |
# Check if the file exists |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the currently logged in user's username | |
$username = [Environment]::UserName | |
# Set the new values here | |
$newFanSpeed = "0" # Change this to set a different cooling fan speed | |
$newInfillPattern = "adaptivecubic" # Change this to set a different infill pattern | |
# Filament file path and regex pattern | |
$filamentFilePath = "C:\Users\$username\AppData\Roaming\BambuStudio\system\BBL\filament\fdm_filament_pla.json" | |
$fanSpeedRegexPattern = '"additional_cooling_fan_speed": \[\s*"\d+"\s*\]' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get the currently logged in user's username | |
$username = [Environment]::UserName | |
# Construct the file path | |
$filePath = "C:\Users\$username\AppData\Roaming\BambuStudio\system\BBL\filament\fdm_filament_pla.json" | |
# Check if the file exists | |
if (Test-Path $filePath) { | |
try { | |
# Read the file's content into a variable as a text string |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Login to Azure Account | |
Connect-AzAccount | |
# Select Subscription (Optional if you have multiple subscriptions) | |
# Replace <your_subscription_name> with your actual subscription name | |
#Select-AzSubscription -SubscriptionName "<your_subscription_name>" | |
# Define Variables | |
# Replace <your_resource_group_name>, <your_storage_account_resource_group_name> and <your_vm_name> with your actual values | |
$resourceGroupName = "<your_resource_group_name>" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT | |
# Define the file extension and program paths | |
$fileExtension = ".sap" | |
$programPath = "C:\\Windows\\System32\\notepad.exe" | |
# Define the registry paths | |
$defaultRegPath = "HKCR:\\" + $fileExtension | |
$commandRegPath = "HKCR:\\" + $fileExtension + "\\shell\\open\\command" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param | |
( | |
[Parameter (Mandatory= $true)] | |
[string] $VMName, | |
[string] $UserName | |
) | |
$Name=$UserName.Split("@")[0] | |
$archiveUser = $Name |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Import Azure Storage module | |
Import-Module Az.Storage | |
# Set storage account name and key | |
$storageAccountName = "mystorageaccount" | |
$storageAccountKey = "mystorageaccountkey" | |
# Set container name and file name | |
$containerName = "mycontainer" | |
$fileName = "myfile.txt" |
NewerOlder