scripting

Website Link Injection

I have a website that is fairly static. It has some forms on it to send in contact information, mailing list submissions, etc. Perhaps hours/days after an upload to the site I found that the main index page had new code in it that I had not placed there that contained a hidden bunch of links in a invisible div. I have the following code...

How can I calculate the position of a DOM element from Google Chrome content scripts.

Hi, I am writing a chrome extension and from the content script I want to calculate the absolute position of a DOM element. But from within content script, if i try to access offsetHeight, offsetWidth, offsetTop, offsetParent, etc, I get null. I guess content scripts don't have access to those DOM properties. Is there a way/workaround, ...

Which language to use for scripting PostgreSQL?

I am about to embark on a PostgreSQL project for a client. They want to develop a huge professional database with many complex joins, so after consideration I have chosen to go with PostgreSQL over MySQL. An important consideration is how to effectively interface to the database with scripts. Currently, the client uses about a million s...

Encrypting Scripts for Embedding in Text Files

I'm working on a closed-source game that uses a scripting language for automation. Almost all of the game logic is handled by scripts. Scripts can be compiled to a bytecode format, but due to the nature of the language, identifiers must be preserved. Compiled scripts can be embedded in other text-based resource formats using a binary-to-...

PHP5 tier based authorization script?

Are there any PHP login scripts around that I can learn from? I want to have a control panel that shows different options to different users depending on level of privilege. ...

Webapp update shell script

I feel silly asking this... I am not an expert on shell scripting, but I am finally in enough of a sysadmin role that I want to do this correctly. I have a production server that hosts a webapp. Here is my routine. 1 - ssh to server 2 - cd django_src/django_apps/team_proj 3 - svn update 4 - sudo /etc/init.d/apache2 restart 5 - logout ...

What do you think of a language dedicated to Linux admin and pen testing?

Hi all, I've recently started developing a new scripting language. It uses a single interpreter and so far works pretty well. It's a mixture of C, C#, Ruby, Python, Perl and even some PHP. Normally I wouldn't have bothered with such an idea, but to make pen testing and linux administration easier I just had to. All of the above language...

Cron job, execute php script

Hello I want to run a php script every morning, the script would send a mail. But the mail I get from cron always contains an error message. Can anybody help? ...

VIM 7.2 Scripting problem with `:perldo` and multiple expressions

Background task To eliminate X-Y problems I'll say what I'm doing: I'm trying to use :perldo in VIM 7.2 to complete two tasks: Clear all trailing whitespace, including (clearing not deleting) lines that only have whitespace s/\s+$//; Remove non-tab whitespace that exists before the first-non space character s/^ (\s*) (?=\S) / s#[^\...

OSX: Get application windows + bounds

Is there a way to get the list of windows from another application and their bounds. E.g. using F-Script or obj-c or any other way (except AppleScript) to access the window contents of another (any other) Cocoa-based application and possibly modify it? I am talking about 1) accessing the data (as http://the.layersapp.com/ does) and 2) ...

shell script running by sensing a file

Hi, i am working on unix. i want to write a shell script which will check for a file called "temp_file.txt" on windows and then execute some commands. is this possible? how could we connect to the windows and go to a specific directory and check for a file? ...

How can I remove SVN directories after a confirmation prompt?

Hello, I want to be able to remove the .SVN folders from a directory. I found the following registry hack that will allow you to do just that... http://weblogs.asp.net/jgalloway/archive/2007/02/24/shell-command-remove-svn-folders.aspx However, the one thing I don't like about this solution is that it gives NO CONFIRMATION at all. I ...

Dos scripting - how to get a silent if but display the commands being called.

Script Example: @SET APPLY_ORA=YES @REM ... IF %APPLY_ORA%==YES ( @ECHO Doing Oracle CALL %SOME_ORACLE_SPECIFIC_COMMAND% %SOME_ORACLE_SPECIFIC_FLAGS% CALL %ANOTHER_ORACLE_SPECIFIC_COMMAND% %SOME_ORACLE_SPECIFIC_FLAGS% ) ELSE ( @ECHO Skipping Oracle ) The idea is that I do not want to see IF YES==YES ( ) ELSE ( ) printed, particularly...

XCode Macros for iPhone

Anybody have any good pointers on how to be able to, say, highlight a ivar in a class and hit a keystroke and insert the property and synthesize lines into my code in the proper places? I have been doing this for awhile now and typing that boilerplate stuff is getting on my nerves at times. ...

javascript restricting???

is it possible to restrict javascript libraries from being able to manipulate the dom? im trying to create a system that has a main system with the api which will be able to manipulate the dom and then i want to give the ability to create third party scripts but have them limited to only the api functions. ...

Arrow keys don't work in irb/ruby command line scripts?

While using gets to accept user input, pressing the arrow keys outputs text to the screen, presumably the character codes. How can I prevent this from happening, and further how can I get the arrow keys to properly move the cursor around? irb(main):001:0> foo = gets ^[[A^[[D^[[B^[[C => "\e[A\e[D\e[B\e[C\n" Edit: maybe I should men...

Can a single script be used for two or more Anchor button clicks?

In my page there are two 'Conatct Selected' anchor button, one at the top having id as "selectAllLink" and other at the bottom having id as "selectAllLinkB" of the page. The top one working perfectly using the following script: <script type="text/javascript"> $(function() { $('#selectAllLink').each(function() { var a = []; ...

How to spawn several processes from the Windows shell and wait for them all to complete?

Hi, i want to do the following from a Windows batch script: start proc1.exe start proc2.exe ... start procN.exe <wait for all N processes to complete> <-- What do i put here? So how do i wait for all spawned processes to complete? TIA. ...

Copy folder recursively, excluding some folders

I am trying to write a simple bash script that will copy the entire contents of a folder including hidden files and folders into another folder, but I want to exclude certain specific folders. How could I achieve this? ...

Best way to copy and duplicate each line of input file while regex modifying the duplicated line.

This question has 2 sections one for "single line match" and one for "multi line region matching" Also, I have a semi working solution, I want to find more robustness and elegance in my solution. Single Line Match: I would like to duplicate each line of an input file such that the second line was a regex modification of the first: E.G...