command-line

Running c++ from Java problem

Hi Guys I need to compile and run a c++ program from java. I am using Process a = Runtime.getRuntime().exec ("g++ -g function.cpp -o function"); Process b = Runtime.getRuntime().exec ("./function"); the problem is that the output I get from the c++ program is not correct but If I compile and run it myself in the command line it works ...

Best practices in scheduling PHP scripts

Hi, For a project I need to schedule several PHP scripts. Some of the scripts are a bit complicated (ie. send mail, do database stuff, use several external webservices, use external files and classes etc). The problem is that these scripts also need to be called from the browser, and they do use some of the variables in the $_SERVER arr...

LDAP: Can't Bind for successful connection

I am trying to test a connection to AD using OpenLDAP and this is what I try on the commandline: /usr/bin/ldapsearch -h names.myorg.com \ -p 389 \ -D "cn=conapps readonly,cn=users,dc=myorg,dc=com" \ -LLL \ -x \ -b "ou=MyOrg Staff,ou=People,dc=myorg,dc=com" \ -s sub "(objectClass=*)" DN sn givenName mail userPrinc...

Consuming bandwidth

Dear Community, I know how to write a basic bash script which uses wget to download a file, but how do I run this in an endless loop to download the specified file, delete it when the download is complete, then download it again. ...

How to use xcopy to copy a file into a non existing directory?

As a part of an automated script, I am trying to do achieve something like this in windows command prompt: xcopy /I /Y resources\xyz\pqrs.txt %TEMP%\resources\xyz\pqrs.txt.bak In %TEMP%, there is no resources directory. This is the interactive output, that I get: Does C:\Users\username\AppData\Local\Temp\resources\xyz\pqrs.txt.bak ...

Android: How to debug core apps like Settings

How do I build and debug the cores apps in Android source tree, like AlarmClock and Settings, located under: ${ROOT}/packages/apps? ...

how to execute dos command with options in java

Hi All, I want to execute dos based external command through java program if there there is any way please help me ...

Run a terminal command and saving the values returned using Python/Django?

Hi all, I have a question regarding the use of Python. How do i run a command line command using Python? And after running the command, how do i save the returned values? For example: user@home:~$: ls -l drwxr-xr-x 3 root root 4096 ..[etc] home -rw-r--r-- 1 user user 357 ..[etc] examples.doc So what i intend to do, is to run the co...

Pretty hg branch graphs

With hg, how I can see in command line the branches graphs? Similar to git log --pretty=oneline --graph ...

How can I determine if my process is being run interactively?

Is there a standard(ish) POSIX way of determining if my process (I’m writing this as a Ruby script right now; but I’m curious for multiple environments, including Node.js and ISO C command-line applications) is being run in an interactive terminal, as opposed to, say, cron, or execution from another tool, or… so on and so forth. Specifi...

grep -v and -B|-A|-C not working together

I need to scan the output of iostat -En on a Solaris machine such that when a disk with errors is found, two lines about that disk are sent to the final output. This works fine so far using iostat -En | grep 'Errors: [1-9]' -A 1 but when I try to not include CD/DVD devices, I hit a wall. The contaxt flags (-A|B|C) don't seem to work w...

Add bookmarklets to firefox in command line

Hi I'm trying to add bookmarklets to firefox from the command line. I'm editing bookmarks.html to insert the proper bookmarks but it doesn't seem to give me the proper result (the file is edited but the bookmarklets don't appear). Can you help? cd ~/.mozilla/firefox/*.default lineNum=`grep -n -A10 PERSONAL_TOOLBAR_FOLDER bookmarks.htm...

WMI and getting CommandLine of running Process in VB.net

This is the command line I want to use inside my VB.NET program. Look for the running process "mpc-hc.exe" and get the commandline of the running process wmic process where name='mpc-hc.exe' get CommandLine I want to retrieve the output from that command into a string. I know that it could be done natively in a VB.NET program and I ha...

media site design considerations with multiple ways to invoke site functionality

My mate and I are designing/implementing a web based media application. It will provide media management and distribution abilities. Long story short, as much as we want a web based GUI for users to be able to perform site functionality (CRUD) and also have an administration area to control various aspects of users there is another c...

Calling a python script from command line with out typing python first

Question: In command line, how do I call a python script with out having to type "python" before the script? is this even possible? Info: I wrote a handy script for accessing sqlite databases from command line, but I kind of don't like having to type "python SQLsap args" and would rather just type "SQLsap args". I don't know if this ...

Is it possible to use output redirections from a cmd file using start?

I want to have a cmd file with something like: :one start /wait (blabla1.exe -q -m 1>blabla1.log 2>&1) :two start /wait (blabla2.exe -q -m 1>blabla2.log 2>&1) where I want the output of the blabla application not the output of the start command. Is it even possible to have the redirections "local" inside the start command? Do I...

How to configure firefox over command line on a linux machine

I use two Internet connections so i want to use bash scripts to automate the task of switching between the two.. the problem is i cant able to configure firefox proxy settings via scripts, so is there a way to do that... does any configuration file exists for firefox so that i can modify over command line.. I have read this entry but th...

How to Count number of lines of javascript in php files?

I need to count the no. of lines of inline java script between script tags in php files. How do I do it? Will grep linux command suffice or I can get some tool to do it? Please help. ...

Silent Administrative Install - Specifying an installation directory

Hi, I'm currently trying to add some testing functionality into our builds, and in order to do this I need to be able to perform an administrative install, silently. However, I need to be able to specify the location that it installs too, as the default is on the company-wide network which is no use. I was wondering if there was a way ...

Building and code signing an iPhone Application from the command line.

I want to make my iPhone Apps in Emacs now, so without using Xcode at all. How can I build and codesign my app from the command line (even through SSH)? I can't use xcodebuild as there is no Xcode project. Are there any tutorials which cover this? I want to compile them with GCC, and as soon as Developer Tools 4.0 come out, I want to co...