iTerm/bash script to open my workspace - bash

So I want to open my workspace automatically when I open a profile for work, the problem is that it opens the windows (and windows splits) correctly but doesn't run any script to start my server, celery tasks, get into the correct folders, etc.
Is there a way to do this? even running a bash script would work for me, it doesn't have to be supported by iTerm.

I think you will find this article useful. It uses Apple Script to tell iTerm2 to open multiple windows and run commands in each of them.
http://90kts.com/2011/09/29/split-panes-and-remembered-sessions-in-iterm2/

Related

How to run script as admin on startup

I have a case where my users runs a script (bat) file that I wrote on win7 as admin. Im looking for a simple way (without installing any tools) to make a different script that I wrote run on windows start up through this batch file.
I tried using startup folder but that will run my script without admin rights. I also read about a solution with runas command but it didnt work and also its problematic to know the user details in advanced. I looked online but couldnt find anything to help me to do this automatically through the command line
UPDATE
By looking at the answers im thinking maybe the situation is not clear enough.
Im writing this script on my pc. I give this script (batch file) to my clients, who lack any knowledge of how to do anything but simple stuffs, such as openning cmd as admin and running my batch file that I write in advance. To sum up, I need this batch to be able to set a process (a different batch or vbs file) to run with admin privelleges on startup of the pc (again, without requiring my clients to do any complicated actions, im hoping to get my script to do everything for them)
If you do not have the credentials for the administrator account, you will not be able to run the script with elevated privilege. If you do have those credentials, then you can set up a scheduled task (described at this SevenForums post), running it under the administrator account.
Check the script carefully, and ensure that it's not incorporating anything that may cause problems, like an unavoidable GUI presentation - this question on ServerFault discusses that pitfall.
Make a shortcut to your batch, set its properties>advanced to run as administrator and then move the shortcut to the startup directory.

Run a shell command through a Chrome App

I have Crouton on my Chromebook with Spotify inside an Ubuntu chroot.
I can execute Spotify inside an Ubuntu chroot as a single app window via a Crouton command.
I want to create a Chrome OS application that acts as a launcher for Spotify, Skype, etc.
In short:
My Chrome OS app should execute a shell command.
I read about NPAPI, but it says it's getting depreciated (since 2013 o.O).
If there's another way (for example executing a bash script that adds a button to the shelf that just executes another shell script to open Spotify), it would also be great.
Thx in advance :)
EDIT:
With Dart this seems to be possible. It says "access File system, USB Devices, shells and much more" with it
Looks like Native Messaging is just the thing you're looking for! However you may need to create an application that can be registered as a Native Messaging Host. This application will then in turn call the shell command/script you intend to run.

Run an AppleScript from a server/in the cloud

Is there a possibility to run AppleScripts from a server or from a cloud service?
I want to have some scripts that can run if my computer is sleeping/off.
I looked around a bit on Google, but haven't found anything promising.
If this doesn't exist I basically need to remove the password from my computer and wake up the computer whenever the script needs to run.
It largely depends on what you want to do with the script. There are a few options.
You can use 'stay open' script bundles that, for example, check a certain folder and run when you interact with this folder
You can launch certain scripts when the server boots.
You need to have a server that is always on for this to work. I have this running myself and it works just fine. However, as I said before, it largely depends on what you want to do with your scripts.

scripting languages native to windows for remote users support

I work for a application dev company but I am in the support side of it. I am looking to run scripts on to remote-host (logmein Rescue Technician Pro). Our clients all run windows machines and the oldest OS version we support is XP SP3 and the latest win8. I need a scripting language that is native to windows and doesn't require any download this or unzip that. These scripts are Powershell scripts but as we all know the executionpolicy needs to be set to unrestricted. I need a scripting language that automates mouse clicks and keystrokes like hitting enter on the keyboard or typing words into cmd/Powershell, then hitting enter for example. I am trying to run a script in another language to disable the excutionpolicy in Powershell and then start the powershell scripts from this point. I hope I have explained myself.
UPDATE:
I am bad at what I am trying to explain I guess. I need to run a script to disable ExecutionPolicy on remote users through LOGMEIN RESCUE TECHNICIAN. Logmein has a tab called "SCRIPTS" that automatically startup when you connect to the remote session. The problem is that PowerShell by default is set to executionpolicy restricted. That will not allow my scripts to run and I have to run them manually from my machine, I believe their is a way to just run the scripts and have them out put the results to me without having to pull up the remote users GUI, all the computers are their own independent machines and not on a domain. I need to run the scripts as unrestricted on the remote machine on initiation of the remote session. Thats why I having going around in circles trying to figure this out. I was able to disable powershell from the cmd but i need to hit enter, i need to script the enter key stroke but again i keep running into blocks just run my scripts. I'm annoyed by this now at this point.
You can run a powershell script like so:
powershell -executionpolicy unrestricted -file "C:\Myscript.ps1"
This will not change the global executionpolicy for the whole machine, but just to run that script.
Two options:
1.Stick with PowerShell. When you launch PowerShell, instead of launching from the shortcut, run the following command (either from a cmd prompt, or run command):
powershell.exe -ExecutionPolicy ByPass
This will run PowerShell with the execution mode set to ByPass.
2.Use the old way of scripting that works on all versions of Windows, VB scripts. (although, after using PowerShell, VB scripts are hard to go back to)
I'd honestly go with JScript (or VBScript, but JScript is a much nicer language IMHO), since you don't want to have to install anything on the remote machines. XP doesn't include PowerShell, so you'd have to install it at some point.
WSH (Windows Scripting Host) languages like VBScript and JScript, and PowerShell can all simulate mouse clicks and keystrokes, but if you want one script that will run on all of those platforms out-of-the-box, you'll need to stick with WSH languages.
If you have any control over what gets installed on the remote systems, though, go with PowerShell, or - at very least - make sure that the Windows Scripting Host components are up to date with the latest release available for the platform. I'm not sure whether that would come as part of the typical Windows Updates or not.
Just my $0.02.

Emacs on Window 7 saving files to VirtualStore directory

I've recently installed ClojureBox on a Windows 7 machine after using it on a different, XP machine for a while. When I created and saved a file, it wasn't being saved where I expected, but to the \Users\xxxx\AppData\Local\VirtualStore directory. This happened as long as I wasn't running emacs as the local administrator.
A Google search returned only a couple of hits, and with nothing I could really apply other than to run emacs as a local admin.
Any other way to get around this? Is there a windows setting, or something I could configure in emacs?
Thanks.
You can right-click Emacs and "run as Administrator" which I expect will get annoying quickly. Further, if you launch other apps from inside it you might be misled about the behaviour of those apps under normal circumstances. A better approach would be to save your files somewhere other than under Program Files or the root of C, thus avoiding virtualization.

Resources