Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I need to programmatically execute long running script on a remote server. I tried to use ssh with screen or tmux and so far I could not make it work.
With tmux I managed to make it work when typing the ssh command from my local machine terminal:
ssh <server_name> -t -t tmux new -s my_session \; set-buffer "bash my_script.sh" \; paste-buffer \; send-keys C-m \; detach
But if I run this programmatically I get this error:
open terminal failed: missing or unsuitable terminal: unknown
Connection to <server_name> closed
Use the -d flag to new-session to start tmux detached. So:
ssh <server_name> tmux new -ds my_session \; send-keys "bash my_script.sh" C-m
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
I'm attempting to start docker and postgresql automatically with my ubuntu wsl2 instance. I read about the /etc/wsl.conf configuration file and it only starts one service, not two. For example if I have:
[boot]
command = service docker start
and restart wsl.. I get the following:
mryan ~ $service docker status
* Docker is not running
mryan ~ $service postgresql status
12/main (port 5432): online
Again, if I remove the last line from etc/wsl.conf and restart wsl. Docker starts just fine. I've also tried quotes around the commands as in command="service docker start" but it didn't make a difference. Is there some format error I'm making here? Any help would be appreciated. I can get around this by manually starting services but it would be nice to make things work properly!
Try combining the commands into a single line maybe, with &&.
One still can start it on demand, eg. with .bashrc or .zshrc:
RUNNING=`ps aux | grep dockerd | grep -v grep`
if [ -z "$RUNNING" ]; then
sudo dockerd > /dev/null 2>&1 &
disown
fi
This may require group docker:
sudo usermod -a -G docker $USER
This question already has answers here:
How to open Windows Terminal with 4 panes?
(4 answers)
Closed 1 year ago.
A number of questions are related to using SSH with Windows terminal and a few others are related to opening multiple, equal sized panels side-by-side. None of these questions actually offers an answer to achieve the desired result (see title).
Some outdated answers say it's not possible, but after a recent update it now should be.
This answer explains how to open multiple equal-sized panes side-by-side. However, it does not explain how to execute a command within those newly opened panes.
Based on the answer by tkit on this question,, which explains how to open multiple panels side-by-side. We can include a SSH command as follows:
wt -M ssh user#ip.address -p 10077; split-pane -V ssh user#ip.address; move-focus left; split-pane -H ssh user#ip.address; move-focus right; split-pane -H ssh user#ip.address
This gives the following result:
Explanation of the command:
wt opens a Windows Terminal. After this flags can be used such as -M to maximize the window. Following this follows the command, ssh commands in this case. Flags can follow the given command, here -p for port number on the ssh command. The ; splits commands given to wt. split-pane results in a -V vertical panel split. move-focus changes the currently focused. Without move-focus we would end up with panels at size 50%, 25%, 12.5% and 12.%
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I want to uninstall Odoo 9 and reinstall in my linux system. Can anyone please help me?
Just follow these steps
service odoo-server stop
Remove config file(s)
rm -f /etc/odoo-server.conf
rm -f /etc/odoo.conf
Remove application code
rm -R /opt/odoo
Remove startup process
update-rc.d -f odoo-server remove
rm -f /etc/init.d/odoo-server
Remove logs
rm -R /var/log/odoo
Remove databases
sudo service postgresql stop
apt-get remove postgresql -y
apt-get --purge remove postgresql\* -y
rm -r -f /etc/postgresql/
rm -r -f /etc/postgresql-common/
rm -r -f /var/lib/postgresql/
Delete users and groups
userdel -r postgres
groupdel postgres
To Remove postgre
find the file pg_hba.conf - it may be located, for example in /etc/postgresql-9.1/pg_hba.conf.
cd /etc/postgresql-9.1/
Back it up
cp pg_hba.conf pg_hba.conf-backup
place the following line (as either the first uncommented line, or as the only one):
local all all trust
restart your PostgreSQL server (e.g., on Linux:)
sudo /etc/init.d/postgresql restart
you can now connect as any user. Connect as the superuser postgres (note, the superuser name may be different in your installation. In some systems it is called pgsql, for example.)
psql -U postgres
Reset password
ALTER USER my_user_name with password 'my_secure_password';
Restore the old pg_hba.conf as it is very dangerous to keep around
cp pg_hba.conf-backup pg_hba.conf
restart the server, in order to run with the safe pg_hba.conf
sudo /etc/init.d/postgresql restart
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
Have work on CentOS release 6.3 (Final) system. And try to ssh another machine using sshpass utility like
sshpass -p 'password' ssh user#host
But it give me error like
sshpass: Failed to run command: No such file or directory
So from error i think that sshpass may be not install so have try to install it by yum install sshpass and get following log
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
* base: mirror.leapswitch.com
* epel: epel.mirror.net.in
* extras: mirror.leapswitch.com
* nux-libreoffice.org-rpms: mirror.li.nux.ro
* updates: mirror.leapswitch.com
Setting up Install Process
Package sshpass-1.05-1.el6.i686 already installed and latest version
Nothing to do
from above it seems sshpass is already installed.So why it not working?
Check if your shell knows the locations of sshpass
which sshpass
If it doesnt give any output use find command to find the location of the executable:
find / -name sshpass
If you find the path, you can either use the full path of the executable:
/path/to/sshnpass
Or add the path to the PATH environmental variable, so that your shell can locate it:
export PATH=$PATH:/path/to/
Or the issue might be completely different. sshpass might not be able to find some other dependency. "ssh" client might not be installed. Or your syntax might be wrong:
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 4 years ago.
Improve this question
Preface: I'm writing a tmuxinator clone based for i3, and I'm a zsh user.
I want to open a xterm window (or any other terminal) in a given directory, where a .rvmrc file is present, and launch a (ruby-related) command.
Here an example scenario:
➜ /tmp irb
2.0.0p0 :001 >
➜ /tmp cat r/.rvmrc
rvm --create use 1.9.3#cloudflo-cfu
➜ /tmp cd r
Using /home/user/.rvm/gems/ruby-1.9.3-p392 with gemset cloudflo-cfu
➜ r irb
1.9.3p392 :001 >
As you can see I'm using 2.0.0 as system ruby, and 1.9.3 in the r/ direcotry.
I want, from some other place, launch an xterm window in that directory run irb and keep the terminal after that.
From a console I can do:
➜ /tmp (cd /tmp/r && xterm -e "irb ; $SHELL ")&
This will work but the rvm load is done from the current terminal, and this trick cannot be done from a script:
➜ /tmp cat test/start1.sh
(cd /tmp/r && xterm -e "irb ; $SHELL ")&
➜ /tmp ./test/start1.sh
This will open irb in the 2.0.0 version.
So, how do I achieve this?
More in detail, what I'm trying to do is to spot the correct command message for i3-msg utility (that I'm using via i3-py binding uwing i3.exec().
The result should do the following things:
Start a terminal (xterm preferably)
go to a given directory having rvm function loaded (or a workaround for the cd wrapper function of rvm)
launch a command (irb is fine for testing)
launch $SHELL to prevent the terminal to be closed once exiting from irb
this command should do it:
( cd /tmp/r ; xterm -e $SHELL -l -c "irb ; $SHELL" )&
it will change to the directory, start xterm with running login(-l) shell($SHELL) in it and asking it to execute(-c) irb