A simple context manager to manage the connection to a TCP Modbus slave using pymodbus.
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.8' | |
| services: | |
| glue: | |
| image: amazon/aws-glue-libs:glue_libs_1.0.0_image_01 | |
| build: | |
| context: . | |
| stdin_open: true # docker run -i | |
| tty: true # docker run -t | |
| ports: | |
| - 8888:8888 |
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
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | |
| # SPDX-License-Identifier: MIT-0 | |
| import json | |
| import boto3 | |
| import zipfile | |
| import urllib as urllib2 | |
| import io | |
| import os | |
| import time |
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
| self.file_system.connections.allow_default_port_from(self.ec2_instance) | |
| self.ec2_instance.user_data.add_commands( | |
| "yum check-update -y", | |
| "yum upgrade -y", | |
| "yum install -y amazon-efs-utils", | |
| "yum install -y nfs-utils", | |
| "file_system_id_1=" + self.file_system.file_system_id, | |
| "efs_mount_point_1=/mnt/efs/fs1", | |
| 'mkdir -p "${efs_mount_point_1}"', |
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
| import React from "react"; | |
| import { Amplify } from "aws-amplify"; | |
| import { | |
| AmplifyProvider, | |
| Authenticator, | |
| Button, | |
| Flex, | |
| Image, | |
| Text, | |
| View, |
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
| <script setup> | |
| import { onMounted } from "vue"; | |
| import { Authenticator } from "@aws-amplify/ui-vue"; | |
| import "@aws-amplify/ui-vue/styles.css"; | |
| onMounted(() => { | |
| const lex = document.createElement("script"); | |
| lex.src = "https://d2hzdehb4i1g7i.cloudfront.net/lex-web-ui-loader.min.js"; | |
| lex.onload = async function () { | |
| const loaderOpts = { | |
| baseUrl: "https://d2hzdehb4i1g7i.cloudfront.net/", |
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
| from aws_cdk import Stack, aws_s3 | |
| from aws_cdk import aws_secretsmanager as secretsmanager | |
| from aws_cdk.aws_codebuild import ( | |
| BuildEnvironment, | |
| ComputeType, | |
| LinuxBuildImage, | |
| PipelineProject, | |
| ) | |
| from aws_cdk.aws_codepipeline import Artifact, Pipeline | |
| from aws_cdk.aws_codepipeline_actions import ( |
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
| s3_deploy.BucketDeployment( | |
| scope=self, | |
| id="websiteDeploy", | |
| sources=[ | |
| s3_deploy.Source.asset( | |
| path="website", | |
| bundling=BundlingOptions( | |
| command=[ | |
| "bash", | |
| "-c", |
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
| from aws_cdk importpipelines | |
| # This pipeline deploys a cdk stack | |
| pipeline = pipelines.CodePipeline( | |
| scope=self, | |
| id="Pipeline", | |
| code_build_defaults=code_build, | |
| synth=pipelines.ShellStep( | |
| id="Synth", | |
| input=pipelines.CodePipelineSource.git_hub( | |
| repo_string="MYREPO", |
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
| fn is_monotonic(data: &[u32]) -> bool { | |
| if data.len() <= 2 { | |
| return true; | |
| } | |
| let direction = data[1].cmp(&data[0]); | |
| for i in 2..data.len() { | |
| if breaks_direction(direction, data[i], data[i - 1]) { | |
| return false; | |
| } |
OlderNewer