Can not display dialog on remote computer using apple-script - networking

I can't display dialog over a network using apple-script. I can connect to the computer but can not display a dialog using apple-script. Could anyone suggest a script to make this work??????
Thanks
Tom

To display a dialog on a remote machine you have to first setup an AppleScript application that runs on that machine.
On the remote machine
on displayDialog(d)
tell application "AppleScript Runner"
display dialog d
end tell
end tell
Save the above script as an Application: name it DialogHelper and flag the Stay open checkbox when saving. You can save it on the Desktop or wherever you like. Then run the Application and let it stay open.
Then from the local machine you invoke that AppleScript application to display the dialog.
On the local machine
tell application "DialogHelper" of machine "eppc://toms-mac.local"
displayDialog("hello")
end tell
-
Note that "Remote Apple Events" must be enabled in the Sharing Preferences on the target (remote) machine to allow this to work.
Of course the name of the machine (toms-mac.local in the example) must match with the one you see when opening the same preferences.
I've just tried, and it works between two Macs running Mac OS X 10.7 and connected on a local network
Side note
Normally scripting events that require user interaction (as display dialog) are not allowed between two machines, and trying to fire them end in a -1713 error.
Wrapping display dialog in the tell application "AppleScript Runner" block is a workaround to that limitation.
See also:
http://wisevishvesh.wordpress.com/2010/10/14/applescript-execution-error-no-user-interaction-allowed-1713/

Related

How do I send keystrokes/interative gui to another Win10 machine?

I'm currently using AutoHotKey to create a variety of macros. I have two desktops side-by-side in a private (home) network. It is my desire to have the AHK Run command on PC1 make some sort of call to PC2. Both PCs are running Windows 10 (non-domain), and both use the same login credentials (same account via microsoft.com).
What I've tried: I have tried a few things, such as WMI, WinRM, schtasks. Each of these options work when dealing with non-interactive scripts. I am trying to call scripts that a) open GUI windows or b) send key strokes to PC2.
Other requirements:
The solution cannot require the password to be type in a prompt nor provided in the command-line call. The desired effect is that I press a button on my keyboard -> ahk command triggers -> script on PC2 is called.
As this network is shared with roommates (and whoever they allow to connect to our wifi), basic security is still a necessity.
This is not a language specific question - I am looking for the simplest/easiest/cleanest method. Thanks for reading.
Try a remote access connection app like TeamViewer. They allow you to control one PC from another across a network. https://www.teamviewer.com/en/
I have an astronomical observatory in my yard with four computers connected to all the observatory equipment. These four computers are controlled over my home network from one PC in the house.
The remote access app allows you to run an .exe on another computer which in my case is usually a compiled AHK script.
I have a number of tasks that require several PC's. A script running on the main PC will start secondary scripts on the observatory PC'c which in turn will send messages back and forth by sending text files to each others shared files. The PC receiving the text file will perform a specific action based on the message.
Here's a link to the observatory startup procedure. I a startup script on the main PC which turns on all the observatory equipment then starts a secondary startup script on each of the observatory PC's to load and position all the software and then connect all the cameras and associated equipment.
https://www.youtube.com/watch?v=UN4VoOKOcXo&feature=youtu.be
This just shows how the various scrips running on the observatory PC's load and position all the various app windows. Not exactly what you may need but it may give you some ideas about what you can do with the remote access software.
Lorence

Win7's debug mode not work on VirtualBox's guest machine

I install Win7 at my virtualbox, setup the guest end a standard "bcdedit"s. (debugtype=serial, port=1, baudrate=115200 /debug=on)
following steps took:
In the host end, I alloc a virtual serial port to the guest system
set the it with named-pipe "\.\pipe\debug".
I start Windbg to connect "\.\pipe\debug", I get "Could not open the pipe Win32 error 0n2"
After I power on the guest machine, I reopen Windbg, it works fine, but just saying "Opend \.\pipe\debug Waiting to reconnect...", It seems that no debugging data communicated with Guest Machine.
I try "bcdedit /bootdebug on", and reboot the machine. this time I see several output by Windbg during booting.
BD: Boot Debugger Initialized Connected to Windows Boot Debugger 7601
x64 target at (Sat Mar 17 17:28:46.559 2018 (UTC + 8:00)), ptr64 TRUE
Kernel Debugger connection established.
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Symbol
search path is:
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Executable
search path is: ReadVirtual() failed in GetXStateConfiguration()
first read attempt (error == 997. Windows Boot Debugger Kernel Version
7601 UP Free x64 Machine Name: Primary image base =
0x000000000052d000 Loaded module list = 0x00000000005df9e0 System
Uptime: not available Shutdown occurred at (Sat Mar 17 17:28:53.382
2018 (UTC + 8:00))...unloading all symbol tables.
It proves "\.\pipe\debug" is OK to transfer output of Guest VM's COM1.
When entering to login console, I see such message, and previous outputs turn to gray:
************* Path validation summary ************** Response Time (ms) Location Deferred
srvC:\Symbolshttp://msdl.microsoft.com/download/symbols Waiting to
reconnect...
I login and check the Device Manager, I can't find device COM1. but if I turn off /debug, I can.(Indeed, I used putty to check Guest'COM1 with Host's rawfile, I found it worked too, with the input of putty written to Host's file)
I tried many times with different COMs and baudrate, always got same outputs.
I tried a similar VMware Station, and got the same result.
Problem disappeared after I changed a Host machine and redid above steps.(:
Questions:
WHY can't I see the COM1 device with /debug on In the guest machine?
Does the Baudrate matters? (mismatch among Host's windbg setting, Guest's Device setting and Guest's debug setting), I tried to "Cycle BaudRate "In Windbg, it said Net COM port baud is ignored.
How to diagnose the problem?
_EDIT:
I found a similar post stuck on "reconnecting"
and this issue My Kernel Debugger Won’t Connect which refered there was a hot key "Ctrl+Alt+D" to show details of Windbg's I/O instead of a black-box. And it's normal and reasonable that COM1 disappear when "/debug=on" as the post said.
I could see the efforts windbg payed to sync the guest. After I pressed "ctrl+break", I saw windbg said "Send Sync", and still stuck... And, I would going to power off the guest by pressing "Host+Q". Miracle took place. Windbg came to alive and succeeded to break in.
I tried several times, with no failure. Now I can work happily... But WHY???
when I press "Ctrl+break", the windbg says
Send sync break
Send Break in ...
and stuck, and target machine is paused too. And I press "Host+Q" the "Esc" then it works.
install vbox in physical machine (the physical machine is Host henceforth)
install os inside vbox ( the os inside vbox is Target henceforth)
reboot Target and see if things go well a few times
open a elevated command prompt inside Target
since you have not created a Debug BootEntry create one first
run bcdedit /copy /? for syntax
to copy current bootentry to a new one you will be using
bcddedit /copy {current} /d "MyPipeDream"
{current} is alias for the current boot entry ID a GUID
MyPipeDream is a descriptive string
if you reboot now you should get two boot entries to choose from
choose the new bootentry to boot with so that you can operate with {current} well known ID instead of copy pasting or mistyping long unintuitive guids
assuming you booted MyPipeDream
you can check and enable debugging on the current id with
bcdedit /debug {current} on
you should reboot again to MyPipeDream which would be debug enabled now as in screen shots below
but before rebooting set the Serial Interface in vbox settings
also uncheck the connect to existing so that vbox creates the pipe
instead of trying to connect to an existing pipe
all setting on target are over now
on the host create a bat file with contents below and execute it
notice the pipename it is pipedream exactly matching the name we gave in vbox settings and not MyDreamPipe which is the ID descriptive string
start windbg -k com:port=\\.\pipe\pipedream,baud=115200,pipe,reconnect,resets=0
windbg should open up and say witing to reconnect
press ctrl+break a few times in the HOST WINDBG and vbox should connect to windbg or press ctrl+print screen in the TARGET
please see if you require Function keys (some wireless keyboards like logitech
needs ctrl+fn+pause / break key combos instead of plain ctrl+break
else open the Debug menu and select the Break in UI

RedHat 7 Dual Screen xrdp

I am running a RHEL 7.2 server and connecting to it by xrdp (using windows remote desktop). Is there a way to connect to the server and view it using both of my monitors? I've tried selecting the "use all my monitors for the remote session" box in Windows Remote Desktop Connection but that didn't make any difference.
I have (sort of) done this on Ubuntu. I don't know if it works for RHEL 7.2. I mostly got my info from here if you want more detail.
Edit the file here:
/etc/xrdp/xrdp.ini
Make an entry at the end of the file that looks like this:
[xrdp8]
name=Share-Screens
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=ask
When the person you want to share screens with logs in, make note of the port shown in the connection log when they first log in. There will be two ports, make sure it is the second one. When you log in, change the module to "Share-Screens" and enter in the username and password to what the other person used and enter in that port that you took note of.
This works for me, but unfortunately I cannot share screens with a person remotely logged in and with me locally logged in. I hope this might help you, but this post is getting pretty old!

How does jupyterhub work?

I have to construct the infrastructure so that multiple users can work on the same jupyter(ipython notebook) service, yet via different sessions, so the users can't interrupt each other.
I thought jupyterhub( https://github.com/jupyter/jupyterhub) is there to control everything, yet it still seems like the session is bound to one since if I logout of it on one window, an instance on another window also logs out.
Is there a way to control multi-sessions on jupyter?
Jupyter doesn't support multiple users editing the same notebook at the same time without data loss. I don't believe it is meant to. I believe Jupyter is meant to provide a relatively easy to configure and install instance of python that contains the same installed modules and environment to minimize problems caused by environmental differences between developer workstations.
Also, it's meant to make the barrier for entry to programming python and working in data science much lower than it otherwise would be. That is, it's much easier to talk an analyst into visiting a website than learning a new programming language.
More to the point of your question, though: The way Jupyter handles 'sessions' is that (unless configured otherwise), every Jupyter user corresponds to a user on the on the server that is running Jupyter and every time you log in to Jupyter you are effectively creating a new login to that server's operating system. It immediately follows that if you log out of Jupyter from one window, you're logging out of not just that browser's session, but also the login to the Jupyter server's operating system as well, which would kill all other open browser windows.
You question is a bit unclear, JupyterHub is meant to support multi-user across many machines. If course if you use the same browser from the same machine, you get logged out too, as the browser is carrying the connexion information that get revoked.
Jupyterhub is a web based multiuser application, that provides session and authentication services.
Jupyterhub will be hosted in unix/linux server, the client can access it using the ip address and port number,Once it is accessed by client, the client must enter the userid and password which is associated with the sytem users in server (PAM authentication) which will redirect to the home directory of the current user.
You can build a infrastructure by using jupyterhub, which is meant for multi-user. The jupyterhub just provides multi user interface and PAM authentication, you have to configure security, file access permission everything in kernel level using shell script.
Normally, you host a jupyterhub or jupyter notebook in command line. In the same way you can write a shell script to setup multi-user environment.

Windows 7: network not ready (blue circle is spinning)

On my Win7-PC the network takes up to 10 minutes until it's shown as ready (through network icon). The weird thing is that even in the meantime (blue circle is spinning) network activities like mail, internet and access to network shares are working.
How does Win7 decide that a network is ready?
The issue is that one of my installed apps which uses the IP stack (runs on localhost) doesn't work until the network is in ready-state. I found out that if I disable the Windows Management Instrumentation service the network state switches to ready immediately. However, this prevents a couple of other services from starting what could lead to a security issue. (To me it seems like my PC waits until it gets a GO from our network... but no evidence here)
Any hints?
Try to apply this hotfix, sometimes it works:
http://support.microsoft.com/kb/2617858
When it happens to me I have to kill the process tree of two services:
SMS Agent Host
Winmgmt
(select the service, right click, select "go to process", right click on the process, select "end process tree"; if you cannot see the process remember to click the "show processes from all the users" button).
Finally delete the "c:\windows\system32\wbem\repository" folder as fast as possible.
The "repository" folder will be re-created and the network will start working properly.
This worked for me.
Click on run dialog and type msconfig.
In the pop up click on services.
Then check/tick Hide Microsoft services.
In the ensuing dialog uncheck/untick Nividia Network service.
Finally click Apply. restart computer.
Your problem will be solved.
Disabling NVidia Network services stopped that for me.
While updating drivers etc. is good practice, it is usually just a wild goosechase.

Resources