scripting

How Can I Find Which Process is Displaying a Randomly Appearing Window?

I have a user who randomly gets a Script Error box (shown below) which doesn't indicate what program is having the issue. It'll popup multiple times a day. Any ideas on how to determine which program is failing? He can't determine any consistency about when they pop up. ...

Keyboard and mouse interaction on Linux

I use Linux because it is a superior development environment to Windows. However I recently came across a Windows library called AHK that gives me great control to interact with applications. Is there an equivalent in the Linux world? ...

Write a C# script to test hundreds of domain names

A client has given me a spreadsheet of hundreds of domain names. My task is to determine the following about each: Which domains are connected to a web server / website. Of those that are, which redirect to another site. What is the server software running (ASP, ASP.NET, Apache, etc) ...and output the results in an organized fashion...

Novice needs advice for script that gets data and returns it in a usable format.

I have a large number of images that I am putting into web pages. Rather than painstakingly enter all of the image attributes, I thought I could write a script that would do the work for me. I just need a little push in the right direction. I want the script to get the width and height of each image, then format this into an img tag th...

Hiding ImageJ interface elements

I'm working on a project involving enlisting a large number of relatively unskilled workers to do repetitive image analysis using ImageJ. I've written a set of macros which walk them through the analysis process, but in order to increase throughput and reduce errors, I'd like to figure out how to hide as much of the gui/menu interface as...

Creating a mailbox in Outlook Express using a script

I remember ages ago ISPs would help you get Outlook Express sorted for your new email account by getting you to download and run a .ini file that contained the settings you need. Now I need to use one, I can't find an example of one anywhere. Any ideas? ...

Makes chances of something happening C#

How can I make a script that makes one thing happen 4/5 times and the other thing 1/5 times I need it to appear after this private void Arrest() { Ped Criminal = Player.GetTargetedPed(); if (Exists(Criminal) && (Player.Character.Position.DistanceTo(Criminal.Position) <= 10.0F)) { ...

How to make XCode Run Script Build Phase run if the build breaks?

Hi, I want to be able to launch a Run Script Build Phase in XCode that does this: /usr/bin/say "Broke it." if my build fails. Not sure how to capture the build failure to prompt that though? Two reasons I guess, one "what to catch", two "the build is done so the script has already run in theory... ?" How would you do this? Thanks //...

Passing BASH arguments

[Edit] I've summarized the answer to the following below, the error lies in the line: [Edit] if [$1 ne $value]; then I'm trying to pass a value to a command: #!/bin/bash for value in $(mycommand $1) do echo Found $value if [$1 ne $value]; then echo No match! if done But if I type in the following to execute t...

Proper use of Invoke-Expression?

I've just recently completed my first nightly build script (first significant anything script, really) in powershell. I seem to have things working well, if not yet robustly (I haven't handled significant error-checking yet), but I found myself falling into an idiom around the Invoke-Expression cmdlet, and I'm wondering if I'm using it ...

Check the open FD limit for a given process in Linux

Hi, I recently had a Linux process which "leaked" file descriptors: It opened them and didn't properly close some of them. If I had monitored this, I could tell - in advance - that the process was reaching its limit. Is there a nice, Bash\Python way to check the FD usage ratio for a given process in a Ubuntu Linux system? EDIT: I no...

programmatically extract tar.gz in a single step (on windows with 7zip)

PROBLEM: I would like to be able to extract tar.gz files in a single step. This makes my question almost identical to this one: stackoverflow question for tar-gz. My question is almost the same, but not the same, because I would like to do this on windows using 7zip command-line (or something similar) inside a bat file or ruby/perl/pyt...

How to send personalized emails (via a script)

Derek Sivers posted this on his blog - I'm interested how other programmers in stackoverflow would approach this. ...

Replacing huge blocks with sed

Hi. I have 2 files that are generated elsewhere. First one is "what to search", and second one is the replacement. Both files are huge, about 2-3mb each. I need to write a bash script that takes an even bigger file (about 200-300mb) and replaces all occurrences of file1 contents to file2 contents. Problem is, file1 and file2 can conta...

where does msscript.ocx gets installed from

Hi All, I'm using msscript.ocx in my application which is an activex scripting host for windows. Although I want to be able to use the same for XP embedded(XPe) which's highly customizable. 1.I want to know whether on XPe, msscript.ocx can be optionally installed or not? 2.Where does it get installed from, IE? 3.Or is it a windows co...

Writing a script to close screen session

I have a bunch of screen sessions running on my machine, but all of them are detached and unneeded. Is there a good way to just close all of them, so I have nothing when I type "screen -ls"? ...

Web Application Scanner

I want to develop a Web applications to collect or exchange sensitive or personal data, this system would give user a detailed automated report on : • How secure user's website is? • How easily it can be hacked? • Where exactly is the problem and • What are the remedies? Any suggestions???? ...

Script goes ghost when dynamic content is loaded

After loading a PHP template (using jQuery's load function), this simple script won't make the DIV go away: $("#trigger").click(function(event){ $("#removeThisDIV").hide(); The HTML bit: <p id="trigger">X</p> Tried to remove other DIVs, before the load -- it works just fine. After the load, the script went dead. Ideas? Thanks. ...

PowerShell Script to Disable/Re-enable a TCP/IP Port

Is there a way to disable and re-enable a known TCP/IP port in PowerShell? ...

Running script with admin permissions on OS X

Hi all, I've tried my best to find out a solution with the many script questions on Stack Overflow and the internet, but I can't seem to find the solution I need. What I want to do is create a more automated and less clicking solution to remove all the Mobile cached user accounts on a system. I've been logging in and manually going to ...