Blog

  • ethereum-wallet

    Project Name: CoinDAO Wallet – A wallet implementation for evm compatiable chain

    alt text

    CoinDAO Wallet is a Open source wallet implementation for EVM compatiable chains

    you can switch chains by editing the network constant in the main.js file or by completely changing the provider

    Live website : CoinDAO Wallet

    GitHub Repository : here

    Running the app

    This is a Next.js project bootstrapped with create-next-app.

    Getting Started

    First, clone the repo with the following git command:

    Second, open a terminal in the root directory of the project and run:

    npm install

    to install all the package dependencies for the project

    Third, Edit the private keys and insert yours

    Finally, run the development server:

    npm run dev
    # or
    yarn dev

    Open http://localhost:3000 with your browser to see the result.

    Learn More

    To learn more about Next.js, take a look at the following resources:

    You can check out the Next.js GitHub repository – your feedback and contributions are welcome!

    Deploy on Vercel

    The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

    Check out our Next.js deployment documentation for more details.


                                                                              Made with ❤️ by @developruche

    Visit original content creator repository https://github.com/developeruche/ethereum-wallet
  • ethereum-wallet

    Project Name: CoinDAO Wallet – A wallet implementation for evm compatiable chain

    alt text

    CoinDAO Wallet is a Open source wallet implementation for EVM compatiable chains

    you can switch chains by editing the network constant in the main.js file or by completely changing the provider

    Live website : CoinDAO Wallet

    GitHub Repository : here

    Running the app

    This is a Next.js project bootstrapped with create-next-app.

    Getting Started

    First, clone the repo with the following git command:

    Second, open a terminal in the root directory of the project and run:

    npm install

    to install all the package dependencies for the project

    Third, Edit the private keys and insert yours

    Finally, run the development server:

    npm run dev
    # or
    yarn dev

    Open http://localhost:3000 with your browser to see the result.

    Learn More

    To learn more about Next.js, take a look at the following resources:

    You can check out the Next.js GitHub repository – your feedback and contributions are welcome!

    Deploy on Vercel

    The easiest way to deploy your Next.js app is to use the Vercel Platform from the creators of Next.js.

    Check out our Next.js deployment documentation for more details.

                                                                              Made with ❤️
    by @developruche

    Visit original content creator repository
    https://github.com/developeruche/ethereum-wallet

  • pcd

    Proof-carrying data (PCD)

    This arkworks library describes an interface and contains an implementation for proof-carrying data (PCD).

    PCD (introduced in [CT10]) is a cryptographic primitive that allows the incremental verification of a distributed computation that can continue indefinitely. A computation defined by a (possibly infinite) directed acyclic graph is augmented by attaching a succinct proof of correctness to each message, allowing any intermediate state of the computation to be verified efficiently. PCD is a generalization of IVC [Val08], or incrementally-verifiable computation, which is PCD in the case of a linear computation (that is, the graph is a path graph).

    This library is released under the MIT License and the Apache v2 License (see License).

    WARNING: This is an academic proof-of-concept prototype, and in particular has not received careful code review. This implementation is NOT ready for production use.

    The PCD interface is here and relies on a cycle of elliptic curves (e.g. the MNT cycle). Separate CircuitSpecificSetupPCD and UniversalSetupPCD interfaces are included depending on the underlying SNARK type(s). Note that the underlying main SNARK and helper SNARK do not have to be the same, although both must implement either CircuitSpecificSetupSNARK or UniversalSetupSNARK.

    Build guide

    The library compiles on the stable toolchain of the Rust compiler. To install the latest version of Rust, first install rustup by following the instructions here, or via your platform’s package manager. Once rustup is installed, install the Rust toolchain by invoking:

    rustup install stable

    After that, use cargo, the standard Rust build tool, to build the libraries:

    git clone https://github.com/arkworks-rs/pcd.git
    cd pcd
    cargo build

    Tests

    This library comes with comprehensive unit and integration tests. Run the tests with:

    cargo test --all

    License

    The crates in this repo are licensed under either of the following licenses, at your discretion.

    Unless you explicitly state otherwise, any contribution submitted for inclusion in this library by you shall be dual licensed as above (as defined in the Apache v2 License), without any additional terms or conditions.

    References

    [CT10] Proof-Carrying Data and Hearsay Arguments from Signature Cards
    Alessandro Chiesa and Eran Tromer
    ITCS 2010

    [Val08] Incrementally Verifiable Computation or Proofs of Knowledge Imply Time/Space Efficiency
    Paul Valiant
    TCC 2008

    Visit original content creator repository
    https://github.com/arkworks-rs/pcd

  • akka-cluster-on-kubernetes

    Akka Cluster on Kubernetes

    Sample project for deploying Akka Cluster to Kubernetes.
    Presented at Scala Up North on July 21, 2017. Video of presentation: https://www.youtube.com/watch?v=Esd1UKIpvdU

    To run the project yourself:

    Create a Kubernetes Cluster

    Follow https://cloud.google.com/container-engine/docs/quickstart
    to create a Kubernetes cluster in minutes.

    I recommend getting kubectl set up locally which means you need to install the
    gcloud SDK: https://cloud.google.com/sdk/docs/quickstarts

    Then click the Connect button next to your cluster name here: https://console.cloud.google.com/kubernetes/list to set up kubectl

    Run Locally Without Etcd

    The master branch is set up to run with etcd so if you want to run locally
    then you’ll need to uncomment the seed-node config in src/main/resources/application.conf

    // src/main/resources/application.conf
    ...
      cluster {
        roles = [frontend, backend]
        // uncomment this if running locally
        seed-nodes = [
          "akka.tcp://ClusterSystem@127.0.0.1:2551"
        ]
      }

    Then you can run the project and curl the HTTP endpoint.

    ➜ sbt run
    [info] Running com.hootsuite.akkak8s.SimpleClusterApp
    [INFO] [07/21/2017 13:51:35.643] [run-main-0] [akka.remote.Remoting] Starting remoting
    [INFO] [07/21/2017 13:51:36.052] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2551]
    [INFO] [07/21/2017 13:51:36.075] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Starting up...
    [INFO] [07/21/2017 13:51:36.269] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Registered cluster JMX MBean [akka:type=Cluster]
    [INFO] [07/21/2017 13:51:36.269] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Started up successfully
    [INFO] [07/21/2017 13:51:36.365] [ClusterSystem-akka.actor.default-dispatcher-14] [akka.tcp://ClusterSystem@127.0.0.1:2551/system/constructr] Stopping self, because seed-nodes defined
    [INFO] [07/21/2017 13:51:36.411] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles [frontend, backend]
    [INFO] [07/21/2017 13:51:36.463] [ClusterSystem-akka.actor.default-dispatcher-3] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up]
    

    And now curl the app

    ➜ curl "http://localhost:8080?msg=about+a+hotdog"
    Hot Dog! (from fe: xxxxxxxx be: xxxxxxxx)%
    ➜ curl "http://localhost:8080?msg=about+a+dog"
    Not Hot Dog :( (from fe: xxxxxxxx be: xxxxxxxx)%

    Run Locally With Etcd

    In Kubernetes, we need to use the constructr library to discover other seed nodes.

    To test this out locally, comment out the seed-nodes config

        roles = [frontend, backend]
        // uncomment this if running locally
    //    seed-nodes = [
    //      "akka.tcp://ClusterSystem@127.0.0.1:2551"
    //    ]

    And start etcd with Docker for Mac.

    ➜ docker run -d \
      --name etcd \
      --publish 2379:2379 \
      quay.io/coreos/etcd:v2.3.7 \
      --listen-client-urls http://0.0.0.0:2379 \
      --advertise-client-urls http://192.168.99.100:2379

    Finally, restart the app

    ➜ sbt run
    
    [info] Running com.hootsuite.akkak8s.SimpleClusterApp
    [INFO] [07/21/2017 13:50:16.051] [run-main-0] [akka.remote.Remoting] Starting remoting
    [INFO] [07/21/2017 13:50:16.503] [run-main-0] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2551]
    [INFO] [07/21/2017 13:50:16.530] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Starting up...
    [INFO] [07/21/2017 13:50:16.870] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Registered cluster JMX MBean [akka:type=Cluster]
    [INFO] [07/21/2017 13:50:16.870] [run-main-0] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Started up successfully
    [INFO] [07/21/2017 13:50:16.933] [ClusterSystem-akka.actor.default-dispatcher-6] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - No seed-nodes configured, manual cluster join required
    [INFO] [07/21/2017 13:50:16.951] [ClusterSystem-akka.actor.default-dispatcher-2] [akka.tcp://ClusterSystem@127.0.0.1:2551/system/constructr] Creating constructr-machine, because no seed-nodes defined
    [INFO] [07/21/2017 13:50:20.348] [ClusterSystem-akka.actor.default-dispatcher-6] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles [frontend, backend]
    [INFO] [07/21/2017 13:50:20.370] [ClusterSystem-akka.actor.default-dispatcher-6] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up]
    

    And now curl the app again

    ➜ curl "http://localhost:8080?msg=about+a+hotdog"
    Hot Dog! (from fe: xxxxxxxx be: xxxxxxxx)%
    ➜ curl "http://localhost:8080?msg=about+a+dog"
    Not Hot Dog :( (from fe: xxxxxxxx be: xxxxxxxx)%

    Package into Docker

    ➜ sbt assembly
    # outputs target/scala-2.12/akka-cluster-on-kubernetes-assembly-0.1.jar
    # now build that into a docker image
    ➜ docker build -t {your namespace}/akka-cluster .

    Test Locally With Docker Compose

    We still need etcd but we want it accessible from the same network as our app which
    is now running on Docker, not on localhost. To do this we use Docker Compose.

    ➜ docker-compose up
    
    Starting akkaclusteronkubernetes_etcd_1 ...
    Starting akkaclusteronkubernetes_etcd_1 ... done
    Starting akkaclusteronkubernetes_akka_1 ...
    Starting akkaclusteronkubernetes_akka_1 ... done
    Attaching to akkaclusteronkubernetes_etcd_1, akkaclusteronkubernetes_akka_1
    etcd_1  | 2017-07-21 21:08:21.112937 I | etcdmain: etcd Version: 2.3.7
    etcd_1  | 2017-07-21 21:08:21.113016 I | etcdmain: Git SHA: fd17c91
    etcd_1  | 2017-07-21 21:08:21.113026 I | etcdmain: Go Version: go1.6.2
    etcd_1  | 2017-07-21 21:08:21.113041 I | etcdmain: Go OS/Arch: linux/amd64
    etcd_1  | 2017-07-21 21:08:21.113052 I | etcdmain: setting maximum number of CPUs to 2, total number of available CPUs is 2
    etcd_1  | 2017-07-21 21:08:21.113058 W | etcdmain: no data-dir provided, using default data-dir ./default.etcd
    etcd_1  | 2017-07-21 21:08:21.113834 N | etcdmain: the server is already initialized as member before, starting as etcd member...
    etcd_1  | 2017-07-21 21:08:21.114360 I | etcdmain: listening for peers on http://localhost:2380
    etcd_1  | 2017-07-21 21:08:21.114539 I | etcdmain: listening for peers on http://localhost:7001
    etcd_1  | 2017-07-21 21:08:21.114584 I | etcdmain: listening for client requests on http://0.0.0.0:2379
    etcd_1  | 2017-07-21 21:08:21.124405 I | etcdserver: name = default
    etcd_1  | 2017-07-21 21:08:21.124445 I | etcdserver: data dir = default.etcd
    etcd_1  | 2017-07-21 21:08:21.124453 I | etcdserver: member dir = default.etcd/member
    etcd_1  | 2017-07-21 21:08:21.124461 I | etcdserver: heartbeat = 100ms
    etcd_1  | 2017-07-21 21:08:21.124465 I | etcdserver: election = 1000ms
    etcd_1  | 2017-07-21 21:08:21.124470 I | etcdserver: snapshot count = 10000
    etcd_1  | 2017-07-21 21:08:21.124505 I | etcdserver: advertise client URLs = http://0.0.0.0:2379
    etcd_1  | 2017-07-21 21:08:21.128006 I | etcdserver: restarting member ce2a822cea30bfca in cluster 7e27652122e8b2ae at commit index 424
    etcd_1  | 2017-07-21 21:08:21.128122 I | raft: ce2a822cea30bfca became follower at term 10
    etcd_1  | 2017-07-21 21:08:21.128165 I | raft: newRaft ce2a822cea30bfca [peers: [], term: 10, commit: 424, applied: 0, lastindex: 424, lastterm: 10]
    etcd_1  | 2017-07-21 21:08:21.130984 I | etcdserver: starting server... [version: 2.3.7, cluster version: to_be_decided]
    etcd_1  | 2017-07-21 21:08:21.134951 N | etcdserver: added local member ce2a822cea30bfca [http://localhost:2380 http://localhost:7001] to cluster 7e27652122e8b2ae
    etcd_1  | 2017-07-21 21:08:21.135076 N | etcdserver: set the initial cluster version to 2.3
    etcd_1  | 2017-07-21 21:08:22.431440 I | raft: ce2a822cea30bfca is starting a new election at term 10
    etcd_1  | 2017-07-21 21:08:22.431735 I | raft: ce2a822cea30bfca became candidate at term 11
    etcd_1  | 2017-07-21 21:08:22.431922 I | raft: ce2a822cea30bfca received vote from ce2a822cea30bfca at term 11
    etcd_1  | 2017-07-21 21:08:22.432299 I | raft: ce2a822cea30bfca became leader at term 11
    etcd_1  | 2017-07-21 21:08:22.432405 I | raft: raft.node: ce2a822cea30bfca elected leader ce2a822cea30bfca at term 11
    etcd_1  | 2017-07-21 21:08:22.433347 I | etcdserver: published {Name:default ClientURLs:[http://0.0.0.0:2379]} to cluster 7e27652122e8b2ae
    akka_1  | [INFO] [07/21/2017 21:08:24.309] [main] [akka.remote.Remoting] Starting remoting
    akka_1  | [INFO] [07/21/2017 21:08:24.670] [main] [akka.remote.Remoting] Remoting started; listening on addresses :[akka.tcp://ClusterSystem@127.0.0.1:2551]
    akka_1  | [INFO] [07/21/2017 21:08:24.696] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Starting up...
    akka_1  | [INFO] [07/21/2017 21:08:24.936] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Registered cluster JMX MBean [akka:type=Cluster]
    akka_1  | [INFO] [07/21/2017 21:08:24.936] [main] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Started up successfully
    akka_1  | [INFO] [07/21/2017 21:08:25.005] [ClusterSystem-akka.actor.default-dispatcher-5] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - No seed-nodes configured, manual cluster join required
    akka_1  | [INFO] [07/21/2017 21:08:25.006] [ClusterSystem-akka.actor.default-dispatcher-2] [akka.tcp://ClusterSystem@127.0.0.1:2551/system/constructr] Creating constructr-machine, because no seed-nodes defined
    akka_1  | [INFO] [07/21/2017 21:08:27.112] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Node [akka.tcp://ClusterSystem@127.0.0.1:2551] is JOINING, roles [frontend, backend]
    akka_1  | [INFO] [07/21/2017 21:08:27.143] [ClusterSystem-akka.actor.default-dispatcher-4] [akka.cluster.Cluster(akka://ClusterSystem)] Cluster Node [akka.tcp://ClusterSystem@127.0.0.1:2551] - Leader is moving node [akka.tcp://ClusterSystem@127.0.0.1:2551] to [Up]
    

    Deploy to Kubernetes

    Finally we’re ready to deploy to Kubernetes!

    First deploy etcd

    ➜ docker push {your namespace}/akka-cluster .
    ➜ kubectl apply -f kubernetes/etcd.yaml

    Run a “bounce” pod so you can talk to the cluster easily.
    I’m using my colleague’s debug container which has a bunch of tools built in: https://github.com/markeijsermans/docker-debug.

    ➜ kubectl run bounce --image=markeijsermans/debug -it bash
    If you don't see a command prompt, try pressing enter.
    (21:15 bounce-2304503334-6dqpw:/) curl etcd:2379/health
    {"health": "true"}

    Now deploy the app! If you’ve been pushing your own Docker images, you’ll need to edit the
    kubernetes/nothotdog.yaml file to use your image. Specifically these lines

    ...
            image: lkysow/akka-cluster
    ...

    Push your docker image and then apply the app.

    ➜ docker push {your namespace}/akka-cluster
    ➜ kubectl apply -f kubernetes/nothotdog.yaml

    From your bounce pod, you should be able to curl the app!

    ➜ curl nothotdog:8080?msg=about-a-hotdog
    Hot Dog! (from fe: frontend-3857959296-5x885 be: backend-3899286914-6941z)

    Play Around With Kubernetes

    curl the app in a loop from the bounce pod

    while true; do curl -sS -m 1.5 nothotdog:8080?msg=about-a-hotdog; echo ""; sleep 0.5; done
    Hot Dog! (from fe: frontend-3857959296-5x885 be: backend-3899286914-6941z)
    Hot Dog! (from fe: frontend-3857959296-5x885 be: backend-3899286914-6941z)
    Hot Dog! (from fe: frontend-3857959296-5x885 be: backend-3899286914-6941z)

    Scale the app

    ➜ kubectl scale deployment backend --replicas=3
    ➜ kubectl scale deployment frontend --replicas=3

    Add autoscaling

    ➜ kubectl autoscale deploy backend --min=1 --max=3 --cpu-percent=5
    ➜ kubectl get hpa

    Add some load from the bounce pod

    ➜ slow_cooker -concurrency 10 -qps 300 -interval 5s "http://nothotdog:8080?msg=hotdog"

    And you’re done! Welcome to Akka Cluster on Kubernetes 😀

    Visit original content creator repository
    https://github.com/lkysow/akka-cluster-on-kubernetes

  • nativescript-ffmpeg

    nativescript-ffmpeg

    Build Status npm version

    A Nativescript wrapper for the FFmpeg library. (ONLY SUPPORTS ANDROID)

    Installation

    Run the following command from the root of your project:

    tns plugin add nativescript-ffmpeg
    

    This command automatically installs the necessary files, as well as stores nativescript-ffmpeg as a dependency in your project’s package.json file.

    API

    Static Functions

    Function Description
    execute(command: string | Array<string>, callback?: Callback, debug?: boolean): void Executes a FFmpeg command. The second argument is an optional callback function (which only returns an error message). If you choose to enable the debug flag, the third argument should be set as true and the function will log all events during execution of the commang.

    Usage

    import { Component, OnInit } from "@angular/core";
    import { FFmpeg } from "nativescript-ffmpeg";
    import { VideoRecorder } from "nativescript-videorecorder";
    import * as Permissions from "nativescript-permissions";
    import { isAndroid } from "tns-core-modules/platform";
    import * as dialogs from "tns-core-modules/ui/dialogs";
    
    
    declare const android: any;
    
    @Component({
      selector: "Home",
      moduleId: module.id,
      templateUrl: "./home.component.html"
    })
    export class HomeComponent implements OnInit {
      private _recorder = new VideoRecorder({
        format: "mp4",
        saveToGallery: true,
        hd: true,
        explanation: "We need to be able to record video"
      });
    
      constructor() {
      }
    
      ngOnInit(): void {
      }
    
      private _compress(src: string): void {
        const out = src.replace(/\.[^/.]+$/, "_COMPRESSED.mp4");
        FFmpeg.execute(["-i", src, "-vcodec", "h264", "-acodec", "mp3", out], (err: string) => {
          if (err) {
            this._error(err);
          } else {
            console.log("Compressed file size " + this._getSize(out));
          }
        });
      }
    
      private _error(error: string | Error): Promise<void> {
        return dialogs.alert({
          title: "Uh oh...",
          message: (error instanceof Error) ? error.message : error,
          okButtonText: "OK, got it"
        });
      }
    
      private _getSize(path: string): string {
        let length: number = 0;
        if (isAndroid) {
          const file = new java.io.File(path);
          length = file.length();
        } else {
          const defManager = NSFileManager.defaultManager;
          const fileAttributes = defManager.attributesOfItemAtPathError(path);
          length = fileAttributes.objectForKey(NSFileSize);
        }
        return `${(length / (1000 * 1000)).toFixed(2)} MB`;
      }
    
      private _takeVideo(): void {
        this._recorder.record()
          .then((data) => {
            console.log("Original file size " + this._getSize(data.file));
            this._compress(data.file);
          })
          .catch((error) => { if (error.event !== "cancelled") { this._error("Couldn't record your video"); } });
      }
    
      public takeVideo(): void {
        if (isAndroid) {
          Permissions.requestPermission([android.Manifest.permission.RECORD_AUDIO, android.Manifest.permission.CAMERA],
            "Demo needs Audio and Camera permissions to record a video")
            .then(() => {
              this._takeVideo();
            }, (error) => this._error("Demo needs Audio and Camera permissions to record a video"));
        } else {
          this._takeVideo();
        }
      }
    }

    License

    Apache License Version 2.0, January 2004

    Visit original content creator repository https://github.com/MichaelSolati/nativescript-ffmpeg
  • NewsApp_using_React

    Getting Started with Create React App

    This project was bootstrapped with Create React App.

    Available Scripts

    In the project directory, you can run:

    npm start

    Runs the app in the development mode.
    Open http://localhost:3000 to view it in your browser.

    The page will reload when you make changes.
    You may also see any lint errors in the console.

    npm test

    Launches the test runner in the interactive watch mode.
    See the section about running tests for more information.

    npm run build

    Builds the app for production to the build folder.
    It correctly bundles React in production mode and optimizes the build for the best performance.

    The build is minified and the filenames include the hashes.
    Your app is ready to be deployed!

    See the section about deployment for more information.

    npm run eject

    Note: this is a one-way operation. Once you eject, you can’t go back!

    If you aren’t satisfied with the build tool and configuration choices, you can eject at any time. This command will remove the single build dependency from your project.

    Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except eject will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

    You don’t have to ever use eject. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

    Learn More

    You can learn more in the Create React App documentation.

    To learn React, check out the React documentation.

    Code Splitting

    This section has moved here: https://facebook.github.io/create-react-app/docs/code-splitting

    Analyzing the Bundle Size

    This section has moved here: https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size

    Making a Progressive Web App

    This section has moved here: https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app

    Advanced Configuration

    This section has moved here: https://facebook.github.io/create-react-app/docs/advanced-configuration

    Deployment

    This section has moved here: https://facebook.github.io/create-react-app/docs/deployment

    npm run build fails to minify

    This section has moved here: https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify

    Visit original content creator repository
    https://github.com/INDERJEET0202/NewsApp_using_React

  • kotidien

    Kotidien

    Kotidien

    Kotidien est une application dédiée à la gestion de votre argent. Comptes bancaires, cartes de paiements autonomes, et portefeuille d’espèces. Totalement libre et gratuite, elle vous permets de tenir vos comptes d’une main de fer. Écrite en Python 3 et compatible Linux (intégration parfaite sous KDE via l’utilisation de QT 5.12), Microsoft Windows 7 et supérieurs, Mac OS 10.11 et supérieurs. Kotidien vous donne un accès permanent et en temps réel sur vos différents soldes, permets aussi d’automatiser l’écriture de vos transaction récurrentes, de pointer celles mises à jour sur votre interface bancaire, etc Agencées au jour le jour, supplantées par une vue calendrier, et synthétisées sur des graphiques clairs, toutes vos transactions sont réunies au sein de Kotidien. La complétion automatique des différentes informations permet une saisie plus rapide des données. Plusieurs languages vous sont proposés avec par défaut le Français.

    Points forts

    • Protection du dossier financier Kotidien par mot de passe
    • Copie de sauvegarde (.bak) automatique à chaque ouverture d’un dossier.
    • Facilement transportable, ne nécessite pas d’installation!
    • Assistant de création de dossiers financiers
    • Supporte les comptes en banques, cartes de paiements autonomes et – portefeuilles d’espèces.
    • Personnalisation des types de transactions (carte bancaire, virement, prélèvement, etc.)
    • Personnalisation des catégories et sous catégories
    • Personnalisation des tiers
    • Calcul automatique du solde du jour
    • Prévision automatique du solde “fin de mois”
    • Classement des transactions par jours
    • Anticipation du solde à date souhaitée
    • Possibilité d’ajouter titre, mémo et commentaire pour chaque transaction
    • Complétion automatique des données pour une écriture rapide des transactions
    • Gestion du découvert
    • Gestion des transferts entre comptes bancaires d’un même dossier Kotidien
    • Planification automatique de transactions avec répétitions programmables
    • Importation et exportation des données au format CVS programmable
    • Importation et exportation des données au format OFX compatible Money 98-2003
    • Résumé graphique des différentes évolutions de votre dossier financier
    • Statistiques graphiques complètes
    • Fichier d’aide disponible directement depuis l’application
    • Traduction de l’application en plusieurs langues. Français par défaut.
    • Possibilité de personnaliser l’apparence de Kotidien pour redistribuer l’application aux couleurs de votre système.
    • Incorporation facile par dossier ‘vendor’
    • Totalement libre et gratuit! Licence open-source GNU GPL v3
    • Écrite en Python, utilise QT. Supporte Windows , Linux et Mac OS.

    Kotidien - Liste des transactions

    Kotidien - Accueil et résumé

    Kotidien - Vue calendrier

    Installation et utilisation

    Compatibilité

    • Microsoft Windows 32bits / 64bits – (7, 8, 10)
    • Linux 64bits – (libc6 2.29+ > Ubuntu 19.04+, Debian 11+, Fedora 31+, openSUSE Tumbleweed+)

    Exécution

    Aucune installation n’est nécessaire. Décompressez l’archive dans le dossier de votre choix et exécutez le fichier Kotidien ou Kotidien.exe pour lancer l’application

    # linux
    $ chmod +x Kotidien
    $ ./Kotidien
    
    # windows
    > Kotidien.exe

    Important

    • Pour la version Linux, requiert libc6 2.29 ou supérieur (GLIBC_2.29+)

    Aide et utilisation

    un forum de discussion ainsi que des pages d’aides sont mis en place sur SourceForge.

    Rendez-vous sur Aide et Discussion

    Eléments externes

    Icones utilisées par l’application.

    Licence CC BY-ND 3.0

    pycountry provides the ISO databases for the standards:

    639-3 Languages 3166 Countries 3166-3 Deleted countries 3166-2 Subdivisions of countries 4217 Currencies 15924 Scripts The package includes a copy from Debian’s pkg-isocodes and makes the data accessible through a Python API.

    Translation files for the various strings are included as well.

    Licence GNU Lesser General Public License v2

    A simple currency module to:

    • Retrive various info about currency
    • Format currency price
    • Convert between currencies

    Licence BSD License

    PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PyQt5/PySide/PySide2 and numpy.

    It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching, Qt’s GraphicsView framework for 2D display, and OpenGL for 3D display.

    Licence MIT

    fpdf2 is a minimalist PDF creation library for Python:

    It is a fork and the successor of PyFPDF. Compared with other PDF libraries, fpdf2 is simple, small and versatile, with advanced capabilities, and is easy to learn, extend and maintain.

    Licence GNU Lesser General Public License v3

    ofxtools is a Python library for working with Open Financial Exchange (OFX) data – the standard format for downloading financial information from banks and stockbrokers. OFX data is widely provided by financial institutions so that their customers can import transactions into financial management software such as Quicken, Microsoft Money, or GnuCash.

    If you want to download your transaction data outside of one of these programs – if you wish to develop a Python application to use this data – if you need to generate your own OFX-formatted data… ofxtools is for you!

    Licence MIT

    cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your “cryptographic standard library”. It supports Python 3.6+ and PyPy3 7.2+.

    cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions.

    Licence BSD License

    The dateutil module provides powerful extensions to the standard datetime module, available in Python.

    Licence BSD License

    Pure-Python bindings to glibc (based on ctypes).

    Licence GNU Lesser General Public License v3

    Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.

    Licence MIT

    A python (3.5+) module that wraps pdftoppm and pdftocairo to convert PDF to a PIL Image object.

    Licence MIT

    Easily download, build, install, upgrade, and uninstall Python packages.

    Licence MIT

    Python bindings for the Qt cross platform application toolkit.

    Licence GNU Lesser General Public License v3

    Informations

    Copyright (c)2020-2024 Christophe LEMOINE

    https://sourceforge.net/projects/kotidien/

    Date de création 05/11/2020

    Kotidien est sous licence libre et open-source GNU GPL v3. Cette licence vous permet de redistribuer, modifier et améliorer Kotidien à votre guise. Elle vous interdit de revendre l’application ou ce qu’elle contient. Toute modification, redistribution ou amélioration devra citer l’auteur original dans le respect de la licence.

    Licence de Kotidien

    GNU General Public License v3

    Contribuer / Compiler

    Utiliser un conteneur Docker. Tout terrain, simple et efficace.

    Benoit485 propose d’utiliser Docker pour compiler et lancer Kotidien sur votre machine sans vous soucier des versions de Python et des dépendances requises. Pratique non? 😉

    Pour ce faire, vous retrouverez toutes les instructions nécessaires dans son dépot dédié: Kotidien_docker

    Compiler manuellement. J’aime le cambouis, j’y mets les mains…

    1) Créer un environement virtuel

    $ pip3 install virtualenv
    $ python3 -m venv env
    $ source env/bin/activate

    2) Installer les dépendances

    $ pip3 install pycountry nh-currency pyqtgraph fpdf2 ofxtools cryptography python-dateutil glibc six pdf2image setuptools PyQt5

    3) Compiler les ressources

    $ cd code
    $ pyrcc5 resources.qrc -o resources.py

    4) [Facultatif] – Traduire et compiler les traductions

    # créé le catalogue
    $ lupdate * -ts fr_FR.ts -verbose
    # complète le catalogue avec le contenu des scripts Pythons
    $ pylupdate5 ./ui/*.py -ts fr_FR.ts -verbose
    # corrige certains accents
    $ python3 lupdate_ts_repair.py fr_FR.ts
    # compile le catalogue
    $ lrelease fr_FR.ts -qm fr_FR.qm -verbose

    5) Construire l’éxécutable avec ‘pyinstaller’

    # linux
    # installer pyinstaller
    $ pip3 install pyinstaller
    # freezer l'application
    $ pyinstaller --clean --distpath ../dist/Kotidien.linux --workpath ../build/linux -y Kotidien.spec
    
    # windows
    # installer pyinstaller
    > pip install pyinstaller
    # freezer l'application
    > pyinstaller.exe --clean --distpath ../dist/Kotidien.win --workpath ../build/win -y Kotidien.spec

    Fichiers de données

    appinfos.py

    Contient les informations relatives à l’application.

    globalsv.py

    Paramètres par défaut et données globales utilisées par l’application.

    Kotidien.spec / Kotidien.rc.tpl / Kotidien.rc

    Paramètres utilisés par pyinstaller.

    • Kotidien.spec : Fichier de configuration pour la compilation
    • *Kotidien.rc.tpl / Kotidien.rc : Fichier de configuration du manifest de l’exécutable pour Microsoft Windows

    resources.py / resources.qrc

    Liste des ressources utilisées dans l’application.

    datamodels.py

    Structure meme d’un portefeuille Kotidien. La base de toute l’application.

    Visit original content creator repository https://github.com/pantaflex44/kotidien
  • kotidien

    Kotidien

    Kotidien

    Kotidien est une application dédiée à la gestion de votre argent. Comptes bancaires, cartes de paiements autonomes, et portefeuille d’espèces. Totalement libre et gratuite, elle vous permets de tenir vos comptes d’une main de fer. Écrite en Python 3 et compatible Linux (intégration parfaite sous KDE via l’utilisation de QT 5.12), Microsoft Windows 7 et supérieurs, Mac OS 10.11 et supérieurs. Kotidien vous donne un accès permanent et en temps réel sur vos différents soldes, permets aussi d’automatiser l’écriture de vos transaction récurrentes, de pointer celles mises à jour sur votre interface bancaire, etc Agencées au jour le jour, supplantées par une vue calendrier, et synthétisées sur des graphiques clairs, toutes vos transactions sont réunies au sein de Kotidien. La complétion automatique des différentes informations permet une saisie plus rapide des données. Plusieurs languages vous sont proposés avec par défaut le Français.

    Points forts

    • Protection du dossier financier Kotidien par mot de passe
    • Copie de sauvegarde (.bak) automatique à chaque ouverture d’un dossier.
    • Facilement transportable, ne nécessite pas d’installation!
    • Assistant de création de dossiers financiers
    • Supporte les comptes en banques, cartes de paiements autonomes et – portefeuilles d’espèces.
    • Personnalisation des types de transactions (carte bancaire, virement, prélèvement, etc.)
    • Personnalisation des catégories et sous catégories
    • Personnalisation des tiers
    • Calcul automatique du solde du jour
    • Prévision automatique du solde “fin de mois”
    • Classement des transactions par jours
    • Anticipation du solde à date souhaitée
    • Possibilité d’ajouter titre, mémo et commentaire pour chaque transaction
    • Complétion automatique des données pour une écriture rapide des transactions
    • Gestion du découvert
    • Gestion des transferts entre comptes bancaires d’un même dossier Kotidien
    • Planification automatique de transactions avec répétitions programmables
    • Importation et exportation des données au format CVS programmable
    • Importation et exportation des données au format OFX compatible Money 98-2003
    • Résumé graphique des différentes évolutions de votre dossier financier
    • Statistiques graphiques complètes
    • Fichier d’aide disponible directement depuis l’application
    • Traduction de l’application en plusieurs langues. Français par défaut.
    • Possibilité de personnaliser l’apparence de Kotidien pour redistribuer l’application aux couleurs de votre système.
    • Incorporation facile par dossier ‘vendor’
    • Totalement libre et gratuit! Licence open-source GNU GPL v3
    • Écrite en Python, utilise QT. Supporte Windows , Linux et Mac OS.

    Kotidien - Liste des transactions

    Kotidien - Accueil et résumé

    Kotidien - Vue calendrier

    Installation et utilisation

    Compatibilité

    • Microsoft Windows 32bits / 64bits – (7, 8, 10)
    • Linux 64bits – (libc6 2.29+ > Ubuntu 19.04+, Debian 11+, Fedora 31+, openSUSE Tumbleweed+)

    Exécution

    Aucune installation n’est nécessaire. Décompressez l’archive dans le dossier de votre choix et exécutez le fichier Kotidien ou Kotidien.exe pour lancer l’application

    # linux
    $ chmod +x Kotidien
    $ ./Kotidien
    
    # windows
    > Kotidien.exe

    Important

    • Pour la version Linux, requiert libc6 2.29 ou supérieur (GLIBC_2.29+)

    Aide et utilisation

    un forum de discussion ainsi que des pages d’aides sont mis en place sur SourceForge.

    Rendez-vous sur Aide et Discussion

    Eléments externes

    Icones utilisées par l’application.

    Licence CC BY-ND 3.0

    pycountry provides the ISO databases for the standards:

    639-3 Languages 3166 Countries 3166-3 Deleted countries 3166-2 Subdivisions of countries 4217 Currencies 15924 Scripts The package includes a copy from Debian’s pkg-isocodes and makes the data accessible through a Python API.

    Translation files for the various strings are included as well.

    Licence GNU Lesser General Public License v2

    A simple currency module to:

    • Retrive various info about currency
    • Format currency price
    • Convert between currencies

    Licence BSD License

    PyQtGraph is a pure-python graphics and GUI library built on PyQt4/PyQt5/PySide/PySide2 and numpy.

    It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching, Qt’s GraphicsView framework for 2D display, and OpenGL for 3D display.

    Licence MIT

    fpdf2 is a minimalist PDF creation library for Python:

    It is a fork and the successor of PyFPDF. Compared with other PDF libraries, fpdf2 is simple, small and versatile, with advanced capabilities, and is easy to learn, extend and maintain.

    Licence GNU Lesser General Public License v3

    ofxtools is a Python library for working with Open Financial Exchange (OFX) data – the standard format for downloading financial information from banks and stockbrokers. OFX data is widely provided by financial institutions so that their customers can import transactions into financial management software such as Quicken, Microsoft Money, or GnuCash.

    If you want to download your transaction data outside of one of these programs – if you wish to develop a Python application to use this data – if you need to generate your own OFX-formatted data… ofxtools is for you!

    Licence MIT

    cryptography is a package which provides cryptographic recipes and primitives to Python developers. Our goal is for it to be your “cryptographic standard library”. It supports Python 3.6+ and PyPy3 7.2+.

    cryptography includes both high level recipes and low level interfaces to common cryptographic algorithms such as symmetric ciphers, message digests, and key derivation functions.

    Licence BSD License

    The dateutil module provides powerful extensions to the standard datetime module, available in Python.

    Licence BSD License

    Pure-Python bindings to glibc (based on ctypes).

    Licence GNU Lesser General Public License v3

    Six is a Python 2 and 3 compatibility library. It provides utility functions for smoothing over the differences between the Python versions with the goal of writing Python code that is compatible on both Python versions. See the documentation for more information on what is provided.

    Licence MIT

    A python (3.5+) module that wraps pdftoppm and pdftocairo to convert PDF to a PIL Image object.

    Licence MIT

    Easily download, build, install, upgrade, and uninstall Python packages.

    Licence MIT

    Python bindings for the Qt cross platform application toolkit.

    Licence GNU Lesser General Public License v3

    Informations

    Copyright (c)2020-2024 Christophe LEMOINE

    https://sourceforge.net/projects/kotidien/

    Date de création 05/11/2020

    Kotidien est sous licence libre et open-source GNU GPL v3. Cette licence vous permet de redistribuer, modifier et améliorer Kotidien à votre guise. Elle vous interdit de revendre l’application ou ce qu’elle contient. Toute modification, redistribution ou amélioration devra citer l’auteur original dans le respect de la licence.

    Licence de Kotidien

    GNU General Public License v3

    Contribuer / Compiler

    Utiliser un conteneur Docker. Tout terrain, simple et efficace.

    Benoit485 propose d’utiliser Docker pour compiler et lancer Kotidien sur votre machine sans vous soucier des versions de Python et des dépendances requises. Pratique non? 😉

    Pour ce faire, vous retrouverez toutes les instructions nécessaires dans son dépot dédié: Kotidien_docker

    Compiler manuellement. J’aime le cambouis, j’y mets les mains…

    1) Créer un environement virtuel

    $ pip3 install virtualenv
    $ python3 -m venv env
    $ source env/bin/activate

    2) Installer les dépendances

    $ pip3 install pycountry nh-currency pyqtgraph fpdf2 ofxtools cryptography python-dateutil glibc six pdf2image setuptools PyQt5

    3) Compiler les ressources

    $ cd code
    $ pyrcc5 resources.qrc -o resources.py

    4) [Facultatif] – Traduire et compiler les traductions

    # créé le catalogue
    $ lupdate * -ts fr_FR.ts -verbose
    # complète le catalogue avec le contenu des scripts Pythons
    $ pylupdate5 ./ui/*.py -ts fr_FR.ts -verbose
    # corrige certains accents
    $ python3 lupdate_ts_repair.py fr_FR.ts
    # compile le catalogue
    $ lrelease fr_FR.ts -qm fr_FR.qm -verbose

    5) Construire l’éxécutable avec ‘pyinstaller’

    # linux
    # installer pyinstaller
    $ pip3 install pyinstaller
    # freezer l'application
    $ pyinstaller --clean --distpath ../dist/Kotidien.linux --workpath ../build/linux -y Kotidien.spec
    
    # windows
    # installer pyinstaller
    > pip install pyinstaller
    # freezer l'application
    > pyinstaller.exe --clean --distpath ../dist/Kotidien.win --workpath ../build/win -y Kotidien.spec

    Fichiers de données

    appinfos.py

    Contient les informations relatives à l’application.

    globalsv.py

    Paramètres par défaut et données globales utilisées par l’application.

    Kotidien.spec / Kotidien.rc.tpl / Kotidien.rc

    Paramètres utilisés par pyinstaller.

    • Kotidien.spec : Fichier de configuration pour la compilation
    • *Kotidien.rc.tpl / Kotidien.rc : Fichier de configuration du manifest de l’exécutable pour Microsoft Windows

    resources.py / resources.qrc

    Liste des ressources utilisées dans l’application.

    datamodels.py

    Structure meme d’un portefeuille Kotidien. La base de toute l’application.

    Visit original content creator repository https://github.com/pantaflex44/kotidien
  • g10k

    Build Status Go Report Card

    g10k

    My r10k fork written in Go, designed to work somwhat similar like puppetlabs/r10k.

    Why fork?

    • Lack of caching/version-pre-checking in current r10k implementation hurt performance beyond a certain # of modules per Puppetfile
    • We need distinct SSHKeys for each source in the r10k.yaml and ‘rugged’ never really wanted to play nice (fixed in r10k 2.2.0)
    • Good excuse to try Go 😉

    Changes breaking complete r10k compatibility

    • No SVN support
    • Forge modules must be specified like this:
    mod 'theforeman/puppet'
    
    • Git modules must be specified like this:
    mod 'apache',
      :git => 'https://github.com/puppetlabs/puppetlabs-apache.git'
    

    Non-breaking changes to r10k

    • Download/Cache each git Puppet Module repository and each Puppetlabs Forge Puppet Module for each respective version only once
    • Most things (git, forge, and copy operations) done in parallel over each branch
    • Optional support for different ssh keys for each source inside the r10k.yaml

    Pseudo “benchmark”

    Using Puppetfile with 4 git repositories and 25 Forge modules https://github.com/xorpaul/g10k-environment/blob/benchmark/Puppetfile

    2016-10-14 w/o cache w/ cache
    r10k 1m14s,1m18s,1m12s 18s,17s,17s
    g10k 4.6s,5s,4.7s 1s,1s,1s

    Using go 1.7.1 and g10k commit 7524778 Using ruby 2.1.5+deb8u2 and r10k v2.4.3 On Dell PowerEdge R320 Intel Xeon E5-2430 24 GB RAM on Debian Jessie

    Benchmark w/o cache
    rm -rf /tmp/g10k ; GDIR=$RANDOM ; mkdir /tmp/$GDIR/ ; cd /tmp/$GDIR/ ; \
    wget https://raw.githubusercontent.com/xorpaul/g10k-environment/benchmark/Puppetfile ; \
    time g10k -puppetfile
    
    RDIR=$RANDOM ; mkdir /tmp/$RDIR/ ; cd /tmp/$RDIR/ ; \
    wget https://raw.githubusercontent.com/xorpaul/g10k-environment/benchmark/Puppetfile ; \
    time r10k puppetfile install
    
    Benchmark w/ cache
    cd /tmp/$GDIR/ ; time g10k -puppetfile
    cd /tmp/$RDIR/ ; time r10k puppetfile install
    

    installation

    You can just grab the most recent stable release here: https://github.com/xorpaul/g10k/releases

    • Before using g10k with a large Puppet setup with many modules, be sure to increase the amount of open file handles (nfiles) and number of child processes (nproc), see limits.conf(5) for details.
    • If you are using a private Git or Forge server think about adjusting the -maxworker parameter/config setting before DOSing your own infrastructure 😉 (default 50)
    • To protect your local machine use -maxextractworker parameter/config setting with wich you can limit the number of Goroutines that are allowed to run in parallel for local Git and Forge module extracting processes (git clone, untar and gunzip) (default 20)

    installation of g10k via Puppet module

    User @Conzar was so nice and shared his g10k Puppet module that you can check out here:

    Usage Docs

    Usage of ./g10k:
      -branch string
            which git branch of the Puppet environment to update. Just the branch name, e.g. master, qa, dev
      -cachedir string
            allows overriding of the g10k config file cachedir setting, the folder in which g10k will download git repositories and Forge modules
      -check4update
            only check if the is newer version of the Puppet module avaialable. Does implicitly set dryrun to true
      -checksum
            get the md5 check sum for each Puppetlabs Forge module and verify the integrity of the downloaded archive. Increases g10k run time!
      -clonegit
            populate the Puppet environment with a git clone of each git Puppet module. Helpful when developing locally with -puppetfile
      -config string
            which config file to use
      -debug
            log debug output, defaults to false
      -dryrun
            do not modify anything, just print what would be changed
      -environment string
            which Puppet environment to update. Source name inside the config + '_' + branch name, e.g. foo_master, foo_qa, foo_dev
      -force
            purge the Puppet environment directory and do a full sync
      -gitobjectsyntaxnotsupported
            if your git version is too old to support reference syntax like master^{object} use this setting to revert to the older syntax
      -info
            log info output, defaults to false
      -maxextractworker int
            how many Goroutines are allowed to run in parallel for local Git and Forge module extracting processes (git clone, untar and gunzip) (default 20)
      -maxworker int
            how many Goroutines are allowed to run in parallel for Git and Forge module resolving (default 50)
      -module string
            which module of the Puppet environment to update, e.g. stdlib
      -moduledir string
            allows overriding of Puppetfile specific moduledir setting, the folder in which Puppet modules will be extracted
      -outputname string
            overwrite the environment name if -branch is specified
      -puppetfile
            install all modules from Puppetfile in cwd
      -puppetfilelocation string
            which Puppetfile to use in -puppetfile mode (default "./Puppetfile")
      -quiet
            no output, defaults to false
      -retrygitcommands
            if g10k should purge the local repository and retry a failed git command (clone or remote update) instead of failing
      -tags
            to pull tags as well as branches
      -usecachefallback
            if g10k should try to use its cache for sources and modules instead of failing
      -usemove
            do not use hardlinks to populate your Puppet environments with Puppetlabs Forge modules. Instead uses simple move commands and purges the Forge cache directory after each run! (Useful for g10k runs inside a Docker container)
      -validate
            only validate given configuration and exit
      -verbose
            log verbose output, defaults to false
      -version
            show build time and version number
    

    Regarding anything usage/workflow you really can just use the great puppetlabs/r10k docs as the Puppetfile etc. are all intentionally kept unchanged.

    Using g10k behind a proxy

    Set the environment variables http_proxy or https_proxy to make g10k use a proxy. E.g. http_proxy=http://proxy.domain.tld:8080 ./g10k -puppetfile See https://golang.org/pkg/net/http/#ProxyFromEnvironment for details.

    additional Puppetfile features

    • link Git module branch to the current environment branch:
    mod 'awesomemodule',
        :git => 'http://github.com/foo/bar.git',
        :link => 'true'
    

    If you are in environment branch dev then g10k would try to check out this module with branch dev. This helps to be able to use the same Puppetfile over multiple environment branches and makes merges easier. See #6 for details.

    Now also supports the r10k setting name :branch => :control_branch See #73

    • only clone if branch/tag/commit exists
    mod 'awesomemodule',
        :git => 'http://github.com/foo/bar.git',
        :ignore-unreachable => 'true'
    

    In combination with the previous link feature you don’t need to keep all environment branches also available for your modules. See #9 for details.

    • use different Forge base URL for your modules in your Puppetfile
    forge.baseUrl http://foobar.domain.tld/
    
    • skip version checks for latest Forge modules for a certain time to speed up the sync
    forge.cacheTtl 4h
    

    You need to specify the TTL value in the form of golang Duration (https://golang.org/pkg/time/#ParseDuration)

    • try multiple Git branches for a Puppet module until one can be used
    mod 'stdlib',
        :git => 'https://github.com/puppetlabs/puppetlabs-stdlib.git',
        :fallback => '4.889.x|foobar|master'
    

    In this example g10k tries to use the branches:

    4.889.x -> foobar -> master

    Because there are no branches 4.889.x or foobar.

    All without failing or error messages.

    Tip: You can see which branch was used, when using the -verbose parameter:

    ./g10k -puppetfile -verbose
    2016/11/08 14:16:40 Executing git --git-dir ./tmp/https-__github.com_puppetlabs_puppetlabs-stdlib.git remote update --prune took 1.05001s
    2016/11/08 14:16:40 Executing git --git-dir ./tmp/https-__github.com_puppetlabs_puppetlabs-stdlib.git log -n1 --pretty=format:%H master took 0.00299s
    Synced ./Puppetfile with 4 git repositories and 0 Forge modules in 1.1s with git (1.1s sync, I/O 0.0s) and Forge (0.0s query+download, I/O 0.0s)
    

    Now also supports the r10k setting name :default_branch => 'master' See #73

    • additionl Git attribute :use_ssh_agent:

    Normally g10k adds the SSH key specified in the g10k config for each SSH+Git module in your Puppetfile. If you don’t want to use this SSH key, need a different key for a certain Git module or have the key encrypted in your SSH agent, then use this parameter to skip the ssh-add commands:

    mod 'example_module',
      :git => 'git@somehost.com/foo/example-module.git',
      :branch => 'foo',
      :use_ssh_agent => true
    

    See #171 for more details.

    • additional Forge attribute :sha256sum:

    For (some) increased security you can add a SHA256 sum for each Forge module, which g10k will verify after downloading the respective .tar.gz file:

    mod 'puppetlabs/ntp', '6.0.0', :sha256sum => 'a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944'
    
    

    This does provide a very crude way to detect manipulated Forge modules and MITM attacks until the Puppetlabs Forge does support some sort of signing of Forge module releases.

    If the SHA256 sum does not match the expected hash sum, g10k will warn the user and retry a download until giving up:

    Resolving Forge modules (0/1)   --- [--------------------------------------------------------------------]   0%
    WARNING: calculated sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944 for ./tmp/puppetlabs-ntp-6.0.0.tar.gz does not match expected sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c94
    Resolving Forge modules (0/1)   --- [--------------------------------------------------------------------]   0%
    WARNING: calculated sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c944 for ./tmp/puppetlabs-ntp-6.0.0.tar.gz does not match expected sha256sum a988a172a3edde6ac2a26d0e893faa88d37bc47465afc50d55225a036906c94
    2016/12/08 18:05:11 downloadForgeModule(): giving up for Puppet module puppetlabs-ntp version: 6.0.0
    
    

    (The Forge module retry count in case the Puppetlabs Forge provided MD5 sum, file archive size or SHA256 sum doesn’t match defaults to 1, but will be user configurable later.)

    • override g10k cache directory with environment variable

    You can use the following environment variable to make g10k use a different cache directory:

    g10k_cachedir=/var/tmp g10k ...
    

    This will also override the -cachedir parameter.

    additional g10k config features compared to r10k

    • you can enforce version numbers of Forge modules in your Puppetfiles instead of :latest or :present by adding force_forge_versions: true to the g10k config in the specific resource
    ---
    :cachedir: '/tmp/g10k'
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/example/'
        force_forge_versions: true
    

    If g10k then encounters :latest or :present for a Forge module it errors out with:

    2016/11/15 18:45:38 Error: Found present setting for forge module in /tmp/example/example_benchmark/Puppetfile for module puppetlabs/concat line: mod 'puppetlabs/concat' and force_forge_versions is set to true! Please specify a version (e.g. '2.3.0')
    
    • g10k can let you know if your source does not contain the branch you specified with the -branch parameter:
    ---
    :cachedir: '/tmp/g10k'
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/example/'
        warn_if_branch_is_missing: true
    

    If you then call g10k with this config file and the following parameter -branch nonExistingBranch. You should get:

    WARNING: Couldn't find specified branch 'nonExistingBranch' anywhere in source 'example' (https://github.com/xorpaul/g10k-environment.git)
    

    This can be helpful if you use a dedicated hiera repository/g10k source and you want to ensure that you always have a matching branch, see #45

    • By default g10k fails if one of your Puppet environments could not be completely populated (e.g. if one of your Puppet Git module branches doesn’t exist anymore). You can change this by setting ignore_unreachable_modules to true in your g10k config:
    ---
    :cachedir: '/tmp/g10k'
    ignore_unreachable_modules: true
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-failing-env.git'
        basedir: '/tmp/failing/'
    

    If you then call g10k with this config file and debug verbosity level, you should get:

    DEBUG: Failed to populate module /tmp/failing/master/modules//sensu/ but ignore-unreachable is set. Continuing...
    

    See #57 for details.

    • abort g10k run if source repository is unreachable
    ---
    :cachedir: '/tmp/g10k'
    
    sources:
      example:
        remote: 'git://github.com/xorpaul/g10k-environment-unavailable.git'
        basedir: '/tmp/example/'
        exit_if_unreachable: true
    

    If you then call g10k with this config file. You should get:

    WARN: git repository git://github.com/xorpaul/g10k-environment-unavailable.git does not exist or is unreachable at this moment!
    WARNING: Could not resolve git repository in source 'example' (git://github.com/xorpaul/g10k-environment-unavailable.git)
    

    with an exit code 1

    • g10k can use the cached version of Forge and git modules if their sources are currently not available:
    ---
    :cachedir: '/tmp/g10k'
    use_cache_fallback: true
    
    sources:
      example:
        remote: 'git://github.com/xorpaul/g10k-environment-unavailable.git'
        basedir: '/tmp/example/'
    

    If you then call g10k with this config file and your github.com repository is unavailable your g10k run tries to find a suitable cached version of your modules:

    WARN: git repository https://github.com/puppetlabs/puppetlabs-firewall.git does not exist or is unreachable at this moment!
    WARN: Trying to use cache for https://github.com/puppetlabs/puppetlabs-firewall.git git repository
    

    if your g10k did manage to at least once cache this git repository.

    If there is no useable cache available your g10k run still fails.

    • You can let g10k retry to git clone or update the local repository if it failed before and was left in a corrupted state:
    ---
    :cachedir: '/tmp/g10k'
    retry_git_commands: true
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/example/'
    

    If you then call g10k with this config file and have a corrupted local Git repository, g10k deletes the local cache and retries the Git clone command once:

    WARN: git command failed: git --git-dir /tmp/g10k/modules/https-__github.com_puppetlabs_puppetlabs-firewall.git remote update --prune deleting local cached repository and retrying...
    

    See #76 for details.

    • Autocorrecting Puppet environment names

    Like in r10k for each source in your g10k config you can set the attribute invalid_branches with the following values:

    • correct_and_warn: Non-word characters will be replaced with underscores and a warning will be emitted.
    • correct: Non-word characters will silently be replaced with underscores.
    • error: Branches with non-word characters will be ignored and an error will be emitted.

    The default value is to leave the environment unchanged, which differs from the r10k default!

    Example:

    ---
    :cachedir: '/tmp/g10k'
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/example/'
        invalid_branches: 'correct'
    

    If you then call g10k with this config file and have a branch named something like single_autocorrect-%-fooo it will be renamed to single_autocorrect___fooo

    See #81 for details.

    • Support for older Git versions, like on CentOS 6

    To check for really existing objects, g10k uses master^{object} syntax, which is not supported in older Git versions, like on CentOS 6, see #91 g10k will skip this sanity check when the g10k config setting git_object_syntax_not_supported is set to true (defaults to false) Example:

    ---
    :cachedir: '/tmp/g10k'
    git_object_syntax_not_supported: true
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/example/'
    
    • Added support for r10k-like purge behaviour of stale content

    Starting with v.0.9.0 g10k supports the r10k-like purge behaviour of stale content with the different configuration settings purge_level and purge_allowlist as documented here for purge_levels and here for purge_allowlist

    Please check if you need to allowlist files/folders inside your Puppet environments!

    As an additional setting, you can also allowlist Puppet environments with deployment_purge_allowlist, that would’ve been purged by the deployment purge_level. This can be helpful if you have a similar source name or prefix set. E.g. having a source called foobar and another one foobar_hiera would have purged all foobar_hiera_* branches if there are not branches called hiera_master or similar in the foobar source.

    Example:

    ---
    deploy:
      purge_levels: ['deployment', 'puppetfile', 'environment']
      purge_allowlist: [ '.latest_revision', '.resource_types', 'resource_types/*.pp', '**/*.pp'. ]
      deployment_purge_allowlist: [ 'example_hiera_*', '.resource_types' ]
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: '/tmp/out/'
        prefix: true
      example_hiera:
        remote: 'https://github.com/xorpaul/g10k-hiera.git'
        basedir: '/tmp/out/'
        prefix: true
    

    Starting with v.0.7.1 g10k supports purge_skiplist feature to remove unnecessary files from the sync / Puppetservers.

    Example:

    ---
    deploy:
      purge_skiplist: [ 'spec', 'readmes', 'examples', '*.markdown', '*.md', 'junit', 'docs' ]
    
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        prefix: true
        basedir: './example/'
    

    Starting with v.0.8.12 g10k supports filtering branches via regex or an external script:

    Example using external script:

    ---
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: './example/'
        filter_command: 'tests/branch_filter_command.sh $R10K_BRANCH ^(single|master)$'
    

    or via regex

    ---
    sources:
      example:
        remote: 'https://github.com/xorpaul/g10k-environment.git'
        basedir: './example/'
        filter_regex: '^(single|master)$'
    

    See #166 for the discussion and #167 for the merge request.

    building

    # only initially needed to resolve all dependencies
    go get
    # actually compiling the binary with the current date as build time
    BUILDTIME=$(date -u '+%Y-%m-%d_%H:%M:%S') && go build -ldflags "-s -w -X main.buildtime=$BUILDTIME"
    

    execute example with debug output

    ./g10k -debug -config test.yaml
    
    Visit original content creator repository https://github.com/xorpaul/g10k
  • mispex

    MISP

    A wrapper around MISP’s HTTP API to provide native interaction.

    Build Status

    Installation

    If available in Hex, the package can be installed by adding mispex to your list of dependencies in mix.exs:

    def deps do
      [
        {:mispex, "~> 0.1.8"}
      ]
    end

    Configuration

    In your application config, add a block of the format

    config :mispex,
      url: "https://misp.local",
      apikey: "myapikey"

    Usage

    See the full documentation for full reference, but here are a few common usage examples

    Documentation can also be generated with ExDoc

    All functions that call the API in any way return a tuple of the format:

    {:ok, value}
    {:error, reason}

    To indicate whether the API call was successful or not.

    For example

    iex> MISP.Event.create(%MISP.EventInfo{info: "my event"})
    {:ok,
     %MISP.Event{
     }
    }
    
    iex> MISP.Event.create(%MISP.EventInfo{})
    {:error, "Event.info: Info cannot be empty."}

    Create an event

    {:ok, my_event} = %MISP.EventInfo{info: "my event"} |> MISP.Event.create()

    Retrive an event

    {:ok, my_event} = MISP.Event.get(15)

    Update an event

    {:ok, my_event} = MISP.Event.get(17)
    
    {:ok, my_updated_event} = 
      my_event
      |> put_in([:Event, :info], "my new info field")
      |> MISP.Event.update()

    Add an attribute

    {:ok, my_event} = MISP.Event.get(17)
    
    {:ok, updated_event} =
      my_event
      |> MISP.Event.add_attribute(%MISP.Attribute{value: "8.8.8.8", type: "ip-dst"})
      |> MISP.Event.update()

    Tag an event

    {:ok, my_event} = MISP.Event.get(17)
    
    {:ok, tagged_event} = 
      my_event
      |> MISP.Event.add_tag(%MISP.Tag{name: "my tag"})
      |> MISP.Event.update()

    Tag an attribute

    {:ok, matching} = MISP.Attribute.search(%{value: "8.8.8.8"})
    
    {:ok, updated_attr} =
      matching
      |> List.first() 
      |> MISP.Attribute.add_tag(%MISP.Tag{name: "my tag"})
      |> MISP.Attribute.update()

    Create an event with attributes and tags already applied

    %MISP.EventInfo{
        info: "my event",
        Attribute: [
            %MISP.Attribute{
                value: "8.8.8.8",
                type: "ip-dst",
                Tag: [
                    %MISP.Tag{name: "my attribute-level tag"}
                ]
            }
        ],
        Tag: [
            %MISP.Tag{name: "my event-level tag"}
        ]
    } |> MISP.Event.create()
    Visit original content creator repository https://github.com/FloatingGhost/mispex