In Puppeteer , CDPEvents refers to events emitted by the Chrome DevTools Protocol (CDP) . Puppeteer leverages CDP to interact with and control a Chromium-based browser. CDP provides detailed, low-level access to browser internals, such as network traffic, console logs, page lifecycle events, and more. You can listen to these CDP events through Puppeteer’s API to monitor or intercept browser activity. How to Listen for CDP Events in Puppeteer Enable the Required CDP Domain: Some events require enabling a particular domain (e.g., 'Network' , 'Page' , 'Runtime' ). Use page._client() to Access the CDP Session: Although it’s a bit lower-level, Puppeteer allows access to DevTools through the page._client() API. Example: Listening for Network Requests This example demonstrates how to intercept and log network requests using CDP. const puppeteer = require( 'puppeteer' ); ( async () => { const browser = await puppeteer.launch({ headless...
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...
The default directory for FTP users in vsftpd depends on how the FTP server is configured and the user’s home directory setup. Below are different configurations and their impact on the default directory that users are placed in when they connect to the server. 1. Default Directory Behavior with vsftpd When a user logs in via FTP, they are typically placed in their home directory . By default, the home directory is located at /home/<username> , where <username> is the name of the FTP user. For example: If the FTP user is ftpuser , the default login directory will be /home/ftpuser/ . 2. Changing the Default Directory for Users A. Using local_root Configuration You can specify a custom directory (other than the user’s home directory) for FTP users by setting the local_root parameter in the vsftpd configuration file. Open the vsftpd configuration file: sudo nano /etc/ vsftpd.conf Add the following line to specify a new directory for all FTP users: lo...
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 -...
보통 사용되지 않는 서비스나 사용 빈도가 적은 프로세스의 경우 stop 시켜두는 것이 시스템 사용 상의 이점이 있다. 자신에게 필요 없는 프로세스를 정지 한다거나 nice 값을 조정하여 실행 시에 프로세스의 우선순위를 변화시킬 수 있다. 이렇게 시스템 상황에 따라 적절히 서비스들을 관리하려면 현재 자신의 시스템의 여러가지 상황을 알아야 하는데, 이런 경우 프로세스 및 실시간 시스템 상황을 보는 명령어인 top 을 사용할 수 있다. top [-][d delay][q][c][S][s][i][n][b] -d delay : delay 의 시간이 경과하면 현재 스크린을 갱신한다. -q : 이 옵션을 사용하면 스크린을 계속 갱신한다. -c : command list 전체를 보여준다. 즉 욥선을 사용한 것까지 모두 보여준다. -i : idle 상태와 zombie 프로세스는 무시한다. * 이 외의 옵션은 man 파일을 참고 top 실행 화면 1. First Line : 2:59am up 6days, 10:36, 4 users, load average : 현재 시간 2:59 am , 부팅된지 6days and 10시간 36분, 접속해 있는 사용자수, 평균부하 2. Second Line : 61 processes: 56 sleeping, 3 running, 1 xombie, 1 stopped 3. Third Line : CPU states: 36.4% user, 63.5% system, 0.0% nice, 0.0% idle 유저모드에서의 CPU 시간이 36.4% 시스템모드(프로세스를 위해서 커널이 사용한 CPU의 시간)에서의 CPU시간이 63.5% 0.0% nice는 nice로 nice value를 음수로 주어 우선순위를 높이는 경우에 해당하는 모드 0.0% idle(...
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...
cron 데몬의 가동은 /etc/rc.d/init.d/crond 에 있다. 보통 시스템의 어떤 런레벨이든지 cron 데몬은 부팅 시 시작하도록 되어 있는데, 굳이 cron 데몬을 죽이거나 다시 시작하기 위해서는 위의 /etc/rc.d/init.d/crond 실행 스크립트를 실행하면 된다. cron 데몬에 작업을 설정하기 위해서는 cron table 을 설정하는 crontab 이라는 실행파일을 사용한다. cron table 을 편집하기 위해서는 crontab -e 명령을 사용한다. 입력 형식은 아래와 같다. #crontab -e 01 4 * * * /etc/rc.d/init.d/network stop 15 4 * * * ~/scripts/my_script.sh 00 5 * * * /etc/rc.d/init.d/network start 위의 내용이 cron table 에 입력된 내용인데 이러한 입력형식은 아래와 같다. M H D m d cmd-line 필드명 범위 설명 M 0-59,* 분을 의미하며, *는 모든 볌위를 말함 H 0-23,* 시를 의미함 D 1-31,* 날짜를 의미함 m 1-12,* 달을 의미함 d 0-7,* 요일을 의미하며,0과 7은 일요일(Sun)을 의미함 cmd-line 실행할 명령을 입력 각자의 사용자가 등록한 cron table 은 /var/spool/cron 디렉토리에 저장된다. 입력 내용의 다른 예를 보면, 30 13 * * 1-5 mail -s "It's 2pm" root% Dear root% % Are you sleeping?? 같은 경우는 월요일부터 금요일까지 오후 1시 30분에 해당 mail 명령을 실행하게 된다. 위에서 %문자는 개행문자 역할을 하며(풀어 쓰면 아래와 같은 명령이 된다.), 한줄이 넘어가는 명령을 쓰기 위해서는 백슬래쉬를 써주고 다시 개행해서 쓰면 된다. $mail -s "It's 2pm" ro...
댓글
댓글 쓰기