Executing a Script from Linux to a Mac - linux

Is it possible to execute a script from a linux machine to run on a Mac, using either Python or Bash? I have a raspberry pi with an arduino, when a sensor or an even occurs from the arduino i want to run a script to do something, "ie: run a "say" command" on my mac, any way of doing this? and how would it be done? i would not like to connect the arduino to the mac, since location is an issue, so it has to be done from the raspberrypi

ssh. if your mac runs sshd.
you can
rasbery> ssh $account#$mac_IP $command

Related

Can't ssh in Raspberry PI from Manjaro

I'm able to ssh into pi from MacOS using ssh pi#raspberrypi.local or ssh pi#ip_address. I have been doing this for a long period of time. Now I installed Manjaro Linux along with the MacOS but I can't ssh in pi from Manjaro. ssh pi#raspberrypi.local returns name not found error while the other command times out. Works as expected when I switch back to MacOS. I've been stuck on this for a while now, I've tried multiple solutions but nothing seem to work. I have also tried re-installing and starting sshd but no luck.
You should check the information of /var/log/message on Raspberry PI, where the problem has been checked
The problem was in the Network adapter driver. If you are facing this problem check which driver are you using. If it is anything other than the Broadcom driver delete it and install the Broadcom driver and should work fine.

SSH into raspberry pi

I have a question regarding SSH. For school assignments, I always write code on my mac then transfer it over on my raspberry pi to make sure it will compile correctly without errors as they are tested on the pi and sometimes when I transfer it has errors.
To avoid hassle of connecting everything to the pi, if I SSH into the pi, then compile my program from my mac, would it use the raspberry pi compiler?
If you are connected vi ssh and issuing the commands in that terminal session, yes, it's going to use the compiler on the pi.
A better option, and more educational, might be to cross-compile the code for the pi on your mac. You can leverage the much greater processing power of the desktop to significantly reduce your compile time.
Cross Compiling on Mac OSX for Raspberry Pi
Yes it would remotely access the host's OS (in your case the RPi) to perform the compilation.
Here is a guide to get you started:
https://www.modmypi.com/blog/remotely-accessing-the-raspberry-pi-via-ssh-console-mode
Also, in case you want a remote desktop connection, on your raspberry pi enter the following command:
sudo apt-get install xrdp
providing you've already updated and upgraded your package libraries ;)
Yes, If you are using ssh and writing code in that terminal session then the code will be compiled in the pi, it is the best way to do so.
Issuing command in the terminal session via SSH (laptop connected with Raspi), compilation will be done at Raspi. PuTTY is a very useful tool for this, you just need to enable SSH at Raspi and input your IP address at PuTTY only! Click to the PuTTY website http://www.putty.org/ and download it.
Secure Shell (SSH) is a cryptographic network protocol for operating network services securely over an unsecured network. The best-known example application is for remote login to computer systems by users.
When you connect to any remote system or server via ssh you are using the same system via command prompt. So, if you do any work via SSH the compilation will be done by the remote system.

Can't launch Visual Studio Code on Ubuntu

I'm running a VM in Azure with Ubuntu 14.04. I've installed XFCE and use X2GO to remote desktop to the machine.
I've downloaded the VS Code and unzipped the files. When I run Code from a terminal I get the following error:
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ ./Code
bash: cannot set terminal process group (-1): Inappropriate ioctl for device
bash: no job control in this shell
WouterDeKort#UbuntuDev:~/tools/web/visual-studio-code$ [ , [Error: channel closed] ]
Any idea what I'm doing wrong?
DISCLAIMER ;-) I'm a total Linux newby. I've just installed Linux for the first time today and I have no idea what I'm doing ;-)
The work-a-round is in issue 3451. After running this, I was able to launch it from Debian Jessie with LXDE over X2Go.
sudo sed -i 's/BIG-REQUESTS/_IG-REQUESTS/' /usr/lib/x86_64-linux-gnu/libxcb.so.1
I have the same problem using X2GO and LXDE. Works okay (but slowly) using MobaXterm so apparently this is a problem specific to X2GO.
For anyone who still wonder what is the best choice if you want to start Visual Studio Code on a headless Ubuntu - the winning combination is:
Ubuntu Server + xfce + nomachine remote desktop
VS Code starts immediately without any hacks, you can set your resolution however you like, and nomachine is blazingly fast.

Start the selenium server when Linux boots

I am having a linux machine dedicated to run the selenium tests. Now if i restart the linux, i want selenium to start automatically. That is, there is should not be a need to start the selenium manually.
So on linux bootup, "I need to open a terminal, and run the command, java -jar selenium-standaloe-xxx.jar"
How can i do so?
My browser will open in the same box. and i am calling my script remotely from putty terminal.
Put your command into
/etc/rc.local
and reboot, it could be done.

SSH connection with NAnt script

Is there a way to make an ssh connection from a windows command line to a Linux machine not using putty?
The Idea is to be able to use NAnt to issue linux commands on the target Linux machine.
Yes. The Cygwin ssh client works from the Windows command line.
If you're looking to avoid any 3rd party tool besides nant, then no.

Resources