Discover Docker, CoreOS and Xen Server with Maksym Prokopov

Insights, discussion, bugs and how-tos about Docker, CoreOS, orchestration and other interesting things.
Jan 23, 2021, 12:59

enable gitea to use ssh port 22

  1. Move original ssh service to other port, like 2022
  2. set gitea config to use port 22
    app.ini
[server]
DISABLE_SSH      = false
SSH_PORT         = 22
SSH_LISTEN_HOST  = 0.0.0.0
SSH_LISTEN_PORT  = 22
START_SSH_SERVER = true
  1. execute
sudo setcap CAP_NET_BIND_SERVICE=+eip /usr/local/bin/gitea to enable usage of the port 22

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
Ctrl + ↓ Earlier