This page is used to 'host' a personnal Knowledge Base with some short gists, cheatsheets and bookmarked-urls.
sql> select * from KB_cards
Show all tabs:
Show trailing whitespace:
Show trailing whitespace only after some text (ignores blank lines):
Show spaces before a tab:
The systemd daemon allows to manage custom services and run a script as a daemon service if it needs to be executed continuously (For instance: a REST API server). Create the unit file Create a unit file with the extension .service on the following path: /etc/systemd/system (For instance: /etc/systemd/system/my-custom-service.service) Once created, configure the unit file with the following sections: Unit, Service and Install. Unit section [Unit] Description="My custom service" After="network-online.target" The description of the custom...
Set the certificate private key password in a shell variable
Get a PFX file from original cert
openssl pkcs12 -export \
-in <<fqdn>>.crt \
-inkey <<fqdn>>.key \
-certfile ca-root.crt \
-name "rui" \
-passout pass:$INKEY \
Get PEM file from orginial cert
openssl pkcs12 \
-in <<fqdn>>.pfx \
-inkey <<fqdn>>.key \
-out <<fqdn>>.pem \
Replace lighttpd certificates
mv /opt/vmware/etc/lighttpd/server.pem /opt/vmware/etc/lighttpd/server.pem-bak
cp <<fqdn>>.pem /opt/vmware/etc/lighttpd/server.pem
service vami-lighttp restart
Export the SSL certificate(s) of a server to a .pem file:
openssl s_client -showcerts -connect $TARGET_HOST:$TARGET_PORT </dev/null 2>/dev/null|openssl x509 -outform PEM > $TARGET_HOST.pem
Simple restart of health broker service service vrhb-service on # ensure that service is activated service vrhb-service restart Reset health broker service data In case of non-working health management page (error message displayed or white/missing content), and after having tested the previous troubleshoot method it could be necessary to reset the data generated by the service. Warning: This action remove all existing content of the health broker service! service vrhb-service stop rm -r /var/lib/vrhb/service-host/sandbox rm...
The time required to fetch information on a third party deployment platform (like Azure virtual machine’s current and available public address) through vRealize Orchestrator can take too long and raise SocketTimeout errors. The process times out in vRealize Automation with this error message: “The connection to vCenter Orchestrator Server time out.”. To resolve this issue, connect on vRA appliances through SSH to run the following commands: # STOP vRA service service vcac-server stop sed -i.bak...
On some editor’s Linux based appliance(s), there is not telnet binary installed. To test TCP netwotk flows, it’s possible to use python’s socket module with a short script: #!/usr/bin/python import socket import sys if len(sys.argv) != 3: print("usage: telnet.py IPADDRESS PORT") exit(-1) print("Opening connection on %s port %s" % (sys.argv, sys.argv)) try: conn=socket.create_connection((sys.argv,sys.argv),timeout=30) except socket.timeout: print("Connection error: timeout") exit(-1) except: print("Connection error: unknown") exit(-1) print("Connection succeed") exit(0) Usage: $ python telnet.py usage: telnet.py IPADDRESS PORT...
If you want to periodically perform a task (e.g. sending Emails, backing up database, doing regular maintenance, etc.) at specified times and dates on a Linux or Unix system, you will probably need to use a Cron. The configuration file is quite simple but it is possible to have some doubt about the date/time order to use:
Here is a crontab-generator.
Get Linqpad and run the setup. Connect Once installed, you can connect LinqPad with your IaaS server: URL: https://iaas-manager.domain.tld/Repository/Data/ManagementModelEntities.svc Type: ODATA3 Credential: IaaS Service Account After validation, and a couple of minutes to load the database schema, you should see the list of tables: And on the right part of screen you can enter C# Expression (by default) requests. Requests Here are some requests samples: To get a subset list of VMs in the IaaS...
If you are familiar with the vRealize Automation installation process, you probably already know that it is possible to download some usefull files from the “installers” page. You can access to the “installers” with two URLs: https://vrava.domain/installers (most commun URL) or https://vrava.domain/i (the shortcut one). The “installers” page let you to download easly some files by clicking on the available links: But it also contains hidden files that you can also download from this path...