Install docker on centos7 and ElementaryOS loki and hera

From https://docs.docker.com/engine/install/

For Centos7

# yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
# yum install -y yum-utils
# yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo
# yum -y install docker-ce docker-ce-cli containerd.io
# systemctl start docker
# systemctl enable docker

For ElementaryOS Hera

# apt-get remove docker docker-engine docker.io containerd runc
# apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
# add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable”
# apt update
# apt-get install docker-ce docker-ce-cli containerd.io

For ElementaryOS loki

# apt-get remove docker docker-engine docker.io containerd runc
# apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
# curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add –
# add-apt-repository “deb [arch=amd64] https://download.docker.com/linux/ubuntu xenial stable”
# apt update
# apt-get install docker-ce docker-ce-cli containerd.io

show printjobs per printer

This script shows all printjobs classified by printer.
this is useful to see which jobs are stalled in misconfigured printers.

#!/bin/bash

lpstat -o > jobs.txt
echo “Total Jobs: $(wc -l jobs.txt)”
lpstat -a | awk ‘{ print $1 }’ | while read p;do
J=$(grep $p jobs.txt|wc -l)
if [ $J -gt 0 ];then
nj=$(grep $p jobs.txt | wc -l)
echo ” $p : ${nj} jobs ———————-”
lpstat -p $p | egrep -iv ‘reason’
fi
done

Mirror all redhat 7 repositories

First ,make sure you have a system that is registered, then run this script

#!/bin/bash
(
grep ‘\[‘ /etc/yum.repos.d/redhat.repo | sed ‘s/\[//g;s/\]//g’ | while read repo;do
reposync –gpgcheck -l –repoid=$repo –download_path=/swdepot/repos/ –downloadcomps –download-metadata
done
for d in $(ls /swdepot/repos);do
cd /swdepot/repos/$d
createrepo -v /swdepot/repos/$d
done
) >>/var/log/reposync.log 2>&1

setup CentOS7 as dns forwarding

yum install bind
vi /etc/named.conf
found
———–
zone “.” IN {
type hint;
file “named.ca”;
};
———–
replace with
———–
zone “.” IN {
type forward;
forward only;
forwarders { 8.8.8.8; 8.8.4.4; };
};
———–
service named start

also change the ip address to the server’s ip address, and make sure to set the allow-query settings properly

options {
listen-on port 53 { 192.168.5.100; };
allow-query { localhost;any; };