Latest Blog

Get file size using Python
December 25, 2023 | No Comments

Use os.path.getsize function

Read More

Print a Python object as JSON
December 25, 2023 | No Comments

by default, when printing a Python object, it will show as an address to the object, like this contains only the class of the object (Student in the above example) and it memory address (0x10e430f65) and not much else. To display the content of the object in a nicely looked JSON format, we can overwrite […]

Read More

How to run DOS programs on Mac OS
December 25, 2023 | No Comments

Can use DosBox, which is a DOS emulator that runs on Mac OS. Download Download from its official site. Choose the “Mac OS X” one. It is a dmg file, then can open the “DosBox” app inside the dmg file. Can also move it to Applications folder. Mount the Drive on DOS Mount the drive. […]

Read More

Flask API with Bear Token authentication
December 17, 2023 | No Comments

Here is an simple example of Flask API using bear token to authenticate the access. Authentication is achieved by using the annotation in python. Annotation under the cover is calling the “authenticate” method. To test the API, can use this curl command

Read More

How to use markdown to write an article?
December 17, 2023 | No Comments

Title To create a title, you can use one or more hash (#) symbols at the beginning of a line, followed by a space and the title text. The number of hash symbols determines the heading level. Paragraph Paragraphs in Markdown are created by simply typing the text. You can separate paragraphs by a blank […]

Read More

I have a directory for react app, how can I make a copy of it as the template to start my next project? I did cp -r, when npm start, got Error: Cannot find module ‘../scripts/start’
December 17, 2023 | No Comments

The correct way to do it should be By following these steps, you create a clean template of your React app without copying the node_modules directory, and then you install the dependencies specifically for the new project. This approach ensures a clean and consistent setup for your new projects.

Read More

create react app using npx or npm
December 17, 2023 | No Comments

npx will be available after installing Node.js This will start the development server, and you should see your new React app running in your default web browser at http://localhost:3000 or whatever port is using.

Read More

Useful AKS (Azure Kubernetes Service) related Commands
December 17, 2023 | No Comments

Login to Azure Using az CLI kubectl

Read More

How can I use azure devops (ADO) pipeline, I know in jenkins, I can write the groovy file, how about ADO?
December 17, 2023 | No Comments

In Azure DevOps (ADO), you can define your build and release pipelines using YAML. The YAML file specifies the build or release tasks, dependencies, and other configuration settings. Here’s a basic overview of how you can use Azure DevOps pipelines: Create a YAML file:Create a YAML file named azure-pipelines.yml in the root of your source […]

Read More