Discover Docker, CoreOS and Xen Server with Maksym Prokopov

Insights, discussion, bugs and how-tos about Docker, CoreOS, orchestration and other interesting things.

let's say you have true in the hundreds of files and you need to copy only those which contain this string, it is quite easy to do with Linux find utility

grep -l -ri -m1 "Active>true" */*.xml | xargs -I {} cp {} target_folder
find . -type f -name coverage.cov -exec bash -c 'cp {} $(pwd)/.coverage/cov/${RANDOM}.cov' \;
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.cognitect.datomic-console</string>
  <key>ProgramArguments</key>
  <array>
     <string>/Users/nexus/datomic-pro-1.0.6165/bin/console</string>
     <string>stock</string>
     <string>datomic:dev://localhost:4334/stock</string>
     <string>--port</string>
     <string>8080</string>
  </array>
	<key>WorkingDirectory</key>
	<string>/Users/nexus/datomic-pro-1.0.6165</string>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Label</key>
	<string>com.cognitect.datomic</string>
  <key>ProgramArguments</key>
  <array>
     <string>/Users/nexus/datomic-pro-1.0.6165/bin/transactor</string>
     <string>config/dev-transactor.properties</string>
  </array>
	<key>WorkingDirectory</key>
	<string>/Users/nexus/datomic-pro-1.0.6165</string>
</dict>
</plist>

just use sw_vers command

# sw_vers
ProductName:	Mac OS X
ProductVersion:	10.15.7
BuildVersion:	19H2
sudo xattr -r -d com.apple.quarantine /Library/Java/JavaVirtualMachines/graalvm-ce-java11-20.2.0/

There are several ways to do this:

  1. Use template action and use template file
  2. Use array of entries and loop with lininfile command
  3. Use https://docs.ansible.com/ansible/latest/collections/community/general/htpasswd_module.html htpasswd module.

I decided to go with approach #2.
in variables

htpasswd:
  - user1:password1
  - user2:password2

in the playbook

- name: set password file
      lineinfile:
        path: "{{ webroot }}/shared/.htpasswd"
        line: "{{ item }}"
        create: yes
      when: oxid.configuration == "production"
      loop: "{{ htpasswd }}"
yum upgrade jenkins --nogpgcheck

CentOS 7 fix for  UserWarning: Unknown distribution option: 'python_requires'

yum install -y python-pip python-devel gcc
pip install docker-compose
Jun 11, 2020, 10:08

Centos 7 docker install

yum install -y yum-utils
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install docker-ce.x86_64
systemctl start docker
systemctl enable docker

in case you do this under unprivileged used don't forget to add permission to the docker.sock

sudo groupadd docker
 sudo usermod -aG docker $USER
Ctrl + ↓ Earlier