-
http://lifuzu.com/blog/2016/03/21/feeding-build-logs-into-elasticsearch-with-logstash-on-jenkins/
-
Docker image for Jenkins: https://hub.docker.com/_/jenkins/
docker run -p 8080:8080 -p 50000:50000 jenkins
Check for Jenkins on http://localhost:8080
| apiVersion: apps/v1 | |
| kind: Deployment | |
| metadata: | |
| name: stress | |
| namespace: dev-common | |
| spec: | |
| replicas: 1 | |
| strategy: | |
| type: Recreate | |
| selector: |
| # best practice: linux | |
| nano ~/.pgpass | |
| *:5432:*:username:password | |
| chmod 0600 ~/.pgpass | |
| # best practice: windows | |
| edit %APPDATA%\postgresql\pgpass.conf | |
| *:5432:*:username:password | |
| # linux |
| from flask import Flask, g, jsonify | |
| import werkzeug, os | |
| from werkzeug.utils import secure_filename | |
| import psycopg2 | |
| from psycopg2 import pool | |
| def get_db(): | |
| print ('GETTING CONN') | |
| if 'db' not in g: |
| #!/usr/bin/env bash | |
| set -o errexit | |
| set -o pipefail | |
| set -o nounset | |
| # How to use this script | |
| # ./backup_rotate.sh "path_to_backups" ["path_to_log_file"] | |
| # | |
| # Examples: |
http://lifuzu.com/blog/2016/03/21/feeding-build-logs-into-elasticsearch-with-logstash-on-jenkins/
Docker image for Jenkins: https://hub.docker.com/_/jenkins/
docker run -p 8080:8080 -p 50000:50000 jenkins
Check for Jenkins on http://localhost:8080
| array = [1,2,3,4] | |
| diff = [] | |
| # найти среднеарифметическое | |
| result = float(sum(array)) / max(len(array), 1) | |
| print(result) | |
| i = 0 | |
| for number in array: | |
| min = number |
| http{ | |
| upstream back { | |
| server 127.0.0.1:8081 fail_timeout=0; | |
| } | |
| upstream map { | |
| server 172.18.100.35:8080 fail_timeout=3; | |
| server{ |
| public final class BusyApp { | |
| public static void main(String []args) throws Exception { | |
| final java.util.Random generator = new java.util.Random(); | |
| while (true) { | |
| generator.ints(1000000, 0, 100).sorted(); | |
| Thread.sleep(5000L); | |
| } | |
| } | |
| } |
| - name: RedHat - Ensure Java is installed | |
| become: yes | |
| shell: 'java -version' | |
| ignore_errors: yes | |
| register: java_version | |
| - name: print result | |
| shell: echo 'java is installed yet' | |
| when: java_version.stderr.find('OpenJDK Runtime Environment') > 1 |
| #On a machine with a source file | |
| base64 < binary.file > text.file | |
| #On a machine-receiver: | |
| base64 -d < text.file > binary.file |