8
голосов
7ответов
9285 просмотров

java scripting API - how to stop the evaluation

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 en...

1
голосов
3ответов
557 просмотров

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 co...

1
голосов
3ответов
1862 просмотров

Command line script to create user passwd

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 ...

1
голосов
3ответов
3609 просмотров

Enabling cross domain scripting in the intranet

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...

2
голосов
3ответов
56646 просмотров

Running a jar from shell script

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 "...

2
голосов
1ответов
84 просмотров

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 ...

0
голосов
2ответов
65 просмотров

Connected to mysql instance ONCE or TWICE?

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_populat...

1
голосов
1ответов
716 просмотров

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?

2
голосов
2ответов
263 просмотров

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...

1
голосов
3ответов
906 просмотров

add current/selected user to a group

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

0
голосов
1ответов
465 просмотров

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

0
голосов
1ответов
396 просмотров

Manipulating time in a batch file

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\R...

0
голосов
2ответов
299 просмотров

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

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.

2
голосов
5ответов
13060 просмотров

how to generate sql script file from C# codebehind?

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...

2
голосов
1ответов
4924 просмотров

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 somet...

0
голосов
1ответов
251 просмотров

Advice for embedding a Java scripting language for debugging/remote admin

I have a fairly sophisticated server-side application which frequently requires me to see what is going on with its internals to debug and fix problems. I've therefore embedded a Beanshell instance, which I can telnet into (normally over a ssh tunnel), but I'm wondering if there is a better way....

42
голосов
7ответов
26297 просмотров

git: a quick command to go to root of the working tree

I wanted a simple git command to go up to the "root" of the repository. I started with a script, but figured that I cannot change active directory of the shell, I had to do a function. Unfortunately, I cannot call it directly with the non-dash form "git root", for instance. function git-root() ...

7
голосов
3ответов
2793 просмотров

Is the Perl .plx filename extension ever used in real-life?

ActiveState Perl installs an IIS script mapping for the extension .plx. Is this actually used in real life or just something specific to ActiveState?

1
голосов
1ответов
118 просмотров

How can I embed arguments in an awk script?

This is the evolution of these two questions, here, and here. For mine own learning, I'm trying to accomplish two (more) things with the code below: Instead of invoking my script with # myscript -F "," file_to_process, how can I fold in the '-F ","' part into the script itself? How can I in...

0
голосов
2ответов
856 просмотров

Checking JS variable value in another <script> block</script>

I have a site built with simple templates; header.tpl, navigation.tpl, body_home.tpl, body_about.tpl, body_anotherpage.tpl, etc. The navigation.tpl contains jQuery and is used to dynamically build a drop down navigation menu. When an element is clicked on the first drop down menu, the next is bui...

6
голосов
5ответов
15053 просмотров

BASH scripts : whiptail file select

I've found a great little program that will allow me to add user friendly GUI's to my Bash Scripts; whiptail However the whiptail man page isn't all that helpful and doesn't provide any examples. After doing some google searches I understand how to create a simple yes/no menu using whiptail: #! ...

4
голосов
1ответов
212 просмотров

Is it possible to have a Vim syntax file command span multiple lines?

I'm trying to create a syntax file and I want to create some keyword groups for different colour highlighting (e.g. reserved words, operators etc. would be different colours). I can get this to work by doing one of the following two options: Option 1 syn keyword MyLangOperators operator1 operat...

11
голосов
2ответов
15716 просмотров

Can I run a script in an Eclipse run configuration?

My company has traditionally used a Linux command line development environment. We use a script to manage the PATH and LD_LIBRARY_PATH environment variables when compiling and running. This script is called by adding it to the beginning of a command, like this: sbs make sbs ../bin/foo.exe I ...

0
голосов
2ответов
310 просмотров

script,unix,compare

I have two files ... file1: 002009092312291100098420090922111 010555101070002956200453T+00001190.81+00001295.920010.87P 010555101070002956200449J+00003128.85+00003693.90+00003128 010555101070002956200176H+00000281.14+00000300.32+00000281 file2: 002009092410521000098420090709111 0105604585200...

5
голосов
7ответов
315 просмотров

Is there a C# tool that will let me execute an arbitrary block of code?

I'm sure something like this exists, but I can't for the life of me remember what it is called. I'm looking for an app where I can just execute an arbitrary block of C# code and see any console output.

7
голосов
6ответов
17168 просмотров

Preserving whitespaces in a string as a command line argument

I'm facing a small problem here, I want to pass a string containing whitespaces , to another program such that the whole string is treated as a command line argument. In short I want to execute a command of the following structure through a bash shell script: command_name -a arg1 -b arg2 -c "arg...

0
голосов
2ответов
681 просмотров

I found this Reboot Vista.vbs script. Can you help with it?

Found this Reboot Vista.vbs script on a number of forums. Seems like the whole post ( text including the code ) was posted on many forums. So I don't know who the original author is. Heres the code here: Option Explicit On Error Resume Next Dim Wsh, Time1, Time2, Result, PathFile, MsgResult, Msg...

-2
голосов
2ответов
3502 просмотров

application/force-download

I'm creating a script to only upload zip files and I have the following validation allready: if($itemtype != "application/x-zip-compressed" &amp;&amp; $itemtype != "application/zip" &amp;&amp; $itemtype != "application/octet-stream") { throw new exception("Your file should be a zip file!");...

0
голосов
3ответов
69 просмотров

long running scripts and open text documents

When using a long running script which writes to an open text files, say for logging, which is the better approach: open a file, write to it as needed, and then close when done? Or open the file, write to it, and immediately close it every time? I can see advantages and disadvantages to both. Any...

0
голосов
1ответов
1731 просмотров

How to automatically get from daily e-mail attachment to script-processed file?

Background: Every work day I get an e-mail from a vendor who sends me a CSV file as an attachment. The CSV file needs to be converted into HTML and I already have a script that does that. The problem is, I have to manually open my e-mail, save the attachment to my hard drive and then run the scr...