scripting

List of useful git tools

Reading SO I still find nice, new tools for using with git. If you know any, please share it answering this question. My first proposal is: gitolite, a tool for managing access to git repositories, which is an newer version of gitosis. (Please post one tool for an answer, with short description, so we could easily comment them). So: ...

Msi: Can dword values in Registry Table expressed in hexadecimal number?

Preceding registry value data by a number-sign (#) causes the value interpreted as a dword in decimal number. This is OK and I have no problem with it. I'm just curious, is there a way to express it in a hexadecimal number. Thanks in advance. ...

Purpose of line : source ~oracle/.bash_profile in shell script

While executing a shell script involving database connection, my script showed me an Error :sqlplus not found : sqlplus -s username/paswd@DB_name > /home/user/sql.out << EOF But when i included the following statement, it started to work: source ~oracle/.bash_profile What is the purpose of this above line ? ...

xargs with command that open editor leaves shell in weird state

Hey guys, I tried to make an alias for committing several different git projects. I tried something like cat projectPaths | \ xargs -I project git --git-dir=project/.git --work-tree=project commit -a where projectPaths is a file containing the paths to all the projects I want to commit. This seems to work for the most part, firing...

Closing IActiveScript engine throws E_UNEXPECTED exception

Working with C# in .NET, I am trying to call IActiveScript.Close on my instance of the Windows Scripting host. Since I am currently hunting memory leaks, I discovered that I did not call this Close method and tried to add the missing code. So I added a call to the Closemethod. Unfortunately, when calling the Close method, a COM excepti...

Autoit with FF.au3 and Mozrepl How would I close all tabs in firefox using _FFClosetab() ?

I'm using Firefox 3.6 and I think that there may be a compatibility issue with the Autoit script using #include FF.au3 and Mozrepl to close all of Firefox's open tabs with the addon TMP-TabMixPlus 0.3.8.4 installed. Below is the script I'm using and I would like to add something like this _FFTabClose("all", "index") I can't make it work!...

Redirecting standard output to a file containing the pid of the logging process

I've searched for a while but i can't either find an answer or come up with a solution of my own, so I turn to you guys. First question I actually ask here :) I would like to run several instances of the same program, and redirect each of these programs' standard output to a file that contains that same process' pid, something like: my...

Redirecting standard output to a file containing the pid of the logging process

I've searched for a while but i can't either find an answer or come up with a solution of my own, so I turn to you guys. First question I actually ask here :) I would like to run several instances of the same program, and redirect each of these programs' standard output to a file that contains that same process' pid, something like: my...

PHP as embedded scripting language

I have gotten Lua scripting in C# working via LuaInterface, and javascript scripting working via JInt. The goal is to support a wide variety of scripting language options. Is there any similar method to run embedded PHP scripts in a similar way? I.E., have a PHP script in a string, pass it to either the PHP command line or an interprete...

VBA: How to get the last used cell by VBA code when the last error occured in a Workbook/Worksheet?

I think the title says it all. Eventually, I want to move the cell to the location where the last error occured. Edit: Forgot to say that I'm using Excel 2003. ...

with sequential calls to $R CMD or $R --vanilla, do I have to reload libraries in each R script?

I would like to run a sequence of R scripts from the bash command line. Can I keep the R session 'open' between calls? Or do I have to save and load objects and re-load the libraries in each script? Thanks in advance ...

How to split commits automatically into different branches?

For my school projects, I was used to have one big repo with several subdirectories for the specific projects. Because I had no time, I always commited anything into the master branch. The problem is, that this turns out to be unpracticable, as it becomes more and more difficult to revert older commits or figuring out which commit belon...

If grep fails delete the file

Heya guys, I have this small script and i need to grep all the files and leave only the ones that contain a keyword and I'm stuck on this, any help in pointing out my dumb errors is appreciated :) #!/bin/bash server=(server1...server24) . . . for ((n=0; n <= 24 ; n++)) do if grep -q "KEYWORD" directory/${server[$n]}.html ; th...

The number of processes a user is running using bash

Hi, I would like to know how I could get the number of processes for each user that is currently logged in. Thank you. ...

Is it possible to update Google Analytics Ecommerce data?

We're using Google Analytics to track ecommerce transactions on our website ( _trackTrans() ). However, We often have cases where the final value of an order is not known until well after the user has left the site. It would be nice to be able to update the transaction items / amounts in an offline process we could run periodically. ...

How to script Firefox or any Mozilla based browser

I need to automate something like this: Open an URL Wait until the page is fully loaded Save COMPLETE page as... (I can provide a name). I saw https://developer.mozilla.org/en/Command_Line_Options but I can't find an option to invoke the command "save page as... (in mode Web page complete)". So I can have all css, js, xml and related...

GIMP - Scripting a canvas resize

Hello all, Just started using GIMP today. When I resize the canvas manually in GIMP (so that it's smaller than the image size) it lets me move the image around so that I can "change" the viewable area. How do I replicate this in a script? In other words, I want the script to pause at the canvas resizing step and let me position the imag...

VBA: How to display a cell value by its defined name?

I have already a defined name for a particular column in my worksheet. How to display a cell value by its defined name? I've tried these: Public Sub Test() Dim R As Range Set R = ThisWorkbook.Names("SomeName").RefersToRange MsgBox CStr(R.Value) End Sub but run-time error occured "Type Mismatch" (error code: 13). What...

Trouble nesting expressions in UNIX.

I have the following UNIX statement: #!/bin/bash $x=$((grep ^'[a-z]' $1 | wc -l)) echo "$x" However, I'm getting an error message relating to a missing operand whenever I try to run the script. Is there any way to assign a variable a value like so in UNIX? EDIT: Well, it became clear to me that grep cannot seem to examine single wor...

Insert text between two marker lines in bash

I have some lines stored in a text file called bashrc_snippet. I would like to insert them into .bashrc. Since I sometimes change the contents of the text file I would like to be able to re-insert them in the .bashrc-file. To do this I want to use marker lines: # User things HISTSIZE=1000 #START alias ls='ls --color=tty' ... some more ...