Using the MinIO API via curl is straightforward, as MinIO is compatible with Amazon S3 API, so most commands follow a similar syntax. Here’s a guide on how to use curl with the MinIO API for some common operations like uploading, downloading, and managing objects. Prerequisites Access Key and Secret Key : Obtain your MinIO Access Key and Secret Key. MinIO Endpoint : Know your MinIO server endpoint, e.g., http://localhost:9000 . Bucket : You may need an existing bucket name, or create a new one using the commands below. Authentication Header For requests to work with MinIO, you need to include authentication in the headers. MinIO uses AWS Signature Version 4 for signing requests. Common Examples 1. List Buckets To list all buckets in your MinIO account, use: curl -X GET \ - -url "http://localhost:9000/" \ - H "Authorization: AWS <AccessKey>:<Signature>" 2. Create a Bucket To create a new bucket, use: curl -X PUT \ - -url "htt...
To install and run an FTP server using Docker, follow these steps. We’ll use the popular stilliard/pure-ftpd image, which is a lightweight and widely used FTP server. Step 1: Install Docker Make sure Docker is installed on your machine. If it isn’t, install it using the instructions below: Ubuntu/Debian: sudo apt update sudo apt install docker.io -y Mac: Install Docker Desktop from Docker's website . Windows: Install Docker Desktop from Docker's website . Verify Docker is installed: docker --version Step 2: Pull the FTP Server Docker Image Use the stilliard/pure-ftpd image, which is a simple and effective FTP server. docker pull stilliard/ pure -ftpd Step 3: Run the FTP Server Run the FTP server container using the following command: docker run -d --name ftp-server \ - p 21 : 21 -p 30000 - 30009 : 30000 - 30009 \ - e FTP_USER_NAME=testuser \ - e FTP_USER_PASS=testpass \ - e FTP_USER_HOME= /home/testuser \ stilliard/pure-ftpd Explanation...
In Python, an environment variable for a module or Python environment is a way to configure certain settings or provide data paths before running a Python program. Environment variables can be used to: Control Python's runtime behavior (e.g., specifying paths for module search). Pass configuration or sensitive data (like API keys) to Python applications. Set up virtual environments for Python project isolation. Here are some common environment variables related to Python and its modules: 1. PYTHONPATH : This variable defines the search path for modules. It allows you to specify additional directories for Python to look for modules and packages. If you want Python to find your custom modules, you can set this environment variable. Example: export PYTHONPATH= "/path/to/your/module: $PYTHONPATH " In Windows: set PYTHONPATH=C:\ path \ to \your\ module ;%PYTHONPATH% This tells Python to also search for modules in /path/to/your/module . 2. PYTHONHOME : ...
Elasticsearch Ingest is a feature that allows you to preprocess documents before indexing them. It consists of a pipeline of processors that can manipulate the contents of the documents. One way to test the effectiveness of an Ingest pipeline is to simulate its execution on a sample document. This can be done using the Elasticsearch Ingest API's "simulate" endpoint. To use the "simulate" endpoint, you need to provide a JSON object that represents the document you want to test, and a JSON object that represents the pipeline you want to simulate. Here is an example of how to use the "simulate" endpoint: curl -H 'Content - Type : application/json' -XGET 'localhost : 9200 /_ingest/pipeline/_simulate' -d '{ "pipeline" : { "description" : "Sample pipeline" , "processors" : [ { "set" : { "field" : "foo" , "value" :...
To check out a branch from a remote Git repository, you can follow these steps: 1. Fetch the remote branches First, ensure that your local repository is aware of the remote branches by using git fetch . This updates your local references to the remote branches. git fetch origin 2. Check out the remote branch Once the remote branches are fetched, you can check out the desired branch using git checkout -b and specifying the remote branch. Command: git checkout -b < local -branch- name > origin/<remote-branch- name > Explanation: <local-branch-name> : The name you want to give to your local branch. origin/<remote-branch-name> : Refers to the branch on the remote called origin (which is the default name for the main remote repository) and the branch you want to check out. Example: If the remote branch is called feature-branch and you want to create a local branch with the same name, you would run: git checkout -b feature -branch origin / feature -...
That's a great textbook table of contents! It covers the fundamental tenses in English. Here is a summary of the highlighted sections, with example sentences and key learning tips. PRESENT TIME Item Topic Example Sentence(s) Learning Summary 1-1 The simple present and the present progressive Simple Present: The sun rises in the east. (Fact/Habit) / Present Progressive: She is studying for her exam right now. (Action in progress) Simple Present is for facts, habits, and routines . Present Progressive is for actions happening at the moment of speaking or temporary situations . 1-3 Frequency adverbs I always drink coffee in the morning. / He is never late for class. These adverbs ( always, usually, often, sometimes, rarely, never ) describe how often an action occurs. Their position is key: before the main verb, but after the verb to be or auxiliary verbs. 1-4, 1-5 Final -s / Spelling of final -s/-es He read s a book. / She watch es TV. The final -s (or -es ) is adde...
You can use Sublime Text from the command line by utilizing the subl command. Here’s how you can set it up and use it: 1. Install Sublime Text If you haven't already installed Sublime Text, download and install it from the Sublime Text website . 2. Add subl Command to Path (if not already done) On macOS: The subl command is typically added automatically, but if it isn't, follow these steps: Open Sublime Text . Press Cmd + Shift + P to open the command palette. Type Install 'subl' command in PATH and select the option to install it. If you prefer to do it manually, you can create a symbolic link: ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/ local /bin/ subl On Linux: If the subl command isn't available, you can create a symbolic link to it: sudo ln -s /opt/ sublime_text /sublime_text /u sr /local/ bin /subl On Windows: You can add Sublime Text to the system PATH manually by: Right-clicking on This...
Getting started with computer vision AI can seem overwhelming, but breaking it down into steps makes it manageable. Here’s a guide to get you going: 1. Understand the Basics of Computer Vision and Machine Learning Computer Vision (CV): CV is a field of AI focused on enabling computers to interpret and process visual information. Start by understanding fundamental tasks such as image classification , object detection , segmentation , and tracking . Machine Learning and Deep Learning Basics: CV often relies on machine learning and, increasingly, deep learning techniques. Familiarize yourself with supervised learning (classification and regression), unsupervised learning, neural networks, and especially convolutional neural networks (CNNs) , which are widely used in CV. 2. Learn Python and Essential Libraries Python is the go-to language for AI and computer vision. Learn essential libraries: NumPy for numerical operations OpenCV for image processing (reading, transforming i...
In Python, you can catch multiple exceptions in a single except block by using a tuple of exception types. Here's an example: Code Example: Catching Multiple Exceptions def process_data (data) : try : # Simulate a potential error result = 10 / data # Could raise ZeroDivisionError or TypeError print(f "Result: {result}" ) except (ZeroDivisionError, TypeError) as e: print(f "Error caught: {e.__class__.__name__} - {e}" ) except Exception as e: # Catch any other exceptions print(f "Unexpected error: {e.__class__.__name__} - {e}" ) else : # Execute if no exception occurs print( "Processing completed successfully." ) finally : # Execute whether or not an exception occurs print( "Cleanup actions (if any)." ) # Test cases process_data( 5 ) # Valid input process_data( 0 ) # ZeroDivisionError process_data( "a" ...
$ git remote -v origin git@github.daumkakao.com:dennis-lee/vertx-sample.git (fetch) origin git@github.daumkakao.com:dennis-lee/vertx-sample.git (push) $ git log -2 commit 69b4285dd8d1df3debdc24c24a9ee2c22c797931 Author: dennis.lee Date: Mon May 29 18:29:43 2017 +0900 json prettify commit de8c8a8f8a55a4b9a4a89d13cfa04e5001004c1e Author: dennis.lee Date: Mon May 29 18:17:22 2017 +0900 added BodyHandler $ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: pom.xml Untracked files: (use "git add ..." to include in what will be committed) src/main/java/net/sample/ no changes added to commit (use "git add" and/or "git commit -a") $ git branch b1 $ git branch b1 * master $ git checkout -b b2 M pom.xml Switched ...
댓글
댓글 쓰기