Red Hat CodeReady containers - unable to access github.com - openshift

I have installed and setup CodeReady containers on my mac, tried creating a project using the sample node js application, but the build is failing with this message in the logs.
Do we need to do any changes to CodeReady containers to access github.com ?
Cloning "https://github.com/sclorg/nodejs-ex.git" ...
error: fatal: unable to access 'https://github.com/sclorg/nodejs-ex.git/': Could not resolve host: github.com

I tried your command on crc. It worked for me.
No additional steps required.
$ oc new-app https://github.com/sclorg/nodejs-ex
--> Found image db4e490 (2 months old) in image stream "openshift/nodejs" under
...
...
Run 'oc status' to view your app.
I assume you can access the github.com from your laptop. :)
Let's see if you can resolve GitHub from crc virtual VM.
From your laptop.
$ host api.crc.testing
$ ssh -i ~/.crc/machines/crc/id_rsa core#192.168.130.11
Now check if you can resolve github
[root#crc-fdm75-master-0 ~]$ host github.com
github.com has address 13.234.210.38
github.com mail is handled by 1 aspmx.l.google.com.
github.com mail is handled by 10 alt3.aspmx.l.google.com.
github.com mail is handled by 10 alt4.aspmx.l.google.com.
github.com mail is handled by 5 alt1.aspmx.l.google.com.
github.com mail is handled by 5 alt2.aspmx.l.google.com.
If it is not working then your installation has a problem. Try to do a fresh setup again.
crc stop
crc clean-up
crc setup
crc start
Let us see how it goes.
BTW I use Fedora, not mac. I think the OS does not matter here.

Related

"mercurial-server: access denied" using ssh style URL

I'm trying to user mercurial-server on a Raspberry Pi (conveniently at my desk before I ask the sysadmins to install on Ubuntu server). The Pi is running Raspbian Buster (recent update/upgrade routine). The ultimate goal is a set of repos for students such that they can't peek at each others' code, but I can clone any student's work for grading.
I have a small Mercurial repo testproject in my home directory. My id_rsa.pub key is in ~hg/.ssh/authorized_keys after running the Mercurial server refresh-auth script. In the log files I can see that my public key exchange worked. Everything in /var/lib/mercurial-server/ seems to be owned hg:hg, and the permissions look reasonable. I'm running from localhost to localhost so it's the same version of hg that's running at both ends. I can sudo -u hg hg init louis/testproject in hg's home directory and it creates the repo no problem (I deleted it before retrying from ssh).
$ cd testproject
$ hg clone -v --debug . ssh://hg#localhost/louis/testproject
What I get is:
running ssh 'hg#localhost' 'hg init louis/testproject'
mercurial-server: access denied
abort: could not create remote repo!
I also tried from Windows 10 (x64) with TortoiseHG. It starts working then just stalls, needing the Task Manager to kill the TortoiseHG workbench. I stopped trying that to remove complexity.
I'm hoping the problem is not the Pi, but I suppose I can always get a DO droplet running Ubuntu.
As always, thanks in advance.
Oh never mind... The access.conf file was incorrect.

Minishift Error While Downloading OC Binary Version

I am trying to install minishift on Windows. However, I am facing with below Issue while installing It.I have tried with multiple version of Open Shift
Command Used : minishift.exe start --vm-driver virtualbox
Console Out Put :
-- Downloading OpenShift v3.9.0 checksums ... OKError starting the cluster: Error attempting to download and cache 'oc': Failed to validate hash - expected: 7ed04f7bc411056425d98aa6a10536fab15bdb569549446223f6ed22421ea4e6, actual: 705eb110587fdbd244fbb0f93146a643b24295cfe2410ff9fe67a0e880912663
Is their anyway to skip hash validation Check..?
There is currently no option to disable hash validation check. However there is a workaround for your issue, you can download the binary manually and put it into Minishift home - then Minishift on next start will not attempt to download it.
Download oc v3.9.0 release for Windows from its release page
Extract
Move oc.exe binary to .minishift/cache/oc/v3.9.0/windows/oc.exe
Start Minishift
Similar steps will also apply for other platforms and versions of oc. You can search for all releases by tag at Origin release page.
Reason of failure:
I have checked both Checksum on release and actual sha256sum of the binary and your sum is correct. Is it possible that the CHEKSUM file is cached on your proxy? What is the version of Minishift you are using?
If you are willing to invest some of your time, you can create an issue on Minishift so the team can take a deeper look into the problem.
you might receive a 403 forbidden status from GitHub if your request exceeds the rate limit for your IP address.Instead of waiting for GitHub to reset the limit for your IP address, you can create a Personal API Tokens from your personal GitHub account.
Personal API Token generation URL: https://github.com/blog/1509-personal-api-tokens
You need to set Token to environment variable.
For windows10: set MINISHIFT_GITHUB_API_TOKEN=<token_ID>
For Linux: export MINISHIFT_GITHUB_API_TOKEN=<token_ID>
Then run below command on windows CMD:
minishift.exe start --vm-driver virtualbox

Running Google Cloud SQL Proxy on Raspberry

I'm getting an error while trying to connect raspberry running ubuntu mate to my Google Cloud SQL instance.
These are the step I did to install:
git clone https://github.com/GoogleCloudPlatform/cloudsql-proxy
cd cloudsql-proxy/
sudo sh download_proxy.sh
My instance is configured this way (I deleted some characters in the image and in the code):
I didn't set the network because I'll be using proxy
Then I download into the same folder my JSON key.
wget https://drive.google.com/file/d/my_key.json
And the start the proxy
sudo ./cloud_sql_proxy -instances=be - 21:us-central1:be =tcp:3306 \
-credential_file=./my_key.json &
But I'm getting the error:
pi#pi:~/cloudsql-proxy$ ./cloud_sql_proxy: 1: ./cloud_sql_proxy:
Syntax error: ")" unexpected
I've tried removing the .json and I was getting the same error before without credential, I think that the problem is in the setup.
My dir ls is:
Any help is appreciated :)
download_proxy.sh downloads the proxy compiled for the amd64 architecture of CPU (aka x86_64). Your raspberry Pi has a ARM CPU, so this binary cannot run on your machine.
Google does not provide pre-build ARM versions of the proxy. I don't even know if it is able to build on ARM CPU. If it is possible, this is how you must do it:
Install go, e.g. with apt-get install golang
Setup a GOPATH, as per https://github.com/golang/go/wiki/GOPATH
Run go get github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy
Run the proxy with $GOPATH/cloud_sql_proxy -instances=...
Ok.
I'm sharing what I did to make it work, as David I don't know what version was I downloading.
I tried to avoid installing Go but it was the only way to get it installed.
sudo apt-get install golang-go
export GOPATH=$HOME/go
go get github.com/GoogleCloudPlatform/cloudsql-proxy/cmd/cloud_sql_proxy
cd $GOPATH/bin
wget your_key.json
sudo ./cloud_sql_proxy -instances=the_full_name_of_the_instance=tcp:3306 -credential_file=./your_key.json &
But I was getting a error because I already have mysql running localy in the same port
So now I'm using a unix soquet
sudo ./cloud_sql_proxy -instances=the_full_name_of_the_instance -credential_file=./your_key.json &
And then it's ready for connections :)
Thanks guys
I found issues with this when compiling SQL-proxy. I did, however, find the instructions here worked great on my raspberry pi 3. Have to make sure to remove all prior installations then reinstall it
wget https://storage.googleapis.com/golang/go1.9.linux-armv6l.tar.gz
sudo tar -C /usr/local -xzf go1.9.linux-armv6l.tar.gz
export PATH=$PATH:/usr/local/go/bin # put into ~/.profile`

Using socat to access X remotely

I have a remote server on which I want to launch some gui applications inside a network namespace I have already setup. I am using socat to forward the x session.
socat exec:'ssh {REMOTE_HOST} rm -rf /tmp/.X11-unix/X1; socat -d -d -d -d unix-l\:/tmp/.X11-unix/X1111 -' unix:/tmp/.X11-unix/X0
However, if I try to launch an application like eog
DISPLAY=:1111 eog
It fails with the following message:
I No protocol specified
** (eog:9498): WARNING **: Could not open X display
Cannot open display:
Run 'eog --help' to see a full list of available command line options.
And socat exits immediately afters.
Well, it took a day but I figured a way to do it.
I ended up using Xpra to start an X-server at the remote server and attached to it in my local machine.
The socat approach worked too after running xhost + locally and adding the fork flag in the socat invocation at the remote server . However, it never worked consistently (There was as much chance the application to hang during launch as not). And it never worked with more complex applications like firefox. Stracing the apps pointed towards the applications hanging when trying to use dbus.

Error when running 'embark run'

When run the command 'embark run'. I got the error message:
Running "deploy_contracts:development" (deploy_contracts) task
Warning: ==== can't connect to localhost:8101 check if an ethereum node is running Use --force to continue.
Error: ==== can't connect to localhost:8101 check if an ethereum node is running
Could you please give me some help about it?
Before you can run embark, you have to run an ethereum rpc simulator, simply run:
$ embark simulator
Or Alternatively, you can run a REAL ethereum node for development purposes:
$ embark blockchain
By default embark blockchain will mine a minimum amount of ether and will only mine when new transactions come in. This is quite usefull to keep a low CPU. The option can be configured at config/blockchain.yml
You will see a geth node starting in the terminal. Then, open another terminal and type:
$ embark run
This will automatically deploy the contracts, update their JS bindings and deploy your DApp to a local server at http://localhost:8000
Note that if you update your code it will automatically be re-deployed, contracts included. There is no need to restart embark, refreshing the page on the browser will do.
See also newest embark tagged questions on Ethereum Stack Exchange for future reference.
In your embark project directory:
run $ embark blockchain and leave this running on your terminal.
Open a new terminal, cd <yourProject> and run $ embark run
You will now be up and running on your local host at http://localhost:8000