Interact with VirtualBox directly
# List Running VMs
VBoxManage list runningvms
# Save State
VBoxManage controlvm <name|uuid> savestate
# Power-off with possible data loss
Interact with VirtualBox directly
# List Running VMs
VBoxManage list runningvms
# Save State
VBoxManage controlvm <name|uuid> savestate
# Power-off with possible data loss
The following command creates a relatively strong (as of 2018) certificate for the domain example.com that is valid for 3650 days (~10 years). It saves the private key into
example.keyand certificate intoexample.crt.
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout example.key -out example.crt -subj "/CN=example.com" -days 3650
source: @vog https://stackoverflow.com/a/41366949/8207662 https://stackoverflow.com/questions/10175812/how-to-create-a-self-signed-certificate-with-openssl
| node('foo') { | |
| step('bar') { | |
| println 'if [foobar] is not avaible, continue' | |
| try { | |
| foobar('me') | |
| } catch (NoSuchMethodError _) { | |
| echo "foobar task available with foobar plugin." | |
| } | |
| } |
| --- | |
| - name: Adding elements to Arrays and Dictionaries | |
| hosts: localhost | |
| connection: local | |
| vars_files: | |
| - ./vars/common.yml | |
| tasks: |
suppose you have a file
'foo':
'1.12'
'bar':
'4.3'
and you want to end up with the following without manually updating each file
'foo': '1.12'
if your var has stdout_lines, prettier output is fairly easy
- debug: msg="{{foo.stdout_lines}}"
if your var doesn't, you can still have pretty output
- debug: msg="foo.stderr.split('\n')"
ref: ansible/ansible#6006
sometimes you need have three levels of quoting.
you are unable to do the following
- name: is the application running?
debug: msg="''{{lookup('pipe', 'ps aux | grep [f]oo.js -c')}}'' != '0'"
this is a lie, the example doesn't work but shows how double-single quotes can be used.
Problem: Horrible dev code requires secrets to be set via environment variables.
- name: show SECRETS environment variable
debug: msg="{{lookup('env','SECRETS')|default('foo')}}