Kudu Debug console Bash vs SSH - azure

In Azure when using a Application Service on Linux (Node) there is a menu on top of Kudu: Debug console.
"Debug console" has to choices: Bash and SSH.
What is the difference between them?
It looks like they follow to different environments.

Bash is a popular text-based shell and command-language. It is the default shell included within Ubuntu and other Linux distros, and in macOS. Users type commands into a shell to execute scripts and/or run commands and tools to accomplish many tasks.
You can use bash scripts for your deployment. Note that on Linux, bash scripts must have Unix-style (LF) line endings.
You can check the Git example for your reference.
If you use the Bash console in Advanced Tools (Kudu) to look at environment variables, you won't see environment variables that you set using App Settings. That's because the Bash console runs in a separate context from your Web App. In order to see your environment variables, use SSH to access your container.
Secure Shell (SSH) is commonly used to execute administrative commands remotely from a command-line terminal. App Service on Linux provides SSH support into the app container with each of the built-in Docker images used for the Runtime Stack of new web apps.
Whether you're a Windows user, a macOS user, or a Linux user, you can easily SSH into your Web App by accessing Kudu -> Debug Console -> SSH
You may want to check the documentations Web Apps and SSH and Things You Should Know: Web Apps and Linux for more details.
Hope this helps.

Related

i am trying to use local power shell as cloud power shell (azure power shell vs local power shell )

i am new
I am trying to use local pc power shell to execute commands like on azure portal power shell.
enter image description here
in my local power shell
i can login to azure using az login.
az commands are running but i am trying to execute pg_dump --help but it say cannot recognize this command. but az commands are working fine.
enter image description here
on azure power shell cli
i can execute all the pg_dumb commands without issue.
please answer.
I think you need to install Azure CLI in order to use the same commands on local powershell:
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli
you need to have also pg_dump and pg_restore command-line utilities installed.
pg_dump is not part of the Azure CLI but is a PostgreSQL client application.
Cloud Shell happens to have a lot of packages installed already (i.E. terraform) and apparently pg_dump.
If you want to use it locally on your client you might want to look at installing the corresponding client tools. Maybe this SO thread helps (if you are running Windows): How do I install just the client tools for PostgreSQL on Windows?

How to remotely control Trace32 via Terminal

I have an automated Linux agent (CentOS) with Bamboo to aid in building and deployment of new software onto a board. I want to be able to run .cmm files via Trace32 and a Lauterbach onto my locally located board using the remote Bamboo agent to trigger daily builds and deployment.
I am aware of the terminal command option: ./trace32 -s file.cmm to avoid using the GUI.
Is there anyway I can use this kind of thing for remote deployment, perhaps utilising ssh?
There is no SSH server in TRACE32. However you can control TRACE32 remotely via the TRACE32 remote API. See the document "api_remote.pdf" in the PDF folder of your TRACE32 installation.
To launch some scripts or execute some simple commands from a bash shell, you can use the command line tool t32rem from the <t32>/bin/linux folder.
This tool uses the TRACE32 remote API to send TRACE32 commands to open TRACE32 GUIs.
Do the following:
Enable the TRACE32 remote API to add the following two lines to your TRACE32 configuration file (usually "config.t32")RCL=NETASSIST
PORT=20000 You have to ensure that there is an empty line before and after these lines in your configuration file.
Launch TRACE32 and send a command to it with t32rem like that: t32rem localhost port=20000 <command> For <command> you can choose any TRACE32 command like DO file.cmm to execute your mentioned PRACTICE script.
For more complex remote control of TRACE32 (e.g. from a Python script) you should have a look at the previously mentioned "api_remote.pdf" and the examples at <t32>/demo/api.
When you already have a command to run, how about using a Script task in your plan, so that you can execute the command you wanted?

Running a terminal command permanently

I am currently hosting my database for free on Openshift and have my program running on a linux box on my local server. I need to pass the data from the program to my openshift database. I want to run the linux box headless.
To do this I run the command:
rhc port-forward -a webapp
My question is how can I run this command permanently without it timing out (some checking to see if process is running?) and without a terminal running (background process)?
You could add that command in the startup settings of your Linux computer. So a systemd configuation, or an init one (details could depend upon your particular distribution and system). See systemd(1) and/or sysvinit
You could also use crontab(5). It can be used for periodic tasks, but also for started once tasks, thru some #reboot entry.
At last, you might use batch facilities, look into at (& batch)
Perhaps you may just want nohup(1) (or screen(1)...)

Remote development - Edit on Windows & Build on Linux

I am looking for a solution for a remote development environment as follows:
Editor - Windows Source Insight / Visual Studio
Source control - Clearcase
Build server - Linux
The above can't be modified.
In my current setup, I can view and edit the sources on Windows using a Windows Cleacase client.
My problem is mainly the build (and the later on, the debug) process.
I need to invoke 'make' from Windows on a specific Clearcase view on the Linux Server.
I can login in a separate process using SSH to the Linux server and run 'make', but it is a cumbersome procedure.
I am also unable to view the 'make' results and double-lick them to go to the specific warning/errors.
Is there any way to remotely bind a Windows command/batch to a Linux environment?
Perhaps through SSH?
Thank you for any suggestion you might have.
The usual solution is rather a pull strategy (where your build server fetches information on Linux, rather than trying to pilot everything from Windows.
If you follow the SSH path, be aware of technote swg21351507:
Linux SSH connection hangs when attempting to exit after starting ClearCase.
This can affect the use of scripts to start/stop ClearCase remotely using SSH.
Cause
This is a due to a OpenSSH server design, which will not close the console until all process/jobs executed by the user are completed.
Refer to this SSH FAQ for further details, regarding background jobs.
Resolving the problem
Redirect the ClearCase start script to either /dev/null or to a log file.
Example:
/usr/atria/etc/clearcase start < /dev/null >& /dev/null
/usr/atria/etc/clearcase start < /tmp/ccstart >& /tmp/ccstart
Try sshfs. I don't if there is a sshfs client for windows. If not, you can try NFS, or even SAMBA. Those definately work in Windows and Linux.
I just came across this and wanted to answer, even if the original poster has surely resolved their issue. This could be quite easily resolved by installing a jenkins instance on the build machine. You could kick off the build from the web interface and have it pull the files from clearcase and tell you the results.

When SSHing into system, is there a way to launch netbeans from command-line like I do VIM?

VIM seems integrated to the terminal. Can I open a remote file from the command-line with netbeans? Does it have shell integration? Any further explanation on this so I can better conceptually understand it would be very appreciated.
Few options:
Using ssh -X to forward X. Then you
can start netbeans remotely.
Use sshfs so you mount the
remote filesystem locally over ssh.
You can use then local copy of
netbeans to work on remote files.
Using rsync to have a local copy
The best one - use version control
Yes, you can, providing certain conditions are met!
Using ssh, you can tunnel the display of X-Window applications, meaning you can run the application (the X-Client) on one machine, and have it display on another (the X-Server).
You'll need to launch ssh with the -X option (or -Y, but preferably -X) to allow tunnelling, and then run NetBeans from the commandline as usual:
netbeans MyFile.java
Read about X-forwarding. The link points to a very verbose and detailed howto/tutorial.

Resources