Posts

Showing posts with the label How

How to Automatically Start and Stop a Tencent Cloud Virtual Machine (CVM)?

Image
  Introduction If you have an operation that you know that will only be operating for a set period of time within a week. If you could schedule the Cloud Virtual Machine (CVM) to start and stop automatically, this could result in tremendous cost savings for you. I will be writing this guide using Tencent Cloud's Python API. The other languages should more or less be the same. What will you need? 1. Your target CVM ID. You can get it by clicking on the small copy icon beside the ID column of your CVM listings as shown in the picture below.   2. Your Tencent SecretId and SecretKey. You can create it through your manage API key page  or the steps shown in the picture below.  Step by step Creating the start instance serverless cloud function Creating the serverless cloud function 1. Go to the Function Service of your Serverless Cloud Function.   2. Click create 3. Choose your template. I generally create mine from scratch.  4. Fill in the basic confi...

How to Solve ModuleNotFoundError: No module named 'tencentcloud' on Tencent Serverless Cloud Function?

Image
Introduction You are excited to use Tencent Serverless Cloud Function to do your automation. You are following the Tencent API Explorer  and you are ready to rock yet when you test your Python code; you encountered  ModuleNotFoundError: No module named 'tencentcloud' . This is a guide on how to solve this error and explanations of why you need to do those steps.  How to solve this error According to Tencent Cloud's Serverless Cloud Function's  Dependency Installation guide , there are two ways to solve this problem.  Package the dependency libraries and code together for upload - I haven't tried this so if you did and it works, please feel free to write a post and comment here. Use dependency management tools. Use dependency management tools to solve this error I'm going to use the same steps as shown in the guide. I will add pictures and edit the steps so that it will be easier for you.  Log in to the SCF console and select Function Service on the left s...

How to Solve the Problem of Github Actions Django Test Failing to Destroy PostgreSQL Database?

Image
TL;DR Description I had a Github action that runs my Django test without problem for ages and suddenly I have the problem of it not being able to destroy the test database because there are "There are 6 other sessions using the database." My Solution 1. I removed the  conn_max_age=600 from my  dj_database_url.config.  Possible Variations 1. Find your PostgreSQL connection configuration. If there is a configuration similar to the maximum time the system will keep the connection alive, set it to 0 or remove it so that the default 0 will be used. This essentially means it will close the connection once it is done.  The Full Story Introduction I have one repository where I am doing my final project for CS50 Web . I changed my project from a task manager to a 90-day notification tracker because it is something that I see myself using. After I've changed the model and committed my code, I started to see the following error in my Github Actions test.  Thinking Pr...