This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| nginx -V 2>&1 | tr ' ' '\n' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Configuration> | |
| <Appenders> | |
| <Console name="Console" target="SYSTEM_OUT"> | |
| <PatternLayout | |
| pattern="%style{%d{ISO8601}}{black} %highlight{%-5level }[%style{%t}{bright,blue}] %style{%C{1.}}{bright,yellow}: %msg%n%throwable" /> | |
| </Console> | |
| <RollingFile name="RollingFile" | |
| fileName="./logs/spring-boot-logger-log4j2.log" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # pull the official mongo docker container | |
| docker pull mongo | |
| # create network | |
| docker network create my-mongo-cluster | |
| # create mongos | |
| docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017 | |
| docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018 | |
| docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { MongoClient } = require('mongodb'); | |
| // CRUD operations in transactions must be on existing collections, so be sure you have run | |
| // usersCollection.js prior to running this script. | |
| async function main() { | |
| /** | |
| * Connection URI. Update <username>, <password>, and <your-cluster-url> to reflect your cluster. | |
| * See http://bit.ly/NodeDocs_lauren for more details | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { createReadStream } = require("fs"); | |
| async function run() { | |
| const stream = createReadStream("./test.txt",{ highWaterMark: 4 }); | |
| console.log("start") | |
| for await (let chunk of stream) { | |
| console.log(chunk.toString('utf-8')); | |
| } | |
| console.log("done") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| STANDALONE -> REPLICA SET TUTORIAL | |
| 1. GENERATE KEY: | |
| openssl rand -base64 756 > <path-to-keyfile> | |
| chmod 400 file.key | |
| 2. MODIFY DOCKER COMPOSE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require('dotenv').config(); | |
| const { Webhook } = require('discord-webhook-node'); | |
| const express = require('express'); | |
| const hook = new Webhook(process.env.WEBHOOK); | |
| const IMAGE_URL = 'https://homepages.cae.wisc.edu/~ece533/images/airplane.png'; | |
| hook.setUsername('Deploy bot'); | |
| hook.setAvatar(IMAGE_URL); | |
| const app = express(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| return 301 https://$host$request_uri; | |
| } | |
| server { | |
| listen 443; | |
| server_name wortex.stream www.wortex.stream; | |
| ssl_certificate /etc/letsencrypt/live/wortex.stream/fullchain.pem; # managed by Certbot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| server { | |
| listen 80; | |
| server_name game.wortex.stream; | |
| root /home/sovietspy2/www/phaser3Game/dist; | |
| location / { | |
| try_files $uri $uri/ =404; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Unit] | |
| Description=Git hook service | |
| [Service] | |
| Type=simple | |
| Restart=always | |
| ExecStart=/usr/bin/python3 /home/sovietspy2/www/Phaser3GamePublisher/api.py | |
| [Install] | |
| WantedBy=multi-user.target |