scripting

BASH script passing stdin input to a program and giving control back to user input

(I looked everywhere for this, perhaps my googling skill is off today) I have a program that requires a handful of initialization cmds from stdin (and not through arguments). It'd be nice to move those commands into a script so when the script completes I can start keying the real work. So something like: cat initcmds.txt | myprogram.e...

how to generate sql script file from C# codebehind?

Hi all, How to generate sql script file from C# codebehind? The script file will contain create and drop statement of a storedproc in the db. How to generate the script from db in C# and write to an .sql file? Is it possible to generate script of create and drop statement of table or storedproc from db in C# Please help. ...

How to retrieve create statement for table from db in C#

Hi all, How to retrieve create statement for table from db in C#? I need to create a script file containing create statement for an existing table in db using C#. I can generate create statement of storedproc using sp_helptext but can't generate it for table. Please help. ...

Manipulating time in a batch file

Hi guys; I was wonderin' if someone would be able to help with this lil' batch file here. I'm trying to check when the last successful Windows Update was . Here is the code here .. @ECHO OFF SETLOCAL SET RegKey=HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion SET RegKey=%RegKey%\WindowsUpdate\Auto Update\Results\Install FOR /F "skip=1 tok...

Rotating 2D image/scriptable object in Google Earth (Is it possible?)

Is there a way to insert a 2D image into Google Earth which could then be rotated to always face the camera? It's done in Sketch-up with the man that stands there when you initially open a new scene. You can rotate your view around, but he will keep facing you until you look at him from the top, which then reviels that he is actually a ...

print entire directory of text files to printer with filename as header using bash or openoffice basic script

I want to print an entire directory of text files to a printer inserting the file name at the top of the first page of each file that is printed. A bash or openoffice script would serve me well. Thanks ...

add current/selected user to a group

Hi all can anyone tell me how can I (programatically) add the current/selected user to a group (like power user, backup opetarors) any function/info/code is welcomed ...

Allow user-defined script in Ruby/Rails application

A predefined set of objects has to be aggregated into a new object. However I want the users to specify a custom function for that. Now the naive approach would be def foo; end objects = [1,2,3] # result = eval(user_script) result = eval("objects.inject {|sum, n| sum + n }") What I obviously do not want to do! I read about $SAFE = 4...

how do i source .bashrc remotely

I'm currently writing a script to set some PATH in a remote machine using ssh. I have successfully set the variables in the .bashrc. However, it the last step of my script is "source .bashrc". However, when i ssh to the machine manually, the PATH is still not set. What is the problem? ...

Connected to mysql instance ONCE or TWICE?

Hello there, I was wondering whether the following command (from a .bat script): (1) connects to the mysql instance once and then executes script#1 followed by script#2, or (2) does it reconnect for each of the sql scripts? mysql -B -b -h%HOST% -u%USER% -p%PASSWORD% %SCHEMA% < "scripts\create_and_populate.sql" < "scripts\update_joomla_...

What are the graphics editors that can be built upon?

I want to start off with a capable vector graphics drawing/editing program and extend it to create a visual designer for a project I'm working on. Do you know of a graphics editor that can be built upon? Maybe open source? Users should already be able to freely draw and color graphics, and any form of grouping / arranging elements is a...

Running a jar from shell script

Hello friends I have a jar file named umar.jar in /root/umar/bin directory. I have a shell script file run.sh in same directory. Following is the content of run.sh #!/bin/bash "$JAVA_HOME"/bin/java -jar /root/umar/bin/umar.jar Now when I run the shell script, I get the following error Exception in thread "main" java.lang.Unsupported...

Enabling cross domain scripting in the intranet

Hi, I'm having a few problems with an application that integrates sharepoint, SQL reporting services and a bunch of custom forms that are built using ASP.NET MVC. Assuming my servers are as follows; MOSS SSRS Custom forms In MOSS, my portal has need on occassion to popup a custom form to capture user input. I've done this by using ...

PHP Comand line script to create user passwd

hey all, I'm very new to linux and php so forgive me if this is a dumb question. I need to create a php command line script that will add a user to the system, to be used by the ftp server. I have it set up at this point that it creates the account just fine. The problem I'm facing is that even though I pass through the password when I ...

using java scripting API to find and destroy bad/malicious java script code

I am working on a servlet (runs on tomcat) which receives requests that contains Java Script code, and using the java scripting API framework evaluates/run the code and returns the answer to the user. Since we are dealing with user generated code, the code can be a good code and it can be bad code. As an example for a bad code can be wh...

linux based submission script for CS student source code

I'm in the late stages of developing a Linux based computing lab for CS students at my university. In my undergraduate days I remember being able to submit my homework assignments with a command like: submit [classname] [projectname] [source files] which would then copy all my files to a directory students couldn't access but the inst...

java scripting API - how to stop the evaluation

hi, i have writen a servlet that recives a java script code and process it and returns the answer. for that i have used the java scripting API in the code below if script = "print('Hello, World')"; the code will end properly print "hello world". but if script = "while(true);" the script will loop endlessly. import javax.script.*; pub...

I'm finding rogue code included in my HTML page head -- how did it get there and how do I stop it?

My major weakness is securing my sites -- I know, a bad weakness. I have a site now that when I view the source in Firebug, I'm seeing all kinds of scripts with the src of http://mylocksmithusa.com/sitebuilder/acura2002.php -- but they're not in my files that I can find. How did they get there, how can I find them, how can I remove them...

JQuery-code on different content pages

Hello, I have a site with menu, which reloads content. Content is dynamically loadable, using ajax and php-script. At different content pages I need in different jquery-plugins. But If I'm writing including need plugin directly in some content page, I get a big lags during loading. So, now I'm includgin all plugins into main page... And ...

How to make a python script run like a service or daemon in linux

I have written a python script that checks a certain e-mail address and passes new e-mails to an external program. How can I get this script to execute 24/7, such as turning it into daemon or service in linux. Anyone that answers this, would I also need a loop that never ends in the program, or can it be done by just having the code re...