Posts

bicep extending the template earlier to support azure service bus

In the previous post we creating azure storage account using bicep. Now we are going to create a service bus module and calling it.  So we will place our service bus under the path modules/servicebus/main.bicep and its contents are given here. This will create a service bus namespace and a queue @description('Name of the Service Bus namespace') param serviceBusNamespaceName string @description('Name of the Queue') param serviceBusQueueName string @description('Location for all resources.') param location string = resourceGroup().location resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2022-01-01-preview' = {   name: serviceBusNamespaceName   location: location   sku: {     name: 'Standard'   }   properties: {} } resource serviceBusQueue 'Microsoft.ServiceBus/namespaces/queues@2022-01-01-preview' = {   parent: serviceBusNamespace   name: serviceBusQueueName   properties: {     lockDuration: 'PT5M'   ...

bicep creating storage account using module

To create a storage account we can make our bicep code more re-usable by placing in into modules So we have this as our directory structure root (main.bicep) -> module -> storage -> (we call this main.bicep too)  root main.bicep contains the following code // main.bicep module storageModule './modules/storage/main.bicep' = {   name: 'storageDeploy-${uniqueString(resourceGroup().id)}'    params: {     storageSku: 'Standard_LRS'   } } // Accessing an output from the module output storageId string = storageModule.outputs.saName   And our storage module (modules/storage/main.bicep)  // main.bicep @description('Storage Account Name (must be globally unique)') param storageName string = 'store${uniqueString(resourceGroup().id)}' @description('The location for the resource') param location string = resourceGroup().location @description('Storage SKU') @allowed([   'Standard_LRS'   'Standard_GRS' ]) param storage...

azure bicep quickstart to create many different resources in Azure

This link provides lots of resource and sample code to work with Bicep  https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts

model safe tensor - how to determine if model uses safe tensor

Image
  Potential you can check its main branch for example for Qwen, it will be this here https://huggingface.co/Qwen/Qwen3.5-2B/tree/main And then you can see there's safetensor as shown below:-

aws sqs to read and write to a queue

Image
 To create a cloud formation sqs, we can use the following code AWSTemplateFormatVersion : ' 2010-09-09 ' Description : ' Creates SQS Queue with specific User Access ' Parameters :   AccountId :     Type : String     Description : Your 12-digit AWS Account ID     Default : ' 00000000 '   UserName :     Type : String     Description : IAM User to grant access     Default : ' jeremydev ' Resources :   MySQSQueue :     Type : AWS::SQS::Queue     Properties :       QueueName : mytestsqs1       VisibilityTimeout : 300   MySQSQueuePolicy :     Type : AWS::SQS::QueuePolicy     Properties :       Queues :         - ! Ref MySQSQueue       PolicyDocument :         Version : ' 2012-10-17 '         Statement :           - Sid : Allo...

aws cloudformation creating lamda

 First of all we need to run the following scripts to create our lambda function in python/  AWSTemplateFormatVersion : ' 2010-09-09 ' Description : ' AWS Lambda Function with IAM Role and Log Group ' Resources :   # 1. IAM Role for Lambda Execution   LambdaExecutionRole :     Type : AWS::IAM::Role     Properties :       AssumeRolePolicyDocument :         Version : ' 2012-10-17 '         Statement :           - Effect : Allow             Principal :               Service : [ lambda.amazonaws.com ]             Action : [ ' sts:AssumeRole ' ]       ManagedPolicyArns :         - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole   # 2. CloudWatch Log Group (Prevents logs from being kept forever)   LambdaLogGroup :  ...

aws eks create using cloud formation

To create a EKS using cloud formation, we can use the following cloud formation code. This is not an EKS Auto AWSTemplateFormatVersion : ' 2010-09-09 ' Description : ' EKS Cluster and Managed Node Group ' Parameters :   ClusterName :     Type : String     Default : ' my-eks-cluster '   VpcId :     Type : AWS::EC2::VPC::Id   SubnetIds :     Type : List<AWS::EC2::Subnet::Id>     Description : ' Select at least two subnets in different AZs ' Resources :   # 1. IAM Role for the EKS Cluster (Control Plane)   EKSClusterRole :     Type : AWS::IAM::Role     Properties :       AssumeRolePolicyDocument :         Version : ' 2012-10-17 '         Statement :           - Effect : Allow             Principal :               Service : [ eks.amazonaws.com ] ...

openssl - viewing certificate that is stored as kubernetes secret

 We can use the following command to view kubernetes tls secret. kubectl get secret/woolworths-wildcard-chain -n istio-ingress -o jsonpath="{.data['tls\.crt']}" | base64 --decode | openssl x509 -text -noout

kubectl copying and transfering file to a pod without tar installed

In general we would have tar installed on a kubernetes pod. Sometimes when things are not happening, we can still copy to the container using the following command :-  Copy to container cat local-backup.tar.gz | kubectl exec -i -n cattle-resources-system \ rancher-backup-57c997f8cd-fxlb4 -c rancher-backup -- \ sh -c 'cat > /var/lib/backups/backup.tar.gz' Copying from container  kubectl exec -n cattle-resources-system rancher-backup-84576c498c-lpjh2 \ -c rancher-backup -- cat /var/lib/backups/default-location-recurring-backup-8723b2bd-e272-430e-89f6-14a133f8a417-2026-02-25T03-12-05Z.tar.gz \ > local-backup.tar.gz

qwen code - error installing

Image
When installing qwen code using the following command  curl -fsSL https://qwen-code-assets.oss-cn-hangzhou.aliyuncs.com/installation/install-qwen.sh | bash  it stuck in endless loop. This is due to installer not having permission to the /usr folder. To resolve it # 1. Create the directory for global packages mkdir -p ~/.npm-global # 2. Tell npm to use this new directory npm config set prefix '~/.npm-global' # 3. Open (or create) your shell profile file # If you use Bash (default on many Linux): echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc source ~/.bashrc Install gwen  npm install -g @qwen-code/qwen-code@latest And walla! 

aws cloudformation importing existing resources

Image
In this demo, i am going to import an existing storage called " appjerwo-demo-test " and once i have done that I will create another s3 bucket called " myjerwo-new-bucket-2026 ". To get started, I will need to have to prepare my import s3 template. import-template.yaml AWSTemplateFormatVersion : ' 2010-09-09 ' Description : Import existing S3 bucket Resources :   ImportedAppBucket :   # ← ONLY the resource being imported     Type : AWS::S3::Bucket     DeletionPolicy : Retain   # ← REQUIRED for imports     Properties :       BucketName : appjerwo-demo-test And then I will proceed to run the following command to create import changeset. My stack name is called my-app-stack.    aws cloudformation create-change-set \   --stack-name my-app-stack \   --change-set-name import-bucket \   --change-set-type IMPORT \   --template-body file://import-template.yaml \   --resources-to-import '[{   ...

using remix to deploy your contract to a sepolia network

Image
  Goto remix https://remix.ethereum.org and then create a solidty cupcake vendng machine using the following code: // SPDX-License-Identifier: MIT // Specify the Solidity compiler version - this contract requires version 0.8.9 or higher pragma solidity ^0.8.9; // Define a smart contract named VendingMachine // Unlike regular classes, once deployed, this contract's code cannot be modified // This ensures that the vending machine's rules remain constant and trustworthy contract VendingMachine {    // State variables are permanently stored in blockchain storage    // These mappings associate Ethereum addresses with unsigned integers    // The 'private' keyword means these variables can only be accessed from within this contract    mapping(address => uint) private _cupcakeBalances;     // Tracks how many cupcakes each address owns    mapping(address => uint) private _cupcakeDistributionTimes;  // Tracks wh...

remote: TF401019: The Git repository with name or identifier myrepository-name does not exist or you do not have permissions for the operation you are attempting.

  Working on old tech stack and still ran into this error  remote: TF401019: The Git repository with name or identifier myrepository-name does not exist or you do not have permissions for the operation you are attempting. If your repository exist, then all you need to do is grant the BUILD SERVICE most likely from referencing project acccess to the project that contains this repository.