I'm new to apple script, but I'd like to open up Terminal, change the path to where the vagrant up command can be ran and then run a vagrant up. So far I have got to;
tell application "Terminal"
activate
do script "cd desktop/development/vagrant/"
end tell
If I try the following;
tell application "Terminal"
activate
do script "cd desktop/development/vagrant/"
do script "vagrant up"
end tell
This opens up a second terminal and tries to execute the vagrant up from the home location instead of running the command in the terminal window that navigates to desktop/development/vagrant/
My question is; is there a way to either run a follow up command in the original (first) Terminal window or a way to run the cd desktop/development/vagrant vagrant up as one singular command?
Thanks in advance
Found the answer;
tell application "Terminal"
set currentTab to do script ("cd desktop/development/vagrant/")
do script ("vagrant up") in currentTab
end tell
Related
I think the answer to my questions is NO. But I need to get clarity be certain about this.
EXAMPLE: I have sqlcmd windows utility installed on windows and can use it with command prompt, simply type sqlcmd in command prompt and start typing T-SQL commands such as sp_databases;go will list the databases.
Next if I want to use WSL bash prompt for doing the same I believe the only way to do so is to first install sqlcmd for Ubuntu from WSL bash and then log in to localhost SQL Server with sqlcmd.
Please share what you know to help me get a better understanding of how to get full benefit of WSL for doing things such as using the sqlcmd command at WSL bash prompt.
Thanks for the help.
I have tried issuing this command at the WSL bash prompt which did not work:
/mnt/c/Program\ Files/Microsoft\ SQL\ Server/110/Tools/Binn/SQLCMD.EXE
OK I had some success, I needed some getting use to but there is some thing to go off here. To reiterate my name idea was that if a program such as R or Python is installed in windows I shouldn't have to re-install it in WSL with sudo apt-get install ...
So for using the sqlcmd utility the following command at bash worked:
/mnt/c/Windows/System32/cmd.exe /C sqlcmd
This command will let give me a "black line/space" to type in T-SQL commands into. It gives me some success with my experiment, at first it looks funny since there was no prompt or anything but I just type the command sp_databases [enter] go [enter] and it does the trick.
Next I wanted to really wanted to test this and tried to run the R (installation that runs when I type >R at command prompt). This is command that worked at bash prompt:
/mnt/c/Windows/System32/cmd.exe /C R --no-save
This was more satisfying as it printed R intro and started the R-shell/prompt, the issue was though (what I immediately noticed) was that if I use the up arrow key to scroll through previous commands its won't work rather ^[[A is printed on the screen at the prompt.
Next I tried another program Python, at command prompt in windows if I enter >python it starts a python with the intro, but at WSL bash prompt when I tried:
/mnt/c/Windows/System32/cmd.exe /C python it takes me to blank line but unlike sqlcmd this time a simple python command like dir() dose not give back any output.
I would greatly appreciate if someone who knows more about these things could explain to me how I can use the programs already installed in windows with reinstalling them in WSL.
§ So why did the python program not start in WSL like it does at the command-prompt.
§ And in case of R program that did start how would I scroll through previous command if the up arrow key start printing ^[[A
Thanks for help, hope my question is clear enough.
I’ve started weblogic through putty:
./startWebLogic.sh
After that server started successfully.
But when I close the putty window, the server stops working
How can I keep weblogic running after I close the putty window?
Thanks!
You will want to use something like the following:
nohup ./startWebLogic.sh &
Nohup is a unix command, used to start another program, in such a way that it does not terminate when the parent process is terminated.
You can also output it to a file if you'd like:
nohup ./startWebLogic.sh > admin_server.out &
Simple Steps:
after the login through putty follow the below steps:
Go directory of server where "startWebLogic.sh" this command located.
typed command "screen" press enter (A new Screen will opened)
In the new screen type your run command "./startWebLogic.sh".
Press Ctrl+a then press d(without holding Ctrl) you will return back previous screen)
if like to go again your server log screen typed command "screen -r"
Akbar
I am running into an issue with MacOS 10.10 and Safari 8.0 where Selenium driver cannot establish connection with SafariDriver. Details in this thread: https://code.google.com/p/selenium/issues/detail?id=7933. To run tests locally, the workaround is to download Selenium 2.44.0, extract the package, and doubleclick on SafariDriver.safariextz to install. However through SSH connection this does not work. I want to install the SafariDriver.safariextz from command line, before each test run. Any clues on how to install the .safariextz file from command line?
Update: Just verified that every time Safari is started from SSH connection (/Applications/Safari.app/Contents/MacOS/Safari) all the extensions are removed (Safari-> Preferences->Extensions is empty).
If you are on the same machine, AppleScript should work:
# this first part might not be needed
osascript -e 'tell application "Safari"
activate
end tell'
osascript -e 'ignoring application responses
tell application "Safari"
open "'"/path/to/SafariDriver.safariextz"'"
end tell
end ignoring
tell application "System Events"
tell process "Safari"
set frontmost to true
repeat until (exists window 1) and subrole of window 1 is "AXDialog" -- wait until the dialog is displayed.
delay 1
end repeat
click button 1 of front window -- install
end tell
end tell'
If that fails, then you might have to enable access for assistive devices and applications by opening System Preferences > Security & Privacy > Privacy > Accessibility and check the applications you want to allow access (Safari, etc...).
More info: https://support.apple.com/en-us/HT202866
Jacob Salmela also has created a utility to do this from command line:
http://jacobsalmela.com/os-x-yosemite-enable-access-assistive-devices-command-line/
The following workaround did trick for me:
After the upgrade Safari extensions are part of the keychain, and over SSH the user does not have access to the login keychain. The solution is to grant that access for EACH ssh session.
security -v unlock-keychain -p <password> ~/Library/Keychains/login.keychain
Then opening Safari with the step below should work
/Applications/Safari.app/Contents/MacOS/Safari
For a 'permanent' solution add a build step, to execute shell script as follows:
#!/bin/bash
keychain="~/Library/Keychains/login.keychain"
security unlock-keychain -p <password> ${keychain} &>/dev/null
if [ $? -ne 0 ];then
echo "Cannot open keychain ${keychain}"
exit 1
fi
As explained here http://sap-production.github.io/xcode-maven-plugin/site/howto/HandlingKeychainsInMasterSlaveEnvironment.html.
Hello people.
I'm using Jenkins as CI server and I need to run some performance test using Jmeter. I've setup the plugin and configured my workspace and everything works ok, but I have to do some steps manually and I want a bit more of "automation".
Currently i have some small programs in a remote server. These programs make some specific validations, for instance (just to explain): validates e-mail addresses, phone numbers, etc.
So, before I run the build in jenkins, I have to manually start the program (file.sh) I want:
I have to use putty (or any othe ssh client) to conect to the server and then run, for instance, the command
./email_validation.sh
And the Jmeter test runs in a correct way, and when the test is done I have to manually "shut down" the program I started. But what I want is trying to start the program I need in Jenkins configuration (not manually outside Jenkins, but in "execute shell" or "execute remote shell using ssh" build step).
I have tried to start it, but it get stuck, because when Jenkins build finds the command
./email_validation.sh
the build stops, it waits for the command to finish and then it will continue the other build steps, but obviously, I need this step not to finish until the test is executed.
Is there a way to achieve this? Thanks
Run your command as a background process by adding the & symbol at the end of the command and use the nohup command in case the parent process gets a hangup signal, e.g.
nohup /path/to/email_validation.sh &
If the script produces any output, it will go by default to the file nohup.out in the current directory when the script was launched.
You can kill the process at the end of the build by running:
pkill email_validation.sh
im a linux fan.
A few days ago i found tmux very useful.
Now im using it all day.
I run tmux on a remote shell and working there. On my local pc only one terminal working.
And i found interesting thing:
my mutt program is beeping when new mail arrives. And tmux is transferring this beep to my local PC, is there a way to run similar beep by any shell command ?
I want to use it for some command finishing sign.
I wrote a little script called beep.sh that I use for things like that:
#!/bin/bash
echo $'\a' > `/usr/bin/tty`