Search Results

Search found 6758 results on 271 pages for 'shell exec'.

Page 55/271 | < Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >

  • Unable to save to wincache from cakePHP shell

    - by Phillaf
    I'm trying to retrieve the weather from wunderground.com through their API, and store it in wincache. For testing purposes I made this function in the News model: public function updateWeather(){ $results = file_get_contents('http://api.wunderground.com/api/**api_key**/conditions/q/CA/Montreal.json'); $results = json_decode($results); return Cache::write('weather', $results); } It works fine when I call this from the controller. However, I can't figure why that same function doesn't work when called from the console. I made this shell in order to eventually add this to windows task scheduler. class WeatherShell extends AppShell { public $uses = array('News'); public function main() { $this->News->updateWeather(); } } When running this, I see that $results is correctly populated. I get 'true' from Cache::write(), however, I get 'false' when trying to read. What subtlety am I missing?

    Read the article

  • Google App Engine - Help with running python shell comands from aptanna studio

    - by spidee
    Hi I'm somewhat of a newbie to python and I'm using app engine and aptanna studio - I need to run some python shell commands so that i can complete the tasks in this Tutorial on how to set up 118 and django. I have got this all working but i don't understand how i run the python commands to compile the dictionarys such as $ PYTHONPATH=/path/to/googleappengine/python/lib/django/ /path/to/googleappengine/python/lib/django/django/bin/make-messages.py -a To be honest - why am i saying that! I dont know where in aptanna studio i run this command -then worse I don't quite understand what exactly i type based on the above command line. My path to google app engine is D:\Program Files\Google\google_appengine\ Can anyone help shed some light on how i do this from aptanna / the root of my project?? Im following this Tutorial: http://makeyjl.blogspot.com/2009/02/using-djangos-i18n-in-google-app-engine.html

    Read the article

  • yiic shell: failed to perform 'crud'

    - by ufw
    Debian Squeeze, PHP 5.3.2-1, Yii 1.1.2, PHP $path to php is /usr/bin/php, permissions are '777'. When I try to run 'crud Test' in yii shell, I get the following error message: PHP Warning: include(/var/www/test/protected/models/Test.php): failed to open stream: No such file or directory in /var/www/yii/framework/YiiBase.php on line 335 PHP Warning: include(): Failed opening '/var/www/test/protected/models/Test.php' for inclusion (include_path='.:/var/www/test/protected/components:/var/www/test/protected/models:/usr/share/php:/usr/share/pear') in /var/www/yii/framework/YiiBase.php on line 335 PHP Fatal error: Class 'Test' not found in /var/www/yii/framework/db/ar/CActiveRecord.php on line 341

    Read the article

  • How can I check the mysql connection for a user/password using batch/shell script

    - by machaa
    Hi, How can I check the mysql connection for a user/password using batch/shell script? I've user name and password, and I need to authenticate whether they are correct or not, but how? I tried this way: I've created a batch file "run.bat" with "mysql -u User--password=UserPassword < commands.sql" "commands.sql" file contains "\q" When I run the file "run.bat" the output is nothing when User/Password are correct and "ERROR 1045 (28000): Access denied for user ... " when User/Password are incorrect. Now can we capture this output, and decide whether the connection is successful or not, if yes how? Regards

    Read the article

  • Converting "User Shell Folders" registry value

    - by Sach
    The following registry key contains many system default folder locations. HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders The value for the path of the All Users desktop, which is found there, is as follows: XP or earlier : [%ALLUSERSPROFILE%\Desktop] Vista or later: [%PUBLIC%\Desktop] Whereas the actual paths of the All User desktops, respectively, are as follows: XP or earlier : "C:\Documents and Settings\All Users\Desktop" Vista or later: "C:\Users\Public\Desktop" Now, if you use copy and paste the above registry values in Windows Explorer and hit enter it takes you to the actual folders. For example, if you paste [%PUBLIC%\Desktop] in a Windows Explorer in Vista it takes you to ["C:\Users\Public\Desktop"]. My question is this; how do I reproduce this behavior from withing a C# program? To be more specific, if I retrieve the registry value [%PUBLIC%\Desktop] from withing a C# program, which I can do easily, how do I convert it to ["C:\Users\Public\Desktop"]? Obviously I'm not looking for a string replacement, I need to do what Windows does.

    Read the article

  • Calling consecutive java tasks in a shell script

    - by Bigtwinz
    Hi all, This may be a rudimentary question but the answer was not readily available. I'd like to create a shell script that calls 3 tasks consecutively, but wait till the previous task is complete. Like so: a. call first Java program via ant b. call third party Java application c. call third Java program via ant I'm wondering if there is a way to check and ensure a. is done before b. is called and same for b. and c. thanks

    Read the article

  • Counting unique values in a column with a shell script

    - by Lilly Tooner
    Hello. I have a tab delimited file with 5 columns and need to retrieve a count of just the number of unique lines from column 2. I would normally do this with Perl/Python but I am forced to use the shell for this one. I have successfully in the past used *nix uniq function piped to wc but it looks like I am going to have to use awk in here. Any advice would be greatly appreciated. (I have asked a similar question previously about column checks using awk but this is a little different and I wanted to separate it so if someone in the future has this question this will be here) Many many thanks! Lilly

    Read the article

  • Shell Prompt Line Wrapping Issue

    - by Rob
    I've done something to break my Bash Shell Prompt in OS X (10.5.7) Terminal. This is the PS1 that I had configured: PS1='\[\e[1;32m\]\h\[\e[0m\]:\[\e[1;34m\]\w\[\e[0m\]\$ ' As far as I can tell I have the color commands escaping correctly. However when I scroll up and down in my command history I often get line wrapping issues if the historic commands wrap onto multiple lines. I simplified my prompts to the following: PS1='\[\e[1m\]\h:\w\$ \[\e[0m\]' PS2='> ' And I still see something like: localhost:~/Library/Application Support/Firefox/Profiles/knpmxpup.Defau lt/extensions/{1A2D0EC4-75F5-4c91-89C4-3656F6E44B68}$ expocd \{1A2D0EC4-7 5F5-4c91-89C4-3656F6E export PS1="\[ \e[1;32m\]\h\[\e[0m\]: cd Library/Appl ication\ Support/ I've also tried \033 instead of \e. I just included PS2 up there for information, I haven't changed that from the install default. If I completely remove the color codes then everything works fine, any ideas?

    Read the article

  • Using popen() to invoke a shell command?

    - by Anvar
    When running the following code through xcode I get inconsistent behavior. Sometimes it prints the git version correctly, other times it doesn't print anything. The return code from the shell command is always 0 though. Any ideas on why this might be? What am I doing wrong? #define BUFFER_SIZE 256 int main (int argc, const char * argv[]) { FILE *fpipe; char *command="/opt/local/bin/git --version"; char line[BUFFER_SIZE]; if ( !(fpipe = (FILE*)popen(command, "r")) ) { // If fpipe is NULL perror("Problems with pipe"); exit(1); } while ( fgets( line, sizeof(char) * BUFFER_SIZE, fpipe)) { // Inconsistent (happens sometimes) printf("READING LINE"); printf("%s", line); } int status = pclose(fpipe); if (status != 0) { // Never happens printf("Strange error code: %d", status); } return 0; }

    Read the article

  • Shell job control

    - by user1535672
    For my school project I am implementing a shell and I need help with job control. If we type a command, say cat &, then because of the & it should run in background, but it's not working. I have this code: { int pid; int status; pid = fork(); if (pid == 0) { fprintf(stderr, "Child Job pid = %d\n", getpid()); execvp(arg1, arg2); } pid=getpid(); fprintf(stderr, "Child Job pid is = %d\n", getpid()); waitpid(pid, &status, 0); }

    Read the article

  • Cocoa: Using UNIX based commands to write a file

    - by BryCry
    I'm looking for help with a program im making. I create a *.sh file as follows: SVN_StatGenAppDelegate.h: NSWindow *window; NSTask *touch; NSArray *touchArguments; NSString *svnURLStr; NSString *SVNStatStr; NSString *destDirStr; SVN_StatGenApplDelegate.m: NSString *locationStr = [NSString stringWithFormat:@"%@/exec.sh", destDirStr]; NSLog(@"%@", locationStr); touch = [[NSTask alloc] init]; [touch setLaunchPath:@"/usr/bin/touch"]; touchArguments = [NSArray arrayWithObjects:locationStr, nil]; [touch setArguments:touchArguments]; [touch launch]; This works, i get a file called exec.sh created in the location i craete with the destDirStr. Now is my next question, i need to get that file filled with the following: svn co http://repo.com/svn/test C:\users\twan\desktop\pres\_temp cd C:\users\twan\desktop\pres\_temp svn log -v --xml > logfile.log copy C:\users\twan\desktop\statsvn.jar C:\users\twan\desktop\pres\_temp cd .. java -jar _temp\statsvn.jar C:\users\twan\desktop\pres\_temp/logfile.log C:\users\twan\desktop\pres\_temp rmdir /s /Q _temp The actual idea is that this script is written into the sh file, and all the _temp and other locations are replaced by the vars i get from textfields etc. so c:\users\twan\desktop\pres_temp would be a var called tempDirStr that i get from my inputfields. (i know these cmomands and locations are windows based, im doing this with a friend and he made a .net counterpart of the application. Can you guys help me out?:D thanks in advance!

    Read the article

  • Longer execution through Java shell than console?

    - by czuk
    I have a script in Python which do some computations. When I run this script in console it takes about 7 minutes to complete but when I run it thought Java shell it takes three times longer. I use following code to execute the script in Java: this.p = Runtime.getRuntime().exec("script.py --batch", envp); this.input = new BufferedReader(new InputStreamReader(p.getInputStream())); this.output = new BufferedWriter(new OutputStreamWriter(p.getOutputStream())); this.error = new BufferedReader(new InputStreamReader(p.getErrorStream())); Do you have any suggestion why the Python script runs three time longer in Java than in a console? update The computation goes as follow: Java sends data to the Python. Python reads the data. Python generates a decision tree --- this is a long operation. Python sends a confirmation that the tree is ready. Java receives the confirmation. Later there is a series of communications between Java and Python but it takes only several second.

    Read the article

  • Time to stop using &ldquo;Execute Package Task&rdquo;&ndash; a way to execute package in SSIS catalog taking advantage of the new project deployment model ,and the logging and reporting feature

    - by Kevin Shyr
    I set out to find a way to dynamically call package in SSIS 2012.  The following are 2 excellent blogs I found; I used them heavily.  The code below has some addition to parameter types and message types, but was made essentially derived entirely from the blogs. http://sqlblog.com/blogs/jamie_thomson/archive/2011/07/16/ssis-logging-in-denali.aspx http://www.ssistalk.com/2012/07/24/quick-tip-run-ssis-2012-packages-synchronously-and-other-execution-options/   The code: Every package will be called by a PackageController package.  The packageController is initialized with some information on which package to run and what information to pass in.   The following is the stored procedure called from the “Execute SQL Task”.  Here is the highlight of the stored procedure It takes in packageName, project name, and folder name (folder in SSIS project deployment to SSIS catalog) The stored procedure sets the package variables of the upcoming package execution Execute package in SSIS Catalog Get the status of the execution.  Also, if exists, get the error message’s message_id and store them in the management database. Return value to “Execute SQL Task” to manage failure properly CREATE PROCEDURE [AUDIT].[LaunchPackageExecutionInSSISCatalog]        @PackageName NVARCHAR(255)        , @ProjectFolder NVARCHAR(255)        , @ProjectName NVARCHAR(255)        , @AuditKey INT        , @DisableNotification BIT        , @PackageExecutionLogID INT AS BEGIN TRY        DECLARE @execution_id BIGINT = 0;        -- Create a package execution        EXEC [SSISDB].[catalog].[create_execution]                     @package_name=@PackageName,                     @execution_id=@execution_id OUTPUT,                     @folder_name=@ProjectFolder,                     @project_name=@ProjectName,                     @use32bitruntime=False;          UPDATE [AUDIT].[PackageInstanceExecutionLog] WITH(ROWLOCK)        SET [SSISCatalogExecutionID] = @execution_id        WHERE [PackageInstanceExecutionLogID] = @PackageExecutionLogID          -- this is to set the execution synchronized so that I can check the result in the end        EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=50,                     @parameter_name=N'SYNCHRONIZED',                     @parameter_value=1; -- true          /********************************************************         ********************************************************              Section: setting parameters                     Source table:  SSISDB.internal.object_parameters              object_type list:                     20: project level variables                     30: package level variables                     50: execution parameter         ********************************************************         ********************************************************/        EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=30,                     @parameter_name=N'FromParent_AuditKey',                     @parameter_value=@AuditKey; -- true          EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=30,                     @parameter_name=N'FromParent_DisableNotification',                     @parameter_value=@DisableNotification; -- true          EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=30,                     @parameter_name=N'FromParent_PackageInstanceExecutionID',                     @parameter_value=@PackageExecutionLogID; -- true        /********************************************************         ********************************************************              Section: setting variables END         ********************************************************         ********************************************************/            /* This section is carried over from example code           I don't see a reason to change them yet        */        -- Set our package parameters        EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=50,                     @parameter_name=N'DUMP_ON_EVENT',                     @parameter_value=1; -- true          EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=50,                     @parameter_name=N'DUMP_EVENT_CODE',                     @parameter_value=N'0x80040E4D;0x80004005';          EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=50,                     @parameter_name=N'LOGGING_LEVEL',                     @parameter_value= 1; -- Basic          EXEC [SSISDB].[catalog].[set_execution_parameter_value]                     @execution_id,                      @object_type=50,                     @parameter_name=N'DUMP_ON_ERROR',                     @parameter_value=1; -- true                              /********************************************************         ********************************************************              Section: EXECUTING         ********************************************************         ********************************************************/        EXEC [SSISDB].[catalog].[start_execution]                     @execution_id;        /********************************************************         ********************************************************              Section: EXECUTING END         ********************************************************         ********************************************************/            /********************************************************         ********************************************************              Section: checking execution result                     Source table:  [SSISDB].[catalog].[executions]              status:                     1: created                     2: running                     3: cancelled                     4: failed                     5: pending                     6: ended unexpectedly                     7: succeeded                     8: stopping                     9: completed         ********************************************************         ********************************************************/        if EXISTS(SELECT TOP 1 1                            FROM [SSISDB].[catalog].[executions] WITH(NOLOCK)                            WHERE [execution_id] = @execution_id                                  AND [status] NOT IN (2, 7, 9)) BEGIN                /********************************************************               ********************************************************                     Section: logging error messages                            Source table:  [SSISDB].[internal].[operation_messages]                     message type:                            10:  OnPreValidate                             20:  OnPostValidate                             30:  OnPreExecute                             40:  OnPostExecute                             60:  OnProgress                             70:  OnInformation                             90:  Diagnostic                             110:  OnWarning                            120:  OnError                            130:  Failure                            140:  DiagnosticEx                             200:  Custom events                             400:  OnPipeline                     message source type:                            10:  Messages logged by the entry APIs (e.g. T-SQL, CLR Stored procedures)                             20:  Messages logged by the external process used to run package (ISServerExec)                             30:  Messages logged by the package-level objects                             40:  Messages logged by tasks in the control flow                             50:  Messages logged by containers (For, ForEach, Sequence) in the control flow                             60:  Messages logged by the Data Flow Task                                    ********************************************************               ********************************************************/                INSERT INTO AUDIT.PackageInstanceExecutionOperationErrorLink                     SELECT @PackageExecutionLogID                                  ,[operation_message_id]                            FROM [SSISDB].[internal].[operation_messages] WITH(NOLOCK)                            WHERE operation_id = @execution_id                                  AND message_type IN (120, 130)                           EXEC [AUDIT].[FailPackageInstanceExecution] @PackageExecutionLogID, 'SSISDB Internal operation_messages found'                GOTO ReturnTrueAsErrorFlag                /********************************************************               ********************************************************                     Section: checking messages END               ********************************************************               ********************************************************/                /* This part is not really working, so now using rowcount to pass status              --DECLARE @PackageErrorMessage NVARCHAR(4000)              --SET @PackageErrorMessage = @PackageName + 'failed with executionID: ' + CONVERT(VARCHAR(20), @execution_id)                --RAISERROR (@PackageErrorMessage -- Message text.              --     , 18 -- Severity,              --     , 1 -- State,              --     , N'check table AUDIT.PackageInstanceExecutionErrorMessages' -- First argument.              --     );              */        END        ELSE BEGIN              GOTO ReturnFalseAsErrorFlagToSignalSuccess        END        /********************************************************         ********************************************************              Section: checking execution result END         ********************************************************         ********************************************************/ END TRY BEGIN CATCH        DECLARE @SSISCatalogCallError NVARCHAR(MAX)        SELECT @SSISCatalogCallError = ERROR_MESSAGE()          EXEC [AUDIT].[FailPackageInstanceExecution] @PackageExecutionLogID, @SSISCatalogCallError          GOTO ReturnTrueAsErrorFlag END CATCH;     /********************************************************  ********************************************************    Section: end result  ********************************************************  ********************************************************/ ReturnTrueAsErrorFlag:        SELECT CONVERT(BIT, 1) AS PackageExecutionErrorExists ReturnFalseAsErrorFlagToSignalSuccess:        SELECT CONVERT(BIT, 0) AS PackageExecutionErrorExists   GO

    Read the article

  • Validate signature on EXE with CertGetCertificateChain

    - by cobaia
    I would like to verify a signed executable. The requirement is to validate that the executable itself is valid and where it came from (probably from the subject of the cert). The cert type is PKCS. I found a similar posting here, http://stackoverflow.com/questions/301024/validate-authenticode-signature-on-exe-c-without-capicom The Microsoft documentation, among others, appears to point to CertGetCertificateChain, but the examples tend to work with certificates that are in a store. Does anyone know how to validate a signed executable using CertGetCertificateChain and related API's?

    Read the article

  • Faster forking of large processes on Linux ?

    - by timday
    What's the fastest, best way on modern Linux of achieving the same effect as a fork-execve combo from a large process ? My problem is that the process forking is ~500MByte big, and a simple benchmarking test achieves only about 50 forks/s from the process (c.f ~1600 forks/s from a minimally sized process) which is too slow for the intended application. Some googling turns up vfork as having being invented as the solution to this problem... but also warnings about not to use it. Modern Linux seems to have acquired related clone and posix_spawn calls; are these likely to help ? What's the modern replacement for vfork ? I'm using 64bit Debian Lenny on an i7 (the project could move to Squeeze if posix_spawn would help).

    Read the article

  • How do I use multiple arguments from an array to construct an execl() call in C?

    - by chucknelson
    I have a string array in C named args[] - now how can I use this list of arguments to construct a proper call to execl()? So if the array contains: {"/bin/ls","ls","-a","-l"} ...how can I eventually construct an execl() call that is: execl("/bin/ls","ls","-a","-l",NULL); I must be thinking about this wrong, as I can't find anything online, just talk about defining functions that can take a variable number of arguments.

    Read the article

  • How to execute a program from file descriptor?

    - by stribika
    I need to execute a file when I only know the descriptor. It is also possible that there are no links to the file so finding out the name somehow is not an option. All the execve(), execvp(), etc functions take a file name. dlopen() also takes a name. Ugly solutions (like reading the file and calling some function pointer) are OK.

    Read the article

  • c, pass awk syntax as argument to execl

    - by Skuja
    I want to run following command in c to read systems cpu and memory usage: ps aux|awk 'NR > 0 { cpu +=$3; ram+=$4 }; END {print cpu,ram}' I am trying to pass it to execl command and after that read its output: execl("/bin/ps", "/bin/ps", "aux|awk", "'NR > 0 { cpu +=$3; ram+=$4 }; END {print cpu,ram}'",(char *) 0); but in terminal i am getting following error: ERROR: Unsupported option (BSD syntax) I would like to know how to properly pass awk as argument to execl?

    Read the article

  • bounce multiple servers using ant

    - by Angrezy
    Hi All, This is restart target code which is defined in build.xml target name="restart" propertycopy name="remote.host" from="deploy.${target.env}.host.${remote.id}" propertycopy name="remote.port" from="deploy.${target.env}.port.${remote.id}" sshexec trust="true" host="${remote.host}" port="${remote.port}" username="${scm.user}" keyfile="${scm.user.key}" command="sudo /usr/local/bin/bounce_jboss" target server information is defined in build.properties. The above code is working fine, but the restarting process is very late bcas its stopping-starting server one and later its stopping-starting another server, Is there a way where i can restart both servers parallely with a time frame of 45 seconds.

    Read the article

  • "more" as a target of piped command breaks bash

    - by xavier
    Consider following source, reduced for simplicity int main() { int d[2]; pipe(d); if(fork()) { close(1); dup(d[1]); execlp("ls", "ls", NULL); } else { close(0); dup(d[0]); execlp("cat", "cat", NULL); } } So it creates a pipe and redirects the output from ls to cat. It works perfectly fine, no problems. But change cat to more and bash breaks. The symptoms are: you don't see anything you type pressing "enter" shows up a new prompt, but not in a new line, but in the same one you can execute any command and see the output reset helps fixing things up. So there is a problem with input from keyboard, it is there, but is not visible. Why is that?

    Read the article

  • Shell_exec with git pull ?

    - by rnaud
    Hi everyone, I am setting up a github account, to work on a small project with some friends. I would like to have my home machine able to do a git pull via php, so that we just have to call this small php file for the machine to be up to date. As of right now : <?php $output = shell_exec('git help'); echo "<pre>$output</pre>"; ?> This works perfectly and I get the output, I am in the right directory, so git pull should work just as well, but I get a hanging page, no error, nothing. Any idea ?

    Read the article

  • How to do interactive with the prompt this way in PHP?

    - by user198729
    C:\>mysql -uroot -padmin Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 6 Server version: 5.0.37-community-nt-log MySQL Community Edition (GPL) Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> show databases -> ; +--------------------+ | Database | +--------------------+ | information_schema | | attendance | | fusionchartsdb | | mysql | | sugarcrm | | test | +--------------------+ 6 rows in set (0.09 sec) mysql> use mysql; Database changed mysql> So I want to start a process by mysql -uroot -padmin,and in that process I want to run these statements: show databases use mysql insert xxx (..) values (..) How to do it in PHP?

    Read the article

< Previous Page | 51 52 53 54 55 56 57 58 59 60 61 62  | Next Page >