See this issue.
Docker best practise to Control and configure Docker with systemd.
-
Create
daemon.jsonfile in/etc/docker:{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| #On a machine with a source file | |
| base64 < binary.file > text.file | |
| #On a machine-receiver: | |
| base64 -d < text.file > binary.file |
| 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: |
| apiVersion: v1 | |
| kind: ConfigMap | |
| metadata: | |
| name: nginx-conf | |
| data: | |
| nginx.conf: | | |
| user nginx; | |
| worker_processes 3; | |
| error_log /var/log/nginx/error.log; | |
| events { |
See this issue.
Docker best practise to Control and configure Docker with systemd.
Create daemon.json file in /etc/docker:
{"hosts": ["tcp://0.0.0.0:2375", "unix:///var/run/docker.sock"]}
| modules: | |
| https_2xx: | |
| prober: http | |
| timeout: 5s | |
| http: | |
| method: GET | |
| no_follow_redirects: false | |
| fail_if_ssl: false | |
| fail_if_not_ssl: true | |
| preferred_ip_protocol: "ipv4" |
| 1. Setup a project | |
| 2. Add groovy SDK support: | |
| https://www.bonusbits.com/wiki/HowTo:Add_Groovy_SDK_to_IntelliJ_IDEA | |
| 3. Download http://(yourjenkinsurl)/job/(yourpipelinejob)/pipeline-syntax/gdsl | |
| - this will give you the .gdsl file - download this to the src folder of your project. | |
| 4. Finally follow this step - right click on the src folder -> Mark directory as -> Sources Root |
| # problem: when presenting, I want to obscure | |
| # my prompt to act like it's at root of file system | |
| # and be very basic with no git info, etc. | |
| # solution: this theme lets you set a ENV to the path | |
| # of your presentation, which will help remove unneeded prompt | |
| # features while in that path | |
| # oh-my-zsh theme for presenting demos | |
| # based off the default rubbyrussell theme |
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
| 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); | |
| } | |
| } | |
| } |
| # best practice: linux | |
| nano ~/.pgpass | |
| *:5432:*:username:password | |
| chmod 0600 ~/.pgpass | |
| # best practice: windows | |
| edit %APPDATA%\postgresql\pgpass.conf | |
| *:5432:*:username:password | |
| # linux |