Gist переехал в репозиторий nestjs-tips-tricks
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
graph TD | |
%% Section 1: Як працювало з Public Subnet | |
subgraph Public_Subnet ["Now - Public Subnet"] | |
EC2_A[EC2Instance] | |
EC2_B[EC2 Instance B] | |
JFrog_Repo_403[JFrog Registry<br/>403 Forbidden] | |
Internet[Internet] | |
%% Підключення Public Subnet | |
EC2_A -->|Public random IP| Internet |
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
I: Bus=0019 Vendor=0000 Product=0001 Version=0000 | |
N: Name="Power Button" | |
P: Phys=PNP0C0C/button/input0 | |
S: Sysfs=/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/PNP0C0C:00/input/input0 | |
U: Uniq= | |
H: Handlers=kbd event0 | |
B: PROP=0 | |
B: EV=3 | |
B: KEY=10000000000000 0 |
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
<source> | |
@type forward | |
port 24224 | |
bind 0.0.0.0 | |
<parse> | |
@type "json" | |
</parse> | |
time_format %Y-%m-%dT%H:%M:%S.%L | |
</source> |
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
Resources: | |
CloudWatchRamDashboard: | |
Type: 'AWS::CloudWatch::Dashboard' | |
Properties: | |
DashboardName: !Sub '${ProjectId}-board' | |
DashboardBody: !Sub >- | |
{ | |
"widgets": [ | |
{ | |
"type": "metric", |
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
[2021-01-29T00:27:06,451][WARN ][r.suppressed ] [af1005c45a018f392789794b8b754f96] path: __PATH__ params: {size=10, index=nf_posts, from=0, type=nf_posts} | |
org.elasticsearch.action.search.SearchPhaseExecutionException: all shards failed | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseFailure(AbstractSearchAsyncAction.java:551) [elasticsearch-7.9.1.jar:7.9.1] | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction.executeNextPhase(AbstractSearchAsyncAction.java:309) [elasticsearch-7.9.1.jar:7.9.1] | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction.onPhaseDone(AbstractSearchAsyncAction.java:582) [elasticsearch-7.9.1.jar:7.9.1] | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction.onShardFailure(AbstractSearchAsyncAction.java:393) [elasticsearch-7.9.1.jar:7.9.1] | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction.access$100(AbstractSearchAsyncAction.java:68) [elasticsearch-7.9.1.jar:7.9.1] | |
at org.elasticsearch.action.search.AbstractSearchAsyncAction$1.onFai |
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
[2021-01-28T07:53:01,967][WARN ][r.suppressed ] [af1005c45a018f392789794b8b754f96] path: __PATH__ params: {redirectEndpoint=metrics} | |
java.net.ConnectException: Connection refused (Connection refused) | |
at java.net.PlainSocketImpl.socketConnect(Native Method) ~[?:?] | |
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399) ~[?:?] | |
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242) ~[?:?] | |
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224) ~[?:?] | |
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403) ~[?:?] | |
at java.net.Socket.connect(Socket.java:609) ~[?:?] | |
at org.conscrypt.AbstractConscryptSocket.connect(AbstractConscryptSocket.java:155) ~[conscrypt-openjdk-uber-1.4.0.jar:1.4.0] | |
at sun.net.NetworkClient.doConnect(NetworkClient.java:177) ~[?:?] |
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
@Controller() | |
export class AppController { | |
@ApiBody({ type: BodyDto, description: 'desc' }) | |
@ApiConsumes('multipart/form-data') | |
@UseInterceptors(FileInterceptor('fileUpload'), new FileRequestMapperInterceptor('fileUpload')) | |
@Post() | |
example( | |
@Body() body: BodyDto, | |
): BodyDto { | |
console.log(body) // exists fileUpload |
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 { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common'; | |
import { Observable } from 'rxjs'; | |
@Injectable() | |
export class ExampleUploadInterceptor extends MulterInterceptor implements NestInterceptor { | |
private MAX_FILE_SIZE = 50 * 1024 * 1024; | |
constructor( | |
private fs: FsService, | |
) { |
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
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: test-ci-cd | |
spec: | |
replicas: 2 | |
strategy: | |
type: RollingUpdate | |
rollingUpdate: | |
maxSurge: 1 |