Gist to support https://www.youtube.com/watch?v=KsTMy0920go
https://github.com/darinpope/java-web-app
use the sonar
branch
Questions are not from any actual exam!!! | |
Q: Create a job that calculates pi to 2000 decimal points using the container with the image named perl | |
and the following commands issued to the container: ["perl", "-Mbignum=bpi", "-wle", "print bpi(2000)"] | |
Once the job has completed, check the logs to and export the result to pi-result.txt. | |
Solution: |
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" |
Out of Memory (OOM) refers to a computing state where all available memory, including swap space, has been allocated. | |
Normally this will cause the system to panic and stop functioning as expected. | |
There is a switch that controls OOM behavior in /proc/sys/vm/panic_on_oom. | |
When set to 1 the kernel will panic on OOM. | |
A setting of 0 instructs the kernel to call a function named oom_killer on an OOM. | |
Usually, oom_killer can kill rogue processes and the system will survive. | |
The easiest way to change this is to echo the new value to /proc/sys/vm/panic_on_oom. | |
# cat /proc/sys/vm/panic_on_oom 1 |
- name: "get files from dir" | |
find: | |
paths: "/some/dir/foo" | |
register: found_files | |
- name: print file names without path | |
debug: | |
msg: "{{ found_files['files'] | map(attribute='path') | map('regex_replace','^.*/(.*)$','\\1') | list }}" |
# Generate a new key | |
openssl genrsa -out server.key 2048 | |
# Generate a new CSR | |
openssl req -sha256 -new -key server.key -out server.csr | |
# Check certificate against CA | |
openssl verify -verbose -CApath ./CA/ -CAfile ./CA/cacert.pem cert.pem | |
# Self Signed |
# deploy under "path" context path | |
curl --upload-file appplication-0.1-1.war "http://tomcat:tomcat@localhost:8080/manager/deploy?path=/application-0.1-1 | |
# undeploy | |
curl "http://tomcat:tomcat@localhost:8080/manager/undeploy?path=/application-0.1-1" | |
# ! tomcat7 uses /manager/text/undeploy and /manager/text/deploy paths | |
# tomcat6-admin (debian) or tomcat6-admin-webapps (rhel) has to be installed | |
# tomcat-users.xml has to be setup with user that has admin, manager and manager-script roles |
# deploy under "path" context path | |
curl --upload-file appplication-0.1-1.war "http://tomcat:tomcat@localhost:8080/manager/deploy?path=/application-0.1-1 | |
# undeploy | |
curl "http://tomcat:tomcat@localhost:8080/manager/undeploy?path=/application-0.1-1" | |
# ! tomcat7 uses /manager/text/undeploy and /manager/text/deploy paths | |
# tomcat6-admin (debian) or tomcat6-admin-webapps (rhel) has to be installed | |
# tomcat-users.xml has to be setup with user that has admin, manager and manager-script roles |
trigger: | |
- master | |
jobs: | |
- job: BuildAndTest | |
workspace: | |
clean: all | |
pool: | |
name: Self-Hosted-Agent |
--- | |
- hosts: tomcatServer | |
vars: | |
- warName: ROOT.war | |
- warRemotePath: /home/tomcat | |
tasks: | |
- name: Download WAR to server | |
command: wget http://git-internal/release.war -O {{ warRemotePath }}/{{ warName }} | |
Gist to support https://www.youtube.com/watch?v=KsTMy0920go
https://github.com/darinpope/java-web-app
use the sonar
branch