Openshift asks to change permission of file to 600 on Windows - openshift

while executing rhc setup i got following error
Your private SSH key file should be set as readable only to yourself. Please run CHMOD 600 C:/user/myuser/.ssh/id_rsa
Now how can i execute such command on windows.
However, I tried to use git bash. But have not got any success.!!

You can execute Linux commands on windows machine using Cygwin.
There are a couple of more tools using which you can do the same but I found Cygwin great!!!

Related

can't run geth command on windows10

I install GETH on Windows10 but when I execute the command
geth version
it will get an error "geth' is not recognized as an internal or external command,
operable program or batch file."
Sounds like something to do with your environmental variables and dependencies.
Firstly ensure that you have installed all dependencies correctly. Follow the installation steps here
https://github.com/ethereum/go-ethereum/wiki/Installation-instructions-for-Windows
This will ensure that all env paths are set correctly and that geth will be configured into your system variables.
Hope this helps! feel free to message me if you have anymore trouble

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`

Upgrade tmux version

I am using OpenShift scallable gear with Django installed and I need to log everything from running tmux session to a file. On my local machine I am just using tmux-logging plugin but it need tmux version >1.9.
But 1.6 is installed on server(Why so old?).
It is possible to upgrade package version in gear without sudo/root privileges?
Or how I can log to a file with tmux 1.6 with same convenience as with tmux-logging plugin? Thanks.
You can use e.g. this script to install tmux without root privileges. Replace the $HOME with $OPENSHIFT_DATA_DIR before running it (you can't write directly to ~ on OpenShift + you want your tmux to be persistent) and adjust the $TMUX_VERSION (worked for me with $TMUX_VERSION=1.9).
Running the script will then install tmux into ~/app-root/data/local/.
Using
sh <(wget -qO- s.minos.io/s) -x tmux-2.0
You can fetch the static binary with static-get and no compiler required then, so no root privileges requeired.
Fiala´s solution looks good but it not worked for me and this is even simpler.

How do I tell the Compute Engine gcutil-tool the location of a file when doing a push/pull?

gcutil does not understand when I use "d:/documents and settings/paul/desktop/somefile.txt"
I am using Cygwin terminal with Windows Xp.
Cygwin uses Unix-style paths, which do not have explicit drive letters.
Try /cygdrive/d/Documents and Settings/...
With my Windows XP is so that D:\cygwin\home\exampleusername\examplefile.txt can be referenced as ~/examplefile.txt from the cygwin command line.
And I can get files from the Linux instance when I am at my local command prompt: I can "gutil ... pull ..." files from the instance and "gcutil ... push ..." files to instance.
Push or pull at the Linux instance command prompt does not work, I think this is a issue with my local firewall.

Unable to run gcutil from command line

When I try to install gcutil by following steps on https://developers.google.com/compute/docs/gcutil/
here is the bin dir contents of C:\gcutil\google-cloud-sdk\bin :
but gcutil does not seem to install correctly. When I attempt to run gcutil I receive the error :
C:\gcutil\google-cloud-sdk\bin>gcutil
'gcutil' is not recognized as an internal or external command,
operable program or batch file.
Should gcutil not be a .bat file command ? How can I invoke gcutil ?
You do not need to install cygwin unless you need the ssh functionality of gcutil.
The reason you could not initially run gcutil is because it was a python script (and you were not prefixing the command with 'python'). We have since changed this to be a .cmd script, so it should work more natively in windows. If you add the bin directory to your PATH, you should be able to run gcutil from anywhere.
Download and install Cygwin. Install the 32-bit version.
Start Cygwin. and download the SDK
$ curl https://dl.google.com/dl/cloudsdk/release/install_google_cloud_sdk.bash | bash
Restart Cygwin (or cmd).
Authenticate.
$ gcloud auth login
Reset PATH from console.
setx PATH "%PATH%;C:\full\path\to\google-cloud-sdk\bin"
Or you can use environment variables.
About variables
Installing cygwin to run gcutil if you are working with windows.
https://developers.google.com/compute/docs/gcutil/ (check the windows tab)
I just do it and work fine.