- Use
@ConfigurationPropertiesand always get state from the bean. - The
Environmentcan change at runtime and Spring Cloud does this for you usingRefreshEvent. - Changes are propagated to beans in Spring Cloud in 2 ways (
@ConfigurationPropertiesand@RefreshScope). - If you care about the state of
@ConfigurationPropertiesbeing consistent on concurrent access, put it or the consumer@Beanin@RefreshScope.
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
| /** Used by Flavor to mark a type in a readable way. */ | |
| export interface Flavoring<FlavorT> { | |
| _type?: FlavorT; | |
| } | |
| /** Create a "flavored" version of a type. TypeScript will disallow mixing flavors, but will allow unflavored values of that type to be passed in where a flavored version is expected. This is a less restrictive form of branding. */ | |
| export type Flavor<T, FlavorT> = T & Flavoring<FlavorT>; | |
| /** Used by Brand to mark a type in a readable way. */ | |
| export interface Branding<BrandT> { | |
| _type: BrandT; |
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
| version: "3" | |
| # Thanks to https://visibilityspots.org/dockerized-cloudflared-pi-hole.html | |
| # echo "alias dns-up='cd /path/to/folder; docker-compose up -d'" >> ~/.bash_profile | |
| services: | |
| dns-over-https: | |
| container_name: dns-over-https | |
| image: fardog/secureoperator:latest # google dns | |
| # image: visibilityspots/cloudflared:amd64 # cloudflare dns | |
| restart: unless-stopped | |
| networks: |
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
| #!/usr/bin/env bash | |
| if [ "$AWS_PROFILE" = "" ]; then | |
| echo "No AWS_PROFILE set" | |
| exit 1 | |
| fi | |
| for region in $(aws ec2 describe-regions --region eu-west-1 | jq -r .Regions[].RegionName); do |
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
| #!/bin/bash | |
| ################################################################################ | |
| # | |
| # This script automates the installation of the UniFi controller software on the | |
| # Raspberry Pi. | |
| # | |
| # http://www.technologist.site/ubnt | |
| # | |
| ################################################################################ |
C02STG51GTFM:localstack mpandit$ make infra
. .venv/bin/activate; exec localstack/mock/infra.py
Starting local dev environment. CTRL-C to quit.
Starting local Elasticsearch (port 4571)...
Starting mock ES service (port 4578)...
Starting mock S3 server (port 4572)...
Starting mock SNS server (port 4575)...
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
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
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
| #!/usr/bin/env bash | |
| # names of latest versions of each package | |
| export VERSION_PCRE=pcre-8.38 | |
| export VERSION_OPENSSL=openssl-1.0.2d | |
| export VERSION_NGINX=nginx-1.9.7 | |
| # URLs to the source directories | |
| export SOURCE_OPENSSL=https://www.openssl.org/source/ | |
| export SOURCE_PCRE=ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/ |
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
| #!/bin/bash | |
| #title :wildfly-install.sh | |
| #description :The script to install Wildfly 10.x | |
| #more :http://sukharevd.net/wildfly-8-installation.html | |
| #author :Dmitriy Sukharev | |
| #date :2016-06-18T02:45-0700 | |
| #usage :/bin/bash wildfly-install.sh | |
| #tested-version1 :10.0.0.CR3 | |
| #tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22 | |
| #tested-version2 :10.0.0.Final |