Change default shell on nitrous.io box? - nitrousio

On a nitrous.io drogo box, how do I change the default shell to zsh when I ssh in? I do not have write access to /etc/passwd, and I cannot sudo.

You can't use zsh in the main console, but you could with tmux (which is already installed). You will just need to add this line into ~/.tmux.conf :
set-option -g default-shell /bin/zsh

Related

How to set input from bash script in an interactive shell?

So when I install percona mysql, I get the following.
I am trying to automate sql installation using a bash script but how do I enter into the input using bash script? Enter something > hit enter.
The preferred way of achieving this is using unattended mode by setting the following environment variable before calling apt install:
export DEBIAN_FRONTEND=noninteractive
This will not prompt the user for any input but instead use the default values for everything.
If you want to supply an answer to a configuration question different to the default value, use preseeding DebConf.

unable to use javapackager command

I am using ubuntu 16.04, and my java is in /usr/bin/java
and jdk is in /usr/lib/jvm/java-8-openjdk-amd64 . non of these had the javapackager inside.
I am not able to use javapackager command and do not know how to configure it to use in command-line.
Can anyone help me?
Thanks.
It seems javapackager comes with a package called openjfx,
so running apt install openjfx should make the tool available for you, among your other java tools.
$ apt-file search javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/bin/javapackager
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/ja_JP.UTF-8/man1/javapackager.1.gz
openjfx: /usr/lib/jvm/java-8-openjdk-amd64/man/man1/javapackager.1.gz
You should define your java path.
You can set your JAVA_HOME in /etc/profile as Petronilla Escarabajo suggests. But the preferred location for JAVA_HOME or any system variable is /etc/environment.
Open /etc/environment in any text editor like nano or gedit and add the following
JAVA_HOME="/usr/lib/jvm/open-jdk" (java path could be different)
Use source to load the variables, by running this command:
source /etc/environment
Then check the variable, by running this command:
echo $JAVA_HOME

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.

Openshift asks to change permission of file to 600 on Windows

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!!!

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.