CentOS 8 stream - centos8

dnf --enablerepo=centos-openstack-wallaby -y upgrade
CentOS-8 - Ceph Nautilus 63 B/s | 38 B 00:00
Error: Failed to download metadata for repo 'centos-ceph-nautilus': Cannot prepare internal mirrorlist: No URLs in mirrorlist

If you need to update your CentOS 8 Stream, you need to change the mirrors to vault.centos.org
Step 1: Go to the /etc/yum.repos.d/ directory
# cd /etc/yum.repos.d/
Step 2: Run the below commands
# sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
# sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*
Now run your dnf command.

Related

Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib'

I am trying to get mssql working on my OSX machine. However, it keeps giving me error:
$ sqlcmd -S 0.0.0.0,1401 -U SA -P P#55w0rd -i database-setup/sql/initialize.sql
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/usr/local/lib/libmsodbcsql.17.dylib' : file not found.
Although, I am pretty sure, my file is in that location:
$ ls -la /usr/local/lib/libmsodbcsql.17.dylib
lrwxr-xr-x 1 localadmin admin 64 7 4 16:38 /usr/local/lib/libmsodbcsql.17.dylib -> /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib
$ ls -la /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib
-r--r--r-- 1 localadmin admin 2539360 7 4 15:34 /usr/local/Cellar/msodbcsql17/17.1.0.1/lib/libmsodbcsql.17.dylib
I know this question has been asked multiple times but none of the available solutions have worked for me.
Things I have tried:
https://github.com/Microsoft/homebrew-mssql-release/issues/7
https://github.com/Microsoft/homebrew-mssql-release/issues/3
I fixed my problem by:
$ brew uninstall msodbcsql17 mssql-tools
and then:
$ brew install msodbcsql17 mssql-tools
For me this solved it:
brew install microsoft/mssql-release/msodbcsql17

ERR_EMPTY_RESPONSE for localhost when running Docker

Here's my Dockerfile:
# CentOs base image
FROM centos:centos6.8
# install python, pip, apache and other packages
RUN yum -y update; yum clean all
RUN yum -y install epel-release; yum clean all
RUN yum -y install centos-release-scl; yum clean all
RUN yum -y install python27; yum clean all
RUN yum -y install python-devel.x86_64; yum clean all
RUN yum -y install python-pip; yum clean all
RUN yum -y install gcc; yum clean all
RUN yum -y install httpd httpd-devel mod_ssl; yum clean all
# Make a non root user so I can run mod_wsgi without root
# USER adm
# install Python modules needed by the Python app
COPY requirements.txt /usr/src/app/
RUN pip install --no-cache-dir -r /usr/src/app/requirements.txt
# copy files required for the app to run
COPY . /usr/src/app/
# tell the port number the container should expose
EXPOSE 80
# run the application
# CMD ["mod_wsgi", "start-server run_apache_server.wsgi"]
# CMD ["cat", "/etc/passwd"]
# CMD ["cat", "/etc/group"]
# CMD ["find", "/"]
CMD ["/bin/sh", "-c", "/usr/bin/mod_wsgi-express start-server run_apache_server.wsgi --user adm --group apache"]
I can run the app:
$ docker run -d -P --name myapp jacobirr/pleromatest
And see tcp port 80:
$ docker port myapp
80/tcp -> 0.0.0.0:32769
Here's my requirements.txt:
Flask==0.10.1
Flask-Restless==0.13.1
Flask-SQLAlchemy==0.16
Jinja2==2.7
MarkupSafe==0.18
SQLAlchemy==0.8.2
Werkzeug==0.9.2
gunicorn==17.5
itsdangerous==0.22
mimerender==0.5.4
python-dateutil==2.1
python-mimeparse==0.1.4
requests==1.2.3
six==1.3.0
wsgiref==0.1.2
setuptools==5.4.2
mod_wsgi==4.5.15
Why can't I get to localhost:32769 in the browser? I suspect this is related to:
•the user/group running apache?
•the fact that I'm installing mod_wsgi but it's nowhere on the docker "filesystem" so I have to use mod_wsgi-express?
Update:
'1' Netstat shows:
[root#9003b0d64916 app]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:irdmi *:* LISTEN
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node Path
unix 2 [ ACC ] STREAM LISTENING 113181 /tmp/mod_wsgi-localhost:8000:0/wsgi.1.0.1.sock
'2' httpd seems to be running in my container:
[root#9003b0d64916 mod_wsgi-localhost:8000:0]# ps aux | grep httpd
root 1 0.0 0.2 64060 5084 ? Ss 21:17 0:00 httpd (mod_wsgi-express) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -k start -DFOREGROUND
adm 6 0.0 0.6 350928 13936 ? Sl 21:17 0:00 (wsgi:localhost:8000:0) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -k start -DFOREGROUND
adm 7 0.0 0.1 64192 3248 ? S 21:17 0:00 httpd (mod_wsgi-express) -f /tmp/mod_wsgi-localhost:8000:0/httpd.conf -k start -DFOREGROUND
From all your outputs, your httpd / uwsgi process is definitely bound to 8000, and this is the port you need to expose on the container.
This line in netstat, is showing a bind on 8000, and nothing else.
tcp 0 0 *:irdmi *:* LISTEN
It is not obvious here, but if you use the --numeric-ports argument, it will not convert the 8000 into its known port.
In your docker file, again you should
EXPOSE 8000
When launching your container, you can also specify the port to use on the host machine:
docker run -p 8080:8000 --name ...
After this, you should be able to use your browser to hit
localhost:8080 -> container:8000
Add this to your Dockerfile, just before CMD:
WORKDIR /usr/src/app/
Assuming that your start-apache-server file is in that directory. This will help wsgi to find the needed file.

Docker alpine image's basic commands are not working

docker started to produce weird bugs when I was using a few simple alpine based containers. Two of these problems are:
rc-update was not found when i was trying to use it
after installing openssh package, there was nothing in /etc/ssh or there was no /etc/init.d/sshd to start/restart the service
To avoid confusion I checked out a widely used container that serves as a simple SSH server. You can do it by executing:
git clone https://github.com/chamunks/alpine-openssh.git
After this go into the alpine-openssh directory and build the container with:
docker build -t alpine-openssh .
Mine produces the following:
Sending build context to Docker daemon 125.4 kB
Step 1 : FROM alpine
---> 4e38e38c8ce0
Step 2 : MAINTAINER Chamunks <Chamunks#gmail.com>
---> Running in c21d3fa28903
---> f32322a2871a
Removing intermediate container c21d3fa28903
Step 3 : COPY sshd_config /etc/ssh/sshd_config
---> 392364fc35ce
Removing intermediate container 4176ae093cb8
Step 4 : ADD https://gist.githubusercontent.com/chamunks/38c807435ffed53583f0/raw/ec868d1b45e248eb517a134b84474133c3e7dc66/gistfile1.txt /data/.ssh/authorized_keys
Downloading [==================================================>] 864 B/864 B
---> c3899b675728
Removing intermediate container f83629b6fa9b
Step 5 : RUN apk add --update openssh && rc-update add sshd && rc-status && touch /run/openrc/softlevel && /etc/init.d/sshd start && /etc/init.d/sshd stop && adduser -D user -h /data/
---> Running in 1d1aad9d1678
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz
(1/3) Installing openssh-client (7.2_p2-r3)
(2/3) Installing openssh-sftp-server (7.2_p2-r3)
(3/3) Installing openssh (7.2_p2-r3)
Executing busybox-1.24.2-r9.trigger
OK: 8 MiB in 14 packages
/bin/sh: rc-update: not found
The command '/bin/sh -c apk add --update openssh && rc-update add sshd && rc-status && touch /run/openrc/softlevel && /etc/init.d/sshd start && /etc/init.d/sshd stop && adduser -D user -h /data/' returned a non-zero code: 127
Notice the /bin/sh: rc-update: not found part. This should work but it doesn't. I restarted my docker service, checked out docker's forums but no similar issue has been reported so far.
Any ideas why does it happen?
The rc-update tool is a part of the openrc package which is not included in the base image.
apk add openrc

Fedora after dd reinstall

I made a Fedora backup, then used Windows 7 for some time and tried to install Fedora back using dd command (under live cd), but now, it loads with black screen and says to look to journal: journalctl.
There are errors: fsck failed with error code 8; Failed to mount /sysroot and so on.
The commands I used:
sudo dd if=/dev/sda bs=1M conv=noerror | gzip > OS.gz
sudo dd if=OS.gz bs=1M conv=noerror | gunzip > /dev/sda
sudo partprobe /dev/sdaY
sudo tune2fs -U random /dev/sdaY
What do I need to do to reinstall Fedora using existing backup?

Running apache on docker with Dockerfile in windows boot2docker

I created the Dockerfile below and I tried to build the docker file but it's stop in Step 7 with below issue.
FROM fedora:20
RUN yum -y update; yum clean all
RUN yum -y install httpd; yum clean all
RUN mkdir -p /var/www/html
RUN mkdir -p /var/log/httpd
RUN mkdir -p /bin/httpd-run
# Create Apache test page
RUN echo "Apache set up successfully." > /var/www/html/index.html
# Copy apache run script
ADD httpd-run /bin/httpd-run
# Done
EXPOSE 80
CMD ["/bin/httpd-run"]
docker#boot2docker:~/c$ docker build --rm -t neroinc/frdora-apache .
Sending build context to Docker daemon 2.048 kB
Sending build context to Docker daemon
Step 0 : FROM fedora:20
---> 6cece30db4f9
Step 1 : RUN yum -y update; yum clean all
---> Using cache
---> 31c60bf0f22d
Step 2 : RUN yum -y install httpd; yum clean all
---> Using cache
---> 6efbe9b41918
Step 3 : RUN mkdir -p /var/www/html
---> Using cache
---> acd918c77d60
Step 4 : RUN mkdir -p /var/log/httpd
---> Using cache
---> a9e069fbfb24
Step 5 : RUN mkdir -p /bin/httpd-run
---> Running in 71735c1e8b7e
---> c6dab827ab33
Removing intermediate container 71735c1e8b7e
Step 6 : RUN echo "Apache set up successfully." > /var/www/html/index.html
---> Running in 8f6f38bdd492
---> c4f21e9f64b7
Removing intermediate container 8f6f38bdd492
Step 7 : ADD httpd-run /bin/httpd-run
INFO[0001] httpd-run: no such file or directory
docker#boot2docker:~/c$
If anyone can help me I'm new to write code. Here I want add any folder in boot2docker vm
I want write Dockerfile for Apache.