This file contains 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
import asyncio | |
import unittest | |
from enum import Enum | |
from datetime import datetime, UTC | |
from typing import ClassVar, Optional, List | |
from pymongo import IndexModel, ASCENDING | |
from pydantic import BaseModel, Field, Extra | |
from beanie import Document, BackLink, Link, init_beanie |
This file contains 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
#!/usr/bin/env bash | |
if [ -z "$1" ]; | |
then | |
echo "Usage: $0 <index file path>" | |
exit 1 | |
fi | |
export INDEX_FILE="$1" | |
systemctl stop mongod | |
su mongodb --shell /bin/bash -c 'mongod --dbpath /mongodb/data --port 47017 --wiredTigerDirectoryForIndexes --pidfilepath=/tmp/mongod.pid &' | |
while ! nc -z localhost 47017 </dev/null; do sleep 5; done |
This file contains 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
{ | |
"type": "FeatureCollection", | |
"features": [ | |
{ | |
"type": "Feature", | |
"properties": { | |
"stroke": "#555555", | |
"stroke-width": 2, | |
"stroke-opacity": 1, | |
"fill": "#555555", |
This file contains 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
FROM node:10 | |
# Set the workdir /var/www/myapp | |
WORKDIR /var/app/current | |
# Copy the package.json to workdir | |
COPY package.json ./ | |
COPY package-lock.json ./ | |
# Copy application source | |
COPY .sailsrc ./ |
This file contains 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
version: "3.7" | |
services: | |
rabbitmq: | |
image: rabbitmq:3-management | |
environment: | |
RABBITMQ_DEFAULT_VHOST: "/myproject" | |
RABBITMQ_DEFAULT_USER: "dev" | |
RABBITMQ_DEFAULT_PASS: "dev" | |
volumes: | |
- type: volume |
This file contains 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
#!/usr/bin/env bash | |
# | |
# This script would help to automate renewal of LetsEncrypt TLS certificates in a Linux machine | |
# running nginx web server on AWS EC2. | |
# What it does: | |
# 1. it stops nginx | |
# 2. it opens incoming firewall ports 80 and 443 for certbot host verification | |
# 3. it runs certbot to renew certificates. Certbot launches a standalone HTTP server on port 80 or 443 | |
# 4. it closes incoming firewall ports 80 and 443 | |
# 5. it starts nginx |
This file contains 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
alias socks_on="ssh -D 8666 -C -N -f -M -S ~/.socks.socket $USER@<your_office_gateway>; networksetup -setsocksfirewallproxystate Wi-Fi on;" | |
alias socks_off="networksetup -setsocksfirewallproxystate Wi-Fi off; ssh -S ~/.socks.socket -O exit $USER@<your_office_gateway>;" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
files: | |
"/opt/elasticbeanstalk/hooks/appdeploy/post/60_configure_newrelic_hostname.sh": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
#!/bin/bash | |
set -xe | |
export EC2_TAG_NAME=$(/opt/aws/bin/ec2-describe-tags --filter "resource-type=instance" --filter "resource-id=$(/opt/aws/bin/ec2-metadata -i | cut -d ' ' -f2)" --filter "key=Name" | cut -f5) |
This file contains 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 suffixMap = { | |
"ALY": [ | |
"ALLEE", | |
"ALLEY", | |
"ALLY", | |
"ALY" | |
], | |
"ANX": [ | |
"ANEX", | |
"ANNEX", |
NewerOlder