Jan 17, 2019
· 2 minute read
linuxsalt
Salt states From the documentation,
The core of the Salt State system is the SLS, or SaLt State file. The SLS is a representation of the state in which a system should be in, and is set up to contain this data in a simple format. This is often called configuration management.
The default location for salt state files (sls) is defined per environment in master configuration, e.
Read On →
Jan 16, 2019
· 2 minute read
linux
Notes for some git commands outside of usual pull/add/commit/push.
Worth noting that we run our own public/private Git repositories using Gogs.
See also the Git documentation.
Get URL of my repo $ cd /repo/dir $ git config --get remote.origin.url ssh://user@server/whatdidilearn.today.git Create new branch Do some work in /repo/dir (e.g. deleted _config.yml) then create new branch.
$ git checkout -b hugo D _config.yml ... Switched to a new branch 'hugo' Change working branch $ git checkout hugo .
Read On →
Jan 15, 2019
· 3 minute read
linuxsalt
From the documentation:
Salt is a new approach to infrastructure management built on a dynamic communication bus. Salt can be used for data-driven orchestration, remote execution for any infrastructure, configuration management for any app stack, and much more.
Salt is primarily agent based, with each host (known as a minion) reporting back to a master server.
An agentless mode is also possible which relies on key based SSH, not all Salt commands are supported in this mode.
Read On →
Jan 14, 2019
· 2 minute read
linux
OK, you now have a bunch of containers running on one (or more) hosts, how to back them up?
Best (in my opinion) option is to use filesystem snapshot, available with LVM, ZFS and BTRS back end storage.
Please test with disposable container before relying on this technique for vital data.
In outline the process is:
Take snapshot of the container using lxc snapshot.
Publish the container as an image, lxc publish.
Read On →
Jan 11, 2019
· 1 minute read
linux
Short note #2
I had a lot of text files (Markdown as it happens) which all needed exactly the same edit.
It was a simple edit, go to line 4, join it with next line and remove a couple of characters.
Very tedious to do manually, enter ex.
$ find . -name \*.md -exec ex -s +5 -c - -c j -c "s/\" T08/T08/" -cx {} \; -print The find gathered up all the files with md extension and ran ex against each one, printing the filename as it went.
Read On →