This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A payment processing systems (like Stripe) allow business to accept payment from customers, without having to build their own payment processing infrastructure. Customer input their payment details on the merchant's website, and the merchant sends the payment details to the processor. Processor then processes the payment and returns the result to the merchant. | |
| * Merchants should be able to initiate payment. | |
| * Consider card authorize, capture and combined flow (authorize + capture). | |
| * Merchants should be able to schedule recurring payments (for example monthly subscriptions). | |
| * Merchants should be able to cancel or refund payments. | |
| * Users should be able to pay for products with credit/debit cards and bank accounts. | |
| * Merchants should be able to view status of payments (e.g., pending, success, failed, chargeback). | |
| * Consider fault handling, such as insufficient funds, bank server unavailable. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "import": { | |
| "1.5.0": "default-vac-v1.json", | |
| "2.0.0": "default-vac-v2.json" | |
| }, | |
| "search_fields": [ | |
| { | |
| "name": "status", | |
| "target": "status", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install elasticsearch | |
| wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
| apt-get install apt-transport-https | |
| echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
| apt-get update | |
| apt-get install kibana | |
| # Configure elastic | |
| sed -i '/#server.host: 192.168.0.1/c\server.host: 0.0.0.0' /etc/kibana/kibana.yml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install filebeat & metricbeat | |
| wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
| apt-get install apt-transport-https | |
| echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
| apt-get update | |
| apt-get install filebeat metricbeat | |
| # Configure filebeat | |
| cat >/etc/filebeat/filebeat.yml <<EOL | |
| filebeat.prospectors: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Install elasticsearch | |
| wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | apt-key add - | |
| apt-get install apt-transport-https | |
| echo "deb https://artifacts.elastic.co/packages/5.x/apt stable main" | sudo tee -a /etc/apt/sources.list.d/elastic-5.x.list | |
| apt-get update | |
| apt-get install elasticsearch | |
| # Configure memory settings | |
| mkdir -p /etc/systemd/system/elasticsearch.service.d | |
| echo -e "[Service]\nLimitMEMLOCK=infinity" > /etc/systemd/system/elasticsearch.service.d/elasticsearch.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!bin/python | |
| from elasticsearch import Elasticsearch | |
| from datetime import datetime | |
| import time | |
| es = Elasticsearch() | |
| indices_state = es.cluster.state()['metadata']['indices'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pandas | |
| from sklearn import linear_model, svm, tree, naive_bayes | |
| from sklearn.model_selection import cross_val_score | |
| import numpy as np | |
| data = pandas.read_csv('train.csv') | |
| def preprocess(data): | |
| data['Fare'] = data['Fare'].fillna(data['Fare'].mean()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @echo off | |
| Setlocal EnableDelayedExpansion | |
| for /L %%n in (1,0,5) do ( | |
| SET /A N1=!RANDOM! * 255 / 32768 | |
| SET /A N2=!RANDOM! * 255 / 32768 | |
| SET /A N3=!RANDOM! * 255 / 32768 | |
| SET /A N4=!RANDOM! * 255 / 32768 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| filebeat.prospectors: | |
| - input_type: log | |
| paths: | |
| - ./random_apache_log | |
| output.elasticsearch: | |
| hosts: ["127.0.0.1:9200"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| while true | |
| do | |
| random_ip=$(dd if=/dev/urandom bs=4 count=1 2>/dev/null | od -An -tu1 | sed -e 's/^ *//' -e 's/ */./g') | |
| random_size=$(( (RANDOM % 65535) + 1 )) | |
| current_date_time=$(date '+%d/%b/%Y:%H:%M:%S %z') | |
| echo "$random_ip - - [$current_date_time] \"GET /data.php HTTP/1.1\" 200 $random_size" | tee -a 'random_log' |
NewerOlder