Blog

  • mach-component-aws-commercetools-token-refresher

    Commercetools token refresher for AWS

    Refresh Commercetools access token secrets by asking for a new token. 10 minutes after initial token request the Commercetools API returns a new token.
    They both still work until their expiry date.

    This component is for AWS, there is also a GCP version

    Usage

    Use the following attributes to configure this component in MACH:

    sites:
      - identifier: some site
        components:
        - name: ct-refresher
    ...
    
    components:
    - name: ct-refresher
      source: git::https://github.com/labd/mach-component-aws-commercetools-token-refresher.git//terraform
      version: <git hash of version you want to release>
      integrations: ["aws", "commercetools", "sentry"]

    Other components must configure their commercetools secrets with a reference to this refresher.

    locals {
      ct_scopes = formatlist("%s:%s", [
        "manage_orders",
        "view_orders",
        "manage_payments",
        "view_payments"
      ], var.ct_project_key)
    }
    
    module "ct_secret" {
      source = "git::https://github.com/labd/mach-component-aws-commercetools-token-refresher.git//terraform/secret"
    
      name   = "<your-component-name>"
      site   = var.site
      scopes = local.ct_scopes
    
      # Optional; KMS key to use for the secret
      kms_key_id = "<your-kms-key-id>"
    }

    In your lambda function you can pass the reference to the secretsmanager value as

    CT_ACCESS_TOKEN_SECRET_NAME = module.ct_secret.name
    

    Running in VPC

    By providing VPC information through the variables, the rotator lambda can be run within the VPC;

    sites:
      - identifier: some site
        components:
        - name: ct-refresher
          variables:
            vpc:
              id: <your-vpc-id>
              subnet_ids: <your-subnet-ids>
              ingress_subnet: <your-ingress-subnet>

    Adding KMS keys

    KMS keys can be provided through the kms_keys object;

    sites:
      - identifier: some site
        components:
        - name: ct-refresher
          variables:
            kms_keys:
              cloudwatch: <cloudwatch-kms-key>
              lambda: <lambda-kms-key>
              secretmanager: <secretmanager-kms-key>

    Visit original content creator repository
    https://github.com/labd/mach-component-aws-commercetools-token-refresher

  • kubeorbit

    Like KubeOrbit idea? ⭐ Give us a GitHub Star! ⭐

    work in progress badge Apache License 2.0 Discord channel

    KubeOrbit is an open-source tool that turns easy apps testing&debuging on Kubernetes in a new way. Our KubeOrbit is meant to create a channel automatically. You can test your cloud-native applications through this channel in a hands-free style.

    It solves the following problems during integration tests:

    • Under limited resource and restricted environment, developers in a team may be blocked by others who are testing their own functionalities, and it slows down the development progress.
    • On the other hand, an unstable feature being deployed to a microservice may cause entire system crash.

    Features

    From now on, stop testing your application in local infra naively. Also, no more endless efforts in managing various cloud-based test environments.

    • KubeOrbit CLI: just using one command, forward the traffic from in-cluster service to local service in a flash, no matter your service discovery is based on Eureka, Consul, Nacos or Kubernetes SVC.
    • Protocol support: various protocols based on Layer-7 are supported. HTTP, gRPC, Thrift, Dubbo …
    • Workload label: Label your workload by creating a new channel so that your request can be directed to the appropriate workload replica. This enables you to collaborate with your colleagues to test and debug the same feature..

    Getting Started

    With the following tutorials:

    KubeOrbit CLI:

    Contributing

    We’re a warm and welcoming community of open source contributors. Please join. All types of contributions are welcome. Be sure to read our Contributing Guide before submitting a Pull Request to the project.

    Community

    Discord

    Join the KubeOrbit Discord channel to chat with KubeOrbit developers and other users. This is a good place to learn about KubeOrbit, ask questions, and share your experiences.

    License

    The KubeOrbit user space components are licensed under the Apache License, Version 2.0.

    Visit original content creator repository https://github.com/teamcode-inc/kubeorbit
  • kubeorbit

    Like KubeOrbit idea? ⭐ Give us a GitHub Star! ⭐

    work in progress badge Apache License 2.0 Discord channel

    KubeOrbit is an open-source tool that turns easy apps testing&debuging on Kubernetes in a new way. Our KubeOrbit is meant to create a channel automatically. You can test your cloud-native applications through this channel in a hands-free style.

    It solves the following problems during integration tests:

    • Under limited resource and restricted environment, developers in a team may be blocked by others who are testing their own functionalities, and it slows down the development progress.
    • On the other hand, an unstable feature being deployed to a microservice may cause entire system crash.

    Features

    From now on, stop testing your application in local infra naively. Also, no more endless efforts in managing various cloud-based test environments.

    • KubeOrbit CLI: just using one command, forward the traffic from in-cluster service to local service in a flash, no matter your service discovery is based on Eureka, Consul, Nacos or Kubernetes SVC.
    • Protocol support: various protocols based on Layer-7 are supported. HTTP, gRPC, Thrift, Dubbo …
    • Workload label: Label your workload by creating a new channel so that your request can be directed to the appropriate workload replica. This enables you to collaborate with your colleagues to test and debug the same feature..

    Getting Started

    With the following tutorials:

    KubeOrbit CLI:

    Contributing

    We’re a warm and welcoming community of open source contributors. Please join. All types of contributions are welcome. Be sure to read our Contributing Guide before submitting a Pull Request to the project.

    Community

    Discord

    Join the KubeOrbit Discord channel to chat with KubeOrbit developers and other users. This is a good place to learn about KubeOrbit, ask questions, and share your experiences.

    License

    The KubeOrbit user space components are licensed under the Apache License, Version 2.0.

    Visit original content creator repository https://github.com/teamcode-inc/kubeorbit
  • robux

    NVIDIA_Share_tWNAYDvIcT

    Robux

    Robik but it work

    Features

    • Uses AudioAnalyzer instead of AudioLevel for a smoother visualizer
    • Uses WebNowPlaying for browser and Spotify song info
    • The weather works
    • Right click to center any skin

    You might also want to check out Mondtholomew, it’s “Mond but it work”!

    Usage

    Download and install the newest .rmskin package from releases

    Can also be installed using Meters on Demand

    mond install reisir/robux

    Robux uses WebNowPlaying by default. This lets the player skin read information from your browser with a browser extension.

    Right click any of the skins to center them or to open the settings file. When you edit the settings remember to save the file and then right click > refresh robux to see changes.

    The “MeasureNetworkInDelay” incident.

    Found in the original code. If anyone can tell me why this exists in the original skin it would be much appreaciated.

    ; Download.ini
    [MeasureNetworkIn]
    Measure=NetIn
    Interface=Best
    MinValue=0
    MaxValue=(#MaxDownloadMbits# * 1048576)
    
    [MeasureNetworkInText]
    Measure=NetIn
    AverageSize=3
    Substitute="0":"O"
    
    [MeasureNetworkInDelay]
    Measure=Calc
    Formula=MeasureNetworkInText

    MeasureNetworkInDelay was only used for the string meter, not for the graph. I have no idea what substituting the zeros from NetIn and then running that through a calc measure is supposed to do.

    Credits

    Visit original content creator repository https://github.com/reisir/robux
  • eldarica

    Eldarica

    Eldarica is a model checker for Horn clauses, Numerical Transition
    Systems, and software programs. Inputs can be read in a variety of
    formats, including SMT-LIB 2 and Prolog for Horn clauses, and fragments of
    Scala and C for software programs, and are analysed using a variant of the
    Counterexample-Guided Abstraction
    Refinement (CEGAR) method. Eldarica is fast and includes sophisticated
    interpolation-based techniques for synthesising new predicates for
    CEGAR, enabling it to solve a wide range of verification problems.

    The Eldarica C parser accepts programs augmented with various primitives
    from the timed automata world: supporting concurrency, clocks, communication
    channels, as well as analysis of systems with an unbounded number of
    processes (parameterised analysis).

    There is also a variant of Eldarica for analysing Petri nets: http://www.philipp.ruemmer.org/eldarica-p.shtml

    Eldarica has been developed by Hossein Hojjat and Philipp Ruemmer,
    with further contributions by Zafer Esen, Filip Konecny, and Pavle Subotic.

    There is a simple web interface to experiment with the C interface
    of Eldarica:
    https://eldarica.org/eldarica

    Documentation

    You can either download a binary release of Eldarica, or compile the Scala
    code yourself. Since Eldarica uses sbt, compilation is quite
    simple: you just need sbt installed on your machine,
    and then type sbt assembly to download the compiler, all
    required libraries, and produce a binary of Eldarica.

    After compilation (or downloading a binary release), calling Eldarica
    is normally as easy as saying

    ./eld regression-tests/horn-smt-lib/rate_limiter.c.nts.smt2

    When using a binary release, one can instead also call

    java -jar target/scala-2.*/Eldarica-assembly*.jar regression-tests/horn-smt-lib/rate_limiter.c.nts.smt2

    A set of examples is provided on https://eldarica.org/eldarica, and included
    in the distributions directory regression-tests.

    You can use the script eld-client instead of
    eld in order to run Eldarica in a server-client mode,
    which significantly speeds up processing of multiple problems.

    A full list of options can be obtained by calling ./eld -h.

    The options -disj, -abstract, -stac can be used to control
    predicate generation. For the option -stac to work, it is currently necessary to have Yices (version 1) installed, as this is a dependency of the Flata library.

    The option -sym can be used to switch to the symbolic execution engine of Eldarica, which will then be applied instead of CEGAR.

    Papers

    Related Links

    Visit original content creator repository
    https://github.com/uuverifiers/eldarica

  • dotfiles

    Dotfiles

    zsh helix

    A collection of dotfiles, scripts and configurations from @nickgerace.

    Quickstart

    Before starting, ensure that bash and just are installed on your macOS or Linux system. The “install” recipe will install zsh if you opt to install packages, so it is not required to start.

    Tip

    You can use the devShell from the flake to get the base depedencies.

    You will also need to ensure that this repository resides in the $HOME/src/ directory. You may need to create it by executing mkdir $HOME/src.

    Warning

    Running the following command may overwrite files if you are coming from an existing configuration. Please read the source code, starting from the justfile, before executing the recipe.

    Once everything looks good, execute the following and you will be presented with some options that you’ll need to choose:

    just install

    The invoked just recipe runs an idempotent-ish bootstrap script, so you should be able to execute it multiple times. That being said: caution is advised.

    Updating

    Once the initial just recipe is ran, you can update packages and more using the update recipe.

    just update

    Alternatively, if you run sz or reload your shell, you can run the update function.

    update

    Note

    The above commands only update packages with the current dotfiles in place. If you’d like to re-link dotfiles, run just install again.

    Q&A

    This section contains questions and answers regarding these dotfiles.

    What interactive shell do the dotfiles rely on?

    These dotfiles rely on zsh as the interactive shell.

    What about oh-my-zsh and starship?

    These dotfiles require neither oh-my-zsh nor starship to be installed. Only zsh needs to be installed as all shell-based dotfiles are custom and configured manually.

    Does the just recipe do more than setup dotfiles?

    The script only sets up dotfiles by default. However, for certain Linux distributions and macOS, you can optionally install packages and setup the base system (e.g. install an opinionated set of base packages with a package manager). This is referred to “bootstrapping” in the script.

    Is WSL2 supported?

    WSL2 is supported for dotfiles setup, but packages will not be installed for supported distros when running the installer.

    Disclaimer

    Files not recently in use may be out of date. This is a “living” repository, meaning that scripts and dotfiles more frequently in use will be more likely to be kept up to date. Anything not recently or frequently in use will be removed from the repository (eventually).

    Visit original content creator repository https://github.com/nickgerace/dotfiles
  • carpenter

    carpenter

    GitHub release license

    carpenter is a tool to manage DB schema and data inspired by naoina/migu.
    By using this, you can manage the database structures and data as text (JSON, CSV).  carpenter can restore the database structure and data from text, or can export them to text in easy.

    supported databases are MySQL|MariaDB only currently

    Install

    % brew tap dev-cloverlab/carpenter
    % brew install carpenter
    

    for Gophers.

    % go get -u github.com/dev-cloverlab/carpenter
    

    How to use

    carpenter has four simple commands are classified database structure and data. For each command is also available to use as indivisually.

    Commands for structure

    design

    design command can export database structure as JSON. By doing below, exports JSON file named table.json to current directory.

    % carpenter -s test -d "root:@tcp(127.0.0.1:3306)" design -d ./
    

    When you want to separate files for each tables, you can set -s option.

    options:

    • -s export JSON files are separated for each table (default off)
    • -p pretty output (default off)
    • -d export directory path

    Each option has alternative long name. Please see the help for details.

    build

    build command can restore database structure from JSON files. By doing below, generate the difference SQLs between tables and JSON files and execute them.

    % carpenter -s test -d "root:@tcp(127.0.0.1:3306)" build -d .
    

    When you want to just show the generated SQLs, you can set --dry-run global option.

    Commands for data

    export

    export command can export data as CSV files. By doing below, export data as CSV files for each table.

    % carpenter -s test -d "root:@tcp(127.0.0.1:3306)" export -d .
    

    When you want to select exporting tables, you can set regular expression to -r option like below.

    % carpenter -s test -d "root:@tcp(127.0.0.1:3306)" export -r "^master_*$" -d .
    

    import

    import command can import CSV files to tables. By doing below, generate the difference SQLs between tables and CSV files and execute them.

    % carpenter -s test -d "root:@tcp(127.0.0.1:3306)" import -d .
    

    When you want to just show the generated SQLs, you can set --dry-run global option.

    Architecture

    Explain how carpenter syncronizes text and database.

    MySQL(MariaDB) has information table that has table, column, index and partition information. carpenter refers that and translate it to JSON, and unmarshal it to struct. Both of structs that are made from database and files can compare each field type and etc. When some difference are found for each field, carpenter generates SQLs for resolve differences.

    For example:

    // about member table
    
    // database
    +-------+--------------+------+
    | Field | Type         | Null |
    +-------+--------------+------+
    | name  | varchar(255) | NO   |
    | email | varchar(255) | NO   |
    +-------+--------------+------+
    
    // file
    +--------+--------------+------+
    | Field  | Type         | Null |
    +--------+--------------+------+
    | name   | varchar(255) | NO   |
    | email  | varchar(255) | NO   |
    | gender | tinyint(4)   | NO   |
    +--------+--------------+------+
    

    To generate this.

    alter table `member` add `gender` tinyint(4) not null after `email`

    carpenter can generate SQLs at various scenes like:

    • CREATE
    • DROP
    • ALTER
    • INSERT
    • REPLACE
    • DELETE

    These SQLs are generated by difference of both information structs.

    Contribution

    1. Fork (https://github.com/dev-cloverlab/carpenter/fork)
    2. Create a feature branch
    3. Commit your changes
    4. Rebase your local changes against the master branch
    5. Run test suite with the go test ./... command and confirm that it passes
    6. Run gofmt -s
    7. Create a new Pull Request

    Author

    @hatajoe

    Licence

    MIT

    Visit original content creator repository https://github.com/dev-cloverlab/carpenter
  • terraform-module-aws-ecr-repository

    OPSd - the unique and effortless way of managing cloud infrastructure.

    Meet OPSd. The unique and effortless way of managing cloud infrastructure.

    terraform-module-aws-ecr-repository

    Introduction

    This module provides an Elastic Container Registry Repository.

    Usage

    module "example" {
      source = "github.com/opsd-io/terraform-module-aws-ecr-repository"
      name   = "foobar-service"
    
      image_tag_mutable = true
      scan_on_push      = true
    }

    IMPORTANT: Make sure not to pin to master because there may be breaking changes between releases.

    Requirements

    Name Version
    terraform >= 1.5.5
    aws ~> 5.0

    Providers

    Name Version
    aws ~> 5.0

    Modules

    No modules.

    Resources

    Name Type
    aws_ecr_lifecycle_policy.main resource
    aws_ecr_repository.main resource
    aws_ecr_repository_policy.main resource
    aws_iam_policy_document.repository_policy data source

    Inputs

    Name Description Type Default Required
    common_tags A map of tags to assign to every resource in this module. map(string) {} no
    encryption_kms_key The ARN of the KMS key to use for the repository encryption. string null no
    image_tag_mutable The tag mutability setting for the repository. bool true no
    lifecycle_rules List of lifecycle policy rules.
    list(object({
    priority = number
    description = optional(string)
    tag_status = string # "tagged"
    “untagged” “any”
    tag_patterns = optional(list(string))
    tag_prefixes = optional(list(string))
    count_type = string # “imageCountMoreThan”
    name Name of the repository. string n/a yes
    policy_documents List of IAM policy documents that are merged together for the repository policy. list(string) [] no
    scan_on_push Indicates whether images are scanned after being pushed to the repository. bool true no

    Outputs

    Name Description
    arn Full ARN of the repository.
    registry_id The registry ID where the repository was created.
    repository_url The URL of the repository.

    Examples of usage

    Do you want to see how the module works? See all the usage examples.

    Related modules

    The list of related modules (if present).

    Contributing

    If you are interested in contributing to the project, see see our guide.

    Support

    If you have a problem with the module or want to propose a new feature, you can report it via the project’s (Github) issue tracker.

    If you want to discuss something in person, you can join our community on Slack.

    License

    Apache License 2.0

    Visit original content creator repository
    https://github.com/opsd-io/terraform-module-aws-ecr-repository

  • swift_qrcodejs

    QRCodeSwift (swift_qrcodejs)

    Latest Release MIT License Swift 5.0+ Compatible with All Platforms

    Documentation Code Coverage CocoaPods Compatible Swift Package Manager Compatible Carthage Compatible

    Cross-platform QRCode generator written in pure Swift, aiming to solve the awkward situation that there’s no CIFilter for QRCode generation on Apple Watches.

    Installation

    Swift Package Manager
    with Xcode

    More details in the Official Guide, but in general:

    1. Select in the menu bar of Xcode: File > Swift Packages > Add Package Dependency
    2. Enter https://github.com/ApolloZhu/swift_qrcodejs.git
    3. Next, specify the version resolving rule as “Up to Next Major”
    4. Finish with choosing QRCodeSwift library and add it to your app target.
    with Package.swift
    dependencies: [
        .package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "2.2.2"),
    ]

    … then add QRCodeSwift module/target from package swift_qrcodejs as your dependency.

    CocoaPods
    pod 'swift_qrcodejs', '~> 2.2.2'
    Carthage

    I assume you know what you are doing (because I don’t), but you probably need something like this:

    github "ApolloZhu/swift_qrcodejs" ~> 2.2.2

    Note that Carthage doesn’t work with Xcode 12 (but here’s a workaround).

    Manually

    Add all the .swift files from the Sources folder into your project.

    Usage

    import QRCodeSwift
    
    guard let qrCode = try? QRCode("Hello World!") else {
        fatalError("Failed to generate QRCode")
    }
    print(qrCode.toString(filledWith: "##", patchedWith: "  "))

    For more, checkout the documentation.

    Example Projects

    License

    MIT License. Modified based on qrcodejs. See LICENSE and each individual file header for more information.

    Visit original content creator repository https://github.com/ApolloZhu/swift_qrcodejs
  • swift_qrcodejs

    QRCodeSwift (swift_qrcodejs)

    Latest Release
    MIT License
    Swift 5.0+
    Compatible with All Platforms

    Documentation
    Code Coverage
    CocoaPods Compatible
    Swift Package Manager Compatible
    Carthage Compatible

    Cross-platform QRCode generator written in pure Swift, aiming to solve the awkward situation that there’s no CIFilter for QRCode generation on Apple Watches.

    Installation

    Swift Package Manager
    with Xcode

    More details in the Official Guide,
    but in general:

    1. Select in the menu bar of Xcode: File > Swift Packages > Add Package Dependency
    2. Enter https://github.com/ApolloZhu/swift_qrcodejs.git
    3. Next, specify the version resolving rule as “Up to Next Major”
    4. Finish with choosing QRCodeSwift library and add it to your app target.
    with Package.swift

    dependencies: [
        .package(url: "https://github.com/ApolloZhu/swift_qrcodejs.git", from: "2.2.2"),
    ]

    … then add QRCodeSwift module/target from package swift_qrcodejs as your dependency.

    CocoaPods
    pod 'swift_qrcodejs', '~> 2.2.2'
    Carthage

    I assume you know what you are doing (because I don’t), but you probably need something like this:

    github "ApolloZhu/swift_qrcodejs" ~> 2.2.2

    Note that Carthage doesn’t work with Xcode 12
    (but here’s a workaround).

    Manually

    Add all the .swift files from the Sources folder into your project.

    Usage

    import QRCodeSwift
    
    guard let qrCode = try? QRCode("Hello World!") else {
        fatalError("Failed to generate QRCode")
    }
    print(qrCode.toString(filledWith: "##", patchedWith: "  "))

    For more, checkout the documentation.

    Example Projects

    License

    MIT License. Modified based on qrcodejs.
    See LICENSE and each individual file header for more information.

    Visit original content creator repository
    https://github.com/ApolloZhu/swift_qrcodejs