scripting

Send mail from a Windows script

I would like to send mail from a script on a Windows Server 2003 Standard Edition. I think the server setup is pretty much out of the box. The mail server is an Exchange one, and when you're on the internal network you can use plain old SMTP. I have done it from my machine with Perl, but unfortunately Perl is not available on the server...

What is the difference between a method and a function

I am a long-time Applescript user and new shell scripter who wants to learn a more general scripting language like Javascript or Python for performance reasons. I am having trouble getting my head around concepts like object orientation, classes and instantiation. If someone could point me to a pithy explanation of methods vs. functio...

Awk scripting help - Logic Issue

I'm currently writing a simple .sh script to parse an Exim log file for strings matching " o' ". Currently, when viewing output.txt, all that is there is a 0 printed on every line(606 lines). I'm guessing my logic is wrong, as awk does not throw any errors. Here is my code(updated for concatenation and counter issues). Edit: I've adopte...

Traversing a multi-dimensional hash in Perl

If you have a hash (or reference to a hash) in perl with many dimensions and you want to iterate across all values, what's the best way to do it. In other words, if we have $f->{$x}{$y}, I want something like foreach ($x, $y) (deep_keys %{$f}) { } instead of foreach $x (keys %f) { foreach $y (keys %{$f->{$x}) { } ...

Tcl/Tk examples?

Tcl/Tk is a simple way to script small GUIs. Can anyone give a nice example with a button and a text widget. When the button is pressed should a shell command be executed and the output piped to the text widget. If you have other nice and clean examples for useful tasks, please add them too. ...

How do I use Ruby for shell scripting?

I have some simple shell scripting tasks that I want to do for example: Selecting a file in the working directory from a list of the files matching some regular expression I know that I can do this sort of thing using standard bash and grep but I would be nice to be able to hack quick scripts that will work in windows and linux wi...

Change Sound (or other) System Preferences in Mac OS X

I'd like to be able to switch the sound output source in Mac OS X without any GUI interaction. There are tools to do control the sound output, such as SoundSource and an applescript to open the preferences dialog. What I am looking for is something that switches the preference instantly, like SoundSource but it has to be scriptable. T...

Commandline Jabber client

I need a simple scriptable/commandline jabber client. What is the best and/or simplest one to install? Clarification: I'm looking for a simple way to send messages from within a script. ...

What are your favorite LogParser Scripts?

What are you favorite LogParser 2.2 Scripts to run against IIS logs and Event logs? I am putting a list of scripts together to run against our production environment to proactively look for issues and to help when isolating performance problems. Do you have a certain list of LogParser 2.2 scripts that you use? ...

What LogParser UI do you use?

I just started using Log Parser Lizard to examine my IIS and Event logs. What UI tool do you use on top of LogParser 2.2 to view your log files on production? ...

Nano hacks: most useful tiny programs you've coded or come across

It's the first great virtue of programmers. All of us have, at one time or another automated a task with a bit of throw-away code. Sometimes it takes a couple seconds tapping out a one-liner, sometimes we spend an exorbitant amount of time automating away a two-second task and then never use it again. What tiny hack have you found usefu...

How do I abort the execution of a Python script?

Possible Duplicate: Terminating a Python script I have a simple Python script that I want to stop executing if a condition is met. For example: done = True if done: # quit/stop/exit else: # do other stuff Essentially, I am looking for something that behaves equivalently to the 'return' keyword in the body of a func...

Powershell: Run a program in a foreach.

I'm trying to get this simple Powershell script working but I think something is fundamentally wrong ;-) ls | foreach { "C:\Working\tools\custom-tool.exe" $_ } I basically want to get files in a directory and pass them one by one as arguments to the custom tool. ...

PowerShell: CLI or GUI - which do you need or prefer?

PowerShell v1.0 is obviously a console based administrative shell. It doesn't really require a GUI interface. If one is required, like the Exchange 2007 management GUI, it is built on top of PowerShell. You can create your own GUI using Windows Forms in a PowerShell script. My question is, "What sort of PowerShell scripts or management t...

"Unix shell"-alike script under Windows

Hello everybody. I need some help from the shell-script gurus out there. I have a .txt file (log) that traces the IP addresses of clients on several lines, in a format similar to this one: Line1 - Client IP [192.168.0.1] Other data Line2 - Client IP [192.168.0.2] Other data Line3 - Client IP [192.168.0.3] Other data Line4 - Client IP [...

How do I check out a file from perforce in python?

I would like to write some scripts in python that do some automated changes to source code. If the script determines it needs to change the file I would like to first check it out of perforce. I don't care about checking in because I will always want to build and test first. ...

What is the most useful script you've written for everyday life?

Just wondering what little scripts/programs people here have written that helps one with his or her everyday life (aka not work related). Anything goes, groundbreaking or not. For me right now, it's a small python script to calculate running pace given distance and time elapsed. ...

Automate getting report from webpage

Hi all, I'm a Java developer and I have a question about automating a task I've been given. I'm having to 3 times daily, login to this website we have at work, select a few form elements and then click on submit to get a report printed out. I'm wondering how I can write some sort of script that will automate this task? Where should I sta...

How to get list of running applications using PowerShell or VBScript

I need to programmatically get a list of running applications as shown in the "Applications" tab inside the Windows Task Manager using PowerShell or VBScript. All I could find so far is how to list processes using VBScript and WMI. ...

What is a good embeddable language I can use for scripting inside my software?

What mature embeddable languages are available (or reversed, which popular languages have as a stated feature the ability to be embedded in other software) and more importantly What embeddable languages have a really good tutorial on embedding their language and extending it for your specific software Bonus points: Embeddable la...