scripting

Psexec , cmd and batch file

Hello. I have a batch file named a.bat on a winserver2008 Desktop. That batch file only write the SessionID (from environment variable) to a local eventlog. I want to execute it remotely using cmd (otherwise the SessionName doesn't appear). so I have tried c:\PsTools\psexec.exe \\<Server> -u test2 -p <Password> -i 2 cmd "c:\Users\te...

C# Script version of PyBinding for WPF

I wrote a CSharpScriptBinding roughly equivalent to the PyBinding on CodePlex. It uses the C# script engine from http://www.csscript.net. After I wrote it, I kind of decided it might not really be something good to use. Although it caches the compiled script code as an already compiled Assembly, my concern is that I will have one temp...

Dump Hibernate activity to sql script file

Hi, I'm trying to log hibernate activity (only dml operations) to an sql script file. My goal is to have a way to reconstruct the database from a given starting point to the current state by executing the generated script. I can get the sql queries from log4j logs but they have more information than the raw sql queries and i would need...

Create folder for todays date

Hi, I have a folder named as 2010. In this I want a folder for each month like "Jan10", "Feb10"....."Dec10" In each month folder I want to create folder for "Todays date" I have create a shortcut for that 2010 folder with Target as C:\WINDOWS\explorer.exe /n, /e, /select, F:\2010 I want a functionality that will execute when I click...

Processing a tab delimited file with shell script processing

Hello, normally I would use Python/Perl for this procedure but I find myself (for political reasons) having to pull this off using a bash shell. I have a large tab delimited file that contains six columns and the second column is integers. I need to shell script a solution that would verify that the file indeed is six columns and that t...

VB Script and filename with space

Hi I wrote a VBS file to open the "6 May" folder with following content path = "F:\Test\2010\May\6 May" Set Sh = CreateObject("WSCript.Shell") Sh.Run ""path"",3,True Set Sh = Nothing However on executing this I am getting following error Windows Script Host Script: F:\Sperry\2010\May_06 May\open.vbs Line: 4 Char: 10 Error: ...

BASH: How to remove all files except those named in a manifest?

I have a manifest file which is just a list of newline separated filenames. How can I remove all files that are not named in the manifest from a folder? I've tried to build a find ./ ! -name "filename" command dynamically: command="find ./ ! -name \"MANIFEST\" " for line in `cat MANIFEST`; do command=${command}"! -name \"${line}\" ...

Execute an Ant script from other ant script?

Hi, I have several ant scripts, for example ant1.xml, ant2.xml, ant3.xml. And I want to execute ant1.xml and ant2.xml in ant3.xml, so that when I execute ant3.xml, ant1.xml and ant2.xml are executed. Can anyone show me some ways, please? Thanks ...

How can I write a script to firefox that works with the adressbar?

I want to write a script to firefox that in the moment I start to write address in the addressbar it change the language to the one I'll choose (in the add-on).How do I do it? ...

Is there a way to write a greasemonkey script to register hotkeys?

I'm using a Wiki application that has buttons to indent and outdent list items. I'd like to write a greasemonkey script to capture Ctrl+M and Ctrl+Shift+M for indent and outdent, respectively. Is this possible? ...

How to be notified when a script's background job completes?

My question is very similar to this one except that my background process was started from a script. I could be doing something wrong but when I try this simple example: #!/bin/bash set -mb # enable job control and notification sleep 5 & I never receive notification when the sleep background command finishes. However, if I execute t...

Scriptaculous Slider stops working in iFrame

Hi there, I am stumped! I have a form for leaving reviews that uses a slider from the Scriptaculous library. The form is retrieved through Ajax once a user clicks on a link to leave a review and all works fine. In order to enable ajax-looking file uploading, I'm using an iFrame to submit the review. My problem occurs when the form is...

How can I sum up the lines added/removed by a user in a git repo?

I am trying to find the total number of lines added and total number of lines removed by a user in a git repository. I looked at http://stackoverflow.com/questions/1265040/how-to-count-total-lines-changed-by-a-specific-author-in-a-git-repository, which had the command git log --author="<authorname>" --pretty=tformat: --numstat, but the a...

ruby script/server not reading RAILS_ENV option

Hello, I tried to run ruby script/server RAILS_ENV=production but somehow it always try to read "development" config.. nothings wrong with RAKE XXX RAILS_ENV=production (trying to read production config). Any idea how to troubleshoot? I have my other rails app in the same machine and it works fine. The problem above only happen fo...

Accessing Oracle 6i and 9i/10g Databases using C#

Hi all, I am making two build files using NAnt. The first aims to automatically compile Oracle 6i forms and reports and the second aims to compile Oracle 9i/10g forms and reports. Within the NAnt task is a C# script which prompts the developer for database credentials (username, password, database) in order to compile the forms and repo...

bashscript for file search and replace!

Hey I try to write a littel bash script. This should copy a dir and all files in it. Then it should search each file and dir in this copied dir for a String (e.g @ForTestingOnly) and then this save the line number. Then it should go on and count each { and } as soon as the number is equals it should save againg the line number. => it sho...

What is a way to reload lua scripts during run-time?

I want to reload lua scripts at run-time. What are the ways to do this? Do you just have to reinitialize the lua system and then re-read all the lua files? ...

Help with MySQL (.sql) and Shell Script

How do I call the following in a .sql file? mysql -u username -h serverip db -e "select a, b, c, d from mytable" > '/home/dump/result.txt'; I will then have to convert the tab separated file to csv for which I want to use sed. Is there a way to do it all in one line? (append sed command to convert the .txt file to csv) How to use ...

Google Chart APIs for plotting data in local machine

Hi guys, Preface: I am a system programmer (who has just started his career as a S/W Engineer), so not very good @ web scripting languages, though I have just started learning them. Problem Synopsis: I want to write an app that keeps track of what I am doing and records it allowing me to analyse my time spending pattern and could he...

Fonts Script Enumeration

Dear All, I cant find a way under c# classes ( System.Text.InstalledFontCollection & System.Windows.Media.FontFamily ) to enumerate the scripts that fonts have. To be more clear, in the FontDialog Control, there is a ComboBox that lists the scripts langagues ( arabic, greek, etc.. ). how can I enumerate these values by font ? Thanks a...