scripting

how to run a script file remotely using ssh

I want to run a script remotely. But the system doesn't recognize the path. It complains that "no such file or directory "Am i using it right? ssh kev@server1 `./test/foo.sh` ...

Unlimited fields in PHP?

How do I do unlimited fields in php? Here is the scenario: At first, there are only 2 fields, lets called: first name1, last name1 What I want to do is, when I click the "add" button, it will add another 2 fields in new row, the fields label/name should be first name2, last name2. And when I click again, it will have first name3, last ...

cron jobs to upload a file via FTP

Is it possible to use CRON to upload a file via FTP? If yes how can I call FTP to run an upload? ...

Making an IDE using Pascal Script and SynEdit

Hi, I'm creating a built-in script engine using PascalScript from RemObjects (excellent) and the SynEdit editor. It's almost finished using the IDE example shipped with PascalScript and the IDE example in SynEdit - but - I can't see how to ask PascalScript whether a numbered source line is 'executable' or not. (I can then use this to mar...

Tool or method to parse an incoming e mail, strip the data and push into a database

has anybody done anything with scripts to parse an incoming e mail to a specific address, strip out the data and insert it into a SQL database? The e mail would be coming in through exchange 2003 server and would be in a known fixed format, ie Name: Firstname Surname ID Number: nnnnnnn etc. etc. Ideally the solution would need to oper...

Need a PowerShell script that copies files from the current dir that the script is run from to another location

Hi all, I have a pretty basic PowerShell script that I need help with. This is my first time even attempting to script so bare with me. I work for a software development and they have asked me to write a script that they can package in with their build updates. Basically they will complete a build that get's dropped to a folder (say \se...

Command line Script for cleaning VS project + backing up SQL + zipping??

Does anyone happen to have some sort of a nice command line script they use that could do something like: Clean VS project (delete \bin folder contents, etc) Backup SQL Server database Zip all files up ...

How do I speed this up?

The following code makes a list of names and 'numbers' and gives each person a random age between 15 and 90. #!/bin/sh file=$1 n=$2 # if number is zero exit if [ "$n" -eq "0" ] then exit 0 fi echo "Generating list of $n people." for i in `seq 1 $n`; do let "NUM=($RANDOM%75)+15" echo "name$i $NUM (###)###-####" >> $file d...

java expression language that can't access 'unsafe' java methods

I am working on a project where I will let users submit small 'scripts' to the server, and I will execute those scripts. There are many scripting languages which can be embedded into a Java program, such as mvel, ognl, uel, clojure, rhino javascript, etc., but, as far as I can tell, they all allow script writer to call Java constructors...

How do I programatically mount a raw iscsi volume in windows, and get it ready to use?

The API for creating a new volume on our SAN is pretty straight forward. What I have not been able to figure out is how to programatically connect the iSCSI initiator to it, initialize the space (in the windows disk manager sense) and finally format it and mount it is a drive letter. I currently use win2k3, however moving to win2k8 is ...

How to delete a part of the file with awk

Hi I'm writing a shell script, which at some point has to take a file, search for a particular word in it and delete the whole text that comes after this word (including the word itself) - awk is the right tool I suppose, but I don't really know much about programming in it. Could anyone help me? ...

How to have arguments supplied to .exe passed on to a wrapped .bat script

I'd like to wrap a MyBatScript.bat script inside a MyTest.exe. Then I'd like to invoke MyTest.exe with arguments, thus: MyTest.exe arg1 arg2 format of passing arguments can be different if need be. I'd like arg1 and arg2 to be passed on to MyBatScript.bat as %1 and %2 and MyBatScript.bat executed. How Can I do this? Thanks! ...

Reading and tab-completing a directory name in a bash script

I want to prompt the user for a directory name, and have them able to tab-complete to a valid directory. So far, I've got tab-completion working for both files and directories using "read -e". I only want directories to be autocompleted when the user presses tab. Here's what I have: echo "Enter a directory" read -e -p "> " DEST How ...

WAIT for "any process" to finish

Is there any built in feature in bash to wait for any process to finish? We use " wait" only for the child processes to finish. I would like to know if there is any way to wait for any process to finish before proceeding in any script. A mechanical way to do this is as follows but I would like to know if there is any built in feature in...

pre-apend to a text file

I want to pre-append some text a a CSV file that is created by MySQL. Basically I want to add the header information for the rows so when the user opens it in Excel they know what each column is. Whats the best way to do this. I presume there is some easy linux command that can do this? I can also do it in the PHP script. I'd li...

jQuery won't replace anymore after the first time

As an easter egg for a part of one of my sites, I have in my footer #left tag a "Easter" egg that changes each time you click it, revealing funny messages: $('#left').append(" <span><a href='#' id='dontclick1'>Don't click.</a></span>"); // time for some fun $('#dontclick1').click(function() { $('#left span').html("<a href='#' id='dontc...

Why does using a pipe not work in powershell?

I'm trying to execute the following line: exit | sqlplus username/password@sid @test.sql Works great from cmd but in powershell I get "An empty pipe element is not permitted" Why is this and how do I fix it? ...

How do I include a PHP script in Python?

I have a PHP script (news-generator.php) which, when I include it, grabs a bunch of news items and prints them. Right now, I'm using Python for my website (CGI). When I was using PHP, I used something like this on the "News" page: <?php print("<h1>News and Updates</h1>"); include("news-generator.php"); print("</body>"); ?> (I cut down...

Inserting Colons into a list of Mac Addresses

I have over 500 MAC addresses and I'm trying to find a simple way to insert colons between every 2 characters. ...

Using batch file to create IIS Virtual Directory from config file

I am creating an automatic deployment script and need to create an IIS Virtual Directory from the configuration file which is created when you Right-Click the virtual directory and select "All Tasks > Save Configuration to a File" I have done some reading and know there is a script included with Microsoft Windows Server called "IISVDI...