Cheatsheet
Table of contents:
- Bash
- CEL
- DNS
- Fossil
- htmx
- htpasswd
- HTTP
- I18n
- Incus
- Java
- JSON
- jte
- Linux
- Maven
- Misc
- NPM
- Promontory
- Proxmox
- Regex
- SQLite
- SSH
- systemd
- Testing
- Wireguard
Bash
- Print env vars
printenv - https://google.github.io/styleguide/shellguide.html
- https://mywiki.wooledge.org/BashPitfalls
- https://ss64.com/bash/
- https://www.shellcheck.net/
CEL
DNS
Fossil
- Create new repo
fossil init repo.fossil --admin-user admin(see terminal output for password)- Create wiki page with same name as 'Project Name' specified in Admin > Configuration
- Changed files
fossil changes - Diff in browser
fossil diff --by --context 15 - Reference a ticket in commit message with
[123456] - Testing with self-signed certs
fossil set --global ssl-ca-location ca.crt - Untracked files
fossil extras --dotfiles - VSCodium extension
htmx
htpasswd
htpasswd -b -B .htpasswd user password(-cto create the file,-nreplaces-bto print to stdout)- https://httpd.apache.org/docs/current/programs/htpasswd.html
HTTP
i18n
Incus
- CLI
- Use
--debugto see API calls (--verbose)
- Use
- Images
- Login as user
incus exec my-instance -- su --login ubuntu
Java
- Debug security/certificates
-Djava.security.debug=all - JVM Options
- List all system properties
java -XshowSettings:properties -version
JSON
jte
Linux®
- APT versions
apt policy wireguard(apt-cache madison wireguard) - File system
df --human-readable(/opt) - Find process
pgrep --list-full java - First 75 lines
cat -n <( head -75 step_queue.json ) - Group list
getent group - List ACL
getfacl -R . - Network
ip address show - OS/distro
/etc/os-release - User in group
getent group | grep user - User list
getent passwd - https://man7.org/linux/man-pages/index.html
Maven
- Condition-Based Profile Activation
- Display effective POM
mvn help:effective-pom -Dverbose - Inspect project lifecycle
mvn buildplan:list - Lifecycle
- List dependencies
mvn dependency:tree -Dverbose - Testing with self-signed certs, in
.mvn/jvm.configset-Dmaven.resolver.transport=wagon -Dmaven.wagon.http.ssl.insecure=true - Update dependencies
mvn versions:display-dependency-updates "-Dmaven.version.ignore=.*alpha.*,.*beta.*,.*-M.*,.*-proto.*" - Update plugins
mvn versions:display-plugin-updates -N "-Dmaven.version.ignore=.*alpha.*,.*beta.*,.*-M.*,.*-proto.*"
Misc
NPM
- List dependencies
npm list --all(--omit dev) - Set next prerelease version
npm version prerelease --workspaces - Testing with self-signed certs, in
.npmrcsetstrict-ssl=false - Update dependencies
npm outdated
Promontory
- Scripts
- ESLint fix
mvn exec:exec@es-lint-fix - esbuild watch
mvn exec:exec@es-build-watch
- ESLint fix
- Provisioning
- Components
- Development repo
/provisioningcontains provisioning modules with runbooks, etc.
- Operations repo
- Ops modules
- Deployer configs
- Development repo
- Install
- Requirements
- Sudo
sudo -i - Unzip
apt-get install --quiet --yes unzip
- Sudo
- Move
installer.zipto/var/tmp - Unpack and prepare
cd /var/tmp && unzip -qq installer.zip -d installer && cd installer && chmod +x install.sh - Install
./install.sh path/to/my_runbook
- Requirements
- Components
Proxmox
Regex
SQLite
SSH
- Create user just for ssh login
adduser --comment "user" --disabled-password --quiet user - Unlock user
usermod --password '*' user
systemd
- Follow unit log
journalctl --follow --unit myunit(or-fu) - Show unit log
journalctl --no-pager --lines 100 --unit myunit - Show unit with drop-ins
systemctl cat myunit - https://www.freedesktop.org/software/systemd/man/latest/systemd.html
Testing
- Surefire/Failsafe Maven plugin config
- Default values are defined in parent POMs
- Opt into parallel execution of tests using
@Execution(ExecutionMode.CONCURRENT)
Wireguard
Linux® is the registered trademark of Linus Torvalds in the U.S. and other countries.