Skip to main content

Posts

Showing posts from February, 2021

Command Line Fu - Using tar over SSH

A neat little snippet when migrating datasets between servers or creating archives to remote servers when disk space is limited. Here are some examples I've used extensively when migrating some RHEL7 Servers to RHEL8: Creating archive locally and push to remote server: [root@kvm ~]# tar -cvpJf - /srv/kvm/vm-images | ssh root@nas.archyslife.lan 'cat > /var/backup/vm-images.tar.xz' Create archive remotely and pull to local server: [root@nas ~]# ssh archy@kvm.archyslife.lan 'tar -cvpJf - /srv/kvm/vm-images' > /var/backup/vm-images.tar.xz Pull archive from remote server and extract locally: [archy@kvm ~]$ ssh archy@nas.archyslife.lan 'cat /var/backup/vm-images.tar.xz' | tar -xvJf - -C / Push archive from local server to  [archy@nas ~]$ cat /var/backup/vm-images.tar.xz | ssh archy@kvm.archyslife.lan 'tar -xvpJf - -C /' Feel free to comment and / or suggest a topic.

Docker - Notes for installing on a EL8 Host

I've just migrated 2 AWX Hosts from RHEL7 to RHEL8 and I was using the docker-compose method. This obviously requires docker-compose which can be installed using pip3 in RHEL8 but when using 'latest' as version, you'll encounter an error like 'Rust compiler not installed'. This error is caused by the latest version of the cryptography module in pip's repositories. I've found these versions to be usable with RHEL8: cffi==1.12.0 cryptography==3.3.1 docker-compose==1.28.0 These modules can be installed using pip: [archy@awx ~]# sudo pip3 install cffi==1.12.0 cryptography==3.3.1 docker-compose==1.28.0 A corresponding ansible snippet could look like this: - name: install docker-compose if os_major is 8 pip: name: "{{ item }}" state: present loop: - cffi==1.12.0 - cryptography==3.3.1 - docker-compose==1.28.0 when: ansible_facts['distribution_major_version'] == '8' tags:

Foreman - ERF12-6899 Unable to set DHCP entry

This error occurred for me after updating the dhcp-server if it's integrated into foreman using either the 'isc' or 'remote_isc' module. The fix was very simple since all I had to do was making sure the permissions are set accordingly and restart dhcpd. [archy@dhcpd ~]$ sudo chmod 755 /etc/dhcpd [archy@dhcpd ~]$ sudo systemctl restart dhcpd.service Foreman should now be able to assign addresses again. Feel free to comment and / or suggest a topic.

Command Line Fu - Tmux session sharing

With tmux you can easily share a session between mutliple users. This is very handy when debugging a problem for example or 'working with 4 eyes' on something. In order to do that, first launch tmux with specifying a socket (-S) and give the session a name: [root@server ~]# tmux -S /tmp/shared new -s shared_session In order to make it so that anyone else can connect, make sure the permissions are rw for both members: [root@server ~]# chmod 666 /tmp/shared As the second user, attach to tmux specifying the socket and the session name: [archy@server ~]$ tmux -S /tmp/shared attach -t shared_session The output and input are now shared between both users. Feel free to comment and / or suggest a topic.