w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How to delete emails from cpanel using php fopen
I think fopen function can open a file to read or write but can't delete, but may be discussion in this thread could give you any suggestion.

Categories : PHP

Elmah does not send emails on errors running on windows azure websites
I had a similar issue and got help from Microsoft Support. Apparently, switching from 64 bits to 32 bits in the Azure dashboard fixes it. 64 bits and it's "access denied", 32 bits and the emails go through. OK, apparently the Azure team rolled a fix for this 64 bits issue. 64 bits and 32 bits work for me. They say they deployed the fix yesterday (2013/06/20).

Categories : Azure

VBA script to save email attachments as individual emails in outlook itself
This sample code shows how to save .msg attachments to a temporary Windows folder, then with CreateItemFromTemplate open the saved file as a message "msg2". VBA Code to save an attachment (excel file) from an Outlook email that was inside another email as an attachment From there you should be able to move it to an Outlook folder. Edit: I regularly forget about OpenSharedItem which accepts a Windows path. http://msdn.microsoft.com/en-us/library/office/bb208171(v=office.12).aspx

Categories : Misc

"Need Help In Php script" How to avoid sending emails from default server email address
Use something like this in your code. $headers .= 'From: info@example.com' . " "; Ref: http://php.net/manual/en/function.mail.php

Categories : PHP

Running a .py script from bash, how can I pass a python variable back to the terminal once the .py is done running?
You can write your variable and its value into an ini file from the python script. In Values.ini file my_var="value" After executing python script, just invoke Values.ini using . operator . Values.ini Now your shell variable $my_var will be having the assigned value. The advantage with this method is that you can assign any number of variables like this. var1="value1" var2="value2" var3="value3"

Categories : Python

Running pig script gives the error as: job has failed. Stop running all dependent jobs
After some research, I found that the problem here is LeaseExpiredException. This might be because the output of mapper was removed. One of the reason for this might be due to the quota allocated for the user. In my case, I was running this script in a very large data, and my quota was insufficient to process/store the data. We can check the quota by the following command: hadoop fs -count -q /user/username Thank you.

Categories : Hadoop

Running python script on crontab is causing permissions errors but running via terminal is fine
@Lucas Ou-Yang @Hyperboreus as Hyperboreus said it depends on the user privilege who run it . i think that if you give the /tmp/ dir a 777 permission from the root account it'll be fixed : chmod 777 -R /tmp/ okay try with : chmod 777 /tmp/ if the error still check if the directory /tmp/ exist !

Categories : Python

sonataNotificationBundle, emails getting stored to database but swiftmailer consumer is not triggered and no emails are sent
Below is the working sonataNotificationBundle configuration for swiftmailer consumer. No need to make changes to any other files. sonata_notification: backend: sonata.notification.backend.doctrine queues: - { queue: mailer, routing_key: mailer } - { queue: catchall, default: true } backends: doctrine: message_manager: sonata.notification.manager.message.default max_age: 86400 # max age in second pause: 500000 # delay in microseconds states: # raising errors level in_progress: 10 error: 20 open: 100 done: 10000

Categories : PHP

Re-installing Linux O.S. and then running bunch of commands in a .sh script , how to stop the script if something fails?
You can check the error code from commands you run #!/bin/bash function test { "$@" status=$? if [ $status -ne 0 ]; then echo "error with $1" exit 255 fi return $status } test ls test ps -ef test not_a_command taken from here for more information Bash Beginner Check Exit Status

Categories : Linux

Show past emails in android EditText while entering emails?
For that use Autocomplete TextView. When user enter userName in Autocomplete TextView and press login you need to store username in sharedpreferences. For sharedpreferences see This tutorial. Select entred values from sharedpreferences and display it in your Autocomplete TextView when user comes again.

Categories : Android

sys module giving different output when running Python script through IDLE and by double-clicking the script
print os.path.dirname(sys.executable) is what you should use. When you click it it is probably running through python.exe so you are removing the extra char from the w.

Categories : Python

How to run a script that it has to connect 3 solaris servers, do some operations and create files in the machine where the script is running?
Use sshfs to mount the needed directories of your three servers. Afterwards you can run the script locally accessing the remote data as local files.

Categories : Bash

Cron not running Python script is script not in home folder
cron is running crontab(5) entries from the home directory of the user. You need to change appropriately the directory i.e. to call the chdir(2) syscall (either thru the cd shell builtin, or inside your python script using os.chdir). You should query the current directory (using getcwd(3), or the pwd command, or the os.getcwd in Python) in your script. Also check your PATH if running commands.

Categories : Python

Programmatic delivery of emails via SendGrid from PHP (bulk emails)
There may be a better way, but if it was me I would use ParallelCurl. I've used it in the past to send bulk SMS and it worked great for me. The project hasn't been updated in a while though, but it works. Have a look: https://github.com/petewarden/ParallelCurl Good Luck.

Categories : PHP

error with global name when running a script from another script - python
This is a pretty interesting problem. First a quick workaround, you can provide dictionaries to use as the local and global namespace when calling execfile(), using an empty dictionary for globals works fine: # test_fun1.py a = 1 def test1(): print a execfile('test_fun2.py', {}) test1() Alternatively, if you want the code to execute within the global scope of your module you can use globals() instead of {}. Now on to why this isn't working... from the documentation on execfile(): If both dictionaries are omitted, the expression is executed in the environment where execfile() is called. Here "both dictionaries" is referring to the optional globals and locals arguments to execfile(). In this case "the environment where execfile() is called" is the local scope of the fun

Categories : Python

Running a variable script with parameters through a script
If you do this: #!/bin/sh for app in "$@"; do sh "jboss-$app" restart done Then you can pass a space-separated list of app names to the script ./restart-apps app1 app2 app3 ...

Categories : Shell

When running Python's pdb as a script, how do I autostart the script?
that's probably not the way to do to it. you should modify/extend the existing pdb.py. the code looks like this: while True: try: pdb._runscript(mainpyfile) if pdb._user_requested_quit: break print "The program finished and will be restarted" except: traceback.print_exc() print "Uncaught exception. Entering post mortem debugging" print "Running 'cont' or 'step' will restart the program" t = sys.exc_info()[2] pdb.interaction(None, t) print "Post mortem debugger finished. The "+mainpyfile+" will be restarted" it looks like you could replace `pdb._runscript(mainpyfile)' with something like runpy.run_module(sys.argv[0], run_name="__main__", alter_sys=True) (from PEP 338). not a complete solutio

Categories : Python

[three.js]: script running in IE10, not running as HTA
Okay, problem understood... solution is tricky. When using Three.js code within an HTML application (HTA), then the HTA uses IE7 quicks mode by default. You can easily add the following line to the Three.js HTA: <meta http-equiv="X-UA-Compatible" content="IE=IE10" /> But then, no more HTA mark-up is understood (windowstate, applicationname - to mention just a few) since the MS IE team wants to "focus more on standards" :-( But there is a trick which works... Create an empty HTA using all the mark-up code that you like, for example: <hta:application windowstate="minimize" border="none" icon="myIcon.ico" /> Do NOT use the IE10 X-UA-Compatible meta statement here. Create an onload javascript function within that HTA that loads the THREE.js HTML page to document.location.

Categories : Internet Explorer

How to receive emails from emails from other servers?
If the code is working for one of the domains but not the other two, I'd guess that the propagation hasn't completed yet (if you have indeed changed to MX records). Remember not all the TTL's have the same time, therefore you might need to wait a little longer for the other two domains to propagate. What I would first of all do is check exactly where those domains point to. try this tool to find out where the domain is currently pointing to: http://mxtoolbox.com/

Categories : PHP

Delete a program that are running in console of C#
You're trying to delete the folder in which your running application is in and therefore delete the program itself? Well, you have a few options. It is interesting to note as well that batch files can delete themselves. So, that also leaves you a few more options: have your C# program copy itself to a temp directory before deleting the folder, and run from there. use a batch file entirely instead of C# - having it do whatever and then delete itself afterwards. have your C# program generate and execute a batch file and then quit - leaving the batch file to clean up after the C# program exits. run a CLI command to delete your program after a specified time: Process.Start("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del " + Application.ExecutablePath); you can use MovFileEx to

Categories : C#

deleting all files in except the one running the delete code
Use something like this: function delete_all($filename) { // files listed in this array will not being deleted $exceptions = array ( 'file1', 'file2', ... ); if(!in_array($filename, $exceptions)) { unlink($filename); } } // !!! attention !!! this will delete all files except those listed above // from this folder. Make sure you know what you are doing array_map('delete_all', glob("path/to/temp/*"));

Categories : PHP

How does a script prefaced with #!/bin/rm delete itself?
Yes, you're exactly right when you say "it passes the (fully qualified?) path to that file as the argument to the program specified after #!". This is why shell scripts start with #!/bin/sh or similar, and Python scripts start with something like #!/usr/local/bin/python. The "shebang" line is intended to run an interpreter for scripts, but any executable can be specified.

Categories : Linux

Why do I need to run this script twice to delete all duplicates?
I think your delete query is flawed. Delete shouldn't require an asterist after the delete keyword. You could use this query. DELETE FROM tblRent WHERE idRent in (SELECT IdRent FROM tblRent2);

Categories : Mysql

Script to delete one alphabet from XML file
try this: @echo off &setlocal set "search=&" set "replace=" FOR %%a IN ("D:Transfer*.html") DO call:process "%%~a" goto:eof :process set "textfile=%~1" set "newfile=%~1.new" (for /f "delims=" %%i in ('findstr /n "^" "%textfile%"') do ( set "line=%%i" setlocal enabledelayedexpansion set "line=!line:%search%=%replace%!" echo(!line! endlocal ))>"%newfile%" goto:eof you can also use sed for this: for %%a in (*.html) do sed "y/&/ /" "%%~a" > "%%~na.new"

Categories : Windows

Don't run script if it's already running
Try using ignore_user_abort(true); it will continue to run even if the person leaves and closes the browser. you might also want to put a number instead of true false in the db record and set a maximum number of processes that can run together

Categories : PHP

running pig script
I have not used node.js. But here I find a link to show how to execute a unit command in node.js: http://www.dzone.com/snippets/execute-unix-command-nodejs For example, if you want to run a pig script called foo.pig. Then you can try the following code: var sys = require('sys') var exec = require('child_process').exec; function puts(error, stdout, stderr) { sys.puts(stdout) } exec("pig -f foo.pig", puts); You can replace pig -f foo.pig to any command that you use to run your pig script.

Categories : Node Js

Running a PHP script
What you need to do is to fork the process before you terminate it. This way when you exit the process (or close your ssh connection) the secondary process will continue to run. $pid = pcntl_fork(); if ($pid == -1) { die('could not fork'); } else if ($pid) { // parent pcntl_wait($status); } else { // child // write your code here! }

Categories : PHP

Delete file in zip subdirectory with spaces in name using script
Embedding escapes in a variable doesn't do anything, because the shell interprets quotes and escapes before it expands variables (i.e. by the time the escape's there, it's too late for it to do any good). Instead, put variable references in double-quotes to prevent the shell from interpreting spaces as word breaks. I haven't tested it, but this should work: for file in *.cbz do zip -sf "$file" | grep banner | { while read p; do zip -d "$file" "$p" ; done } done (Note that I also removed the sed command, since read trims leading and trailing whitespace.)

Categories : Bash

JS script is not working on create and delete actions
I **deleted** the jquery.min.js file from my app/assets/javascripts directory and in my gem file I added the line : gem 'jquery-rails' and used 'bundle install' to use the gem in my app. The application.js file has three lines: //= require jquery //= require jquery_ujs //= require_tree . And in my layout.html.erb file I have the line: <%= javascript_include_tag 'application' %> I know it is pretty obvious. Sometimes you need to get things wrong to understand the obvious better. Now I can add and remove messages using AJAX and js files.

Categories : Javascript

Should I delete MySQL entries using a PHP script which users can run?
What you should do is, for maximum security is, have a parameter in the database table called "isActive", or something of that nature, that is a BIT data type to represent a boolean. If that boolean is false, then do not delete the project from the database, simply hide that tables data (do not display it on the site, but keep the data stored in the databse). That way, not only is your database secure from malicious users who would like to destroy data, but projects can also be "re-instated" if they wish to re-instate it. If the project sits around for a certain period of time, say, 14 days, just have the server delete it, not the user, if you wish. This worked for me in the past. Hope This Helps!

Categories : PHP

Delete complete folder using a PowerShell script
We cannot delete an non-empty directory using commands like rmdir or Remove-Item, this is to avoid accidental deletion of important system files by users during programming. Therefore before trying to delete the directory, empty it. Clear the contents and then delete it. :)

Categories : Powershell

Running a script for certain days
Put this in your crontab: */20 * * * * bash /path/to/your/script.sh Then remove it after 10 days. Better yet, have your script check the current date and send you an email when it's 10 days from now to remind you to remove it. You could also just have the script remove the line from the crontab (or just remove the crontab file if it's only got this one line) after 10 days.

Categories : PHP

Why isn't my 'cycle' script running?
Also include Jquery.min.js <script type="text/javascript" src="scripts/jquery.min.js"></script> before your cycle.js Wordpress has already Jquery Loaded so you can remove your jQuery.js from your script and try ..I suppose its mere Jquery Conflict

Categories : Javascript

Running two scripts as one script
You have already identified the basic problem: The need to run the sending and the receiving concurrently. You must delve into multi-threading. The basic design pattern could be: Create a thread for the receiving part with a flag for cancelling it. Loop infinitely doing the following: check to see if there is inbound data; if there is receive it and output it; sleep a timeout; break if the cancellation flag is set. On the main thread, create your receiver and start it, then enter your input loop: If the user inputs a message, send it on the same thread. If the user types 'exit', set the cancellation flag on the receiver thread, wait for it and exit. More or less: class Receiver (Thread): def __init__ (self): super (Receiver, self).__init__ () self.cancelled = False

Categories : Python

Running exec in a script
exec will only give you the last line ... your probably want to use passthru <?php if ($_GET['run']) { # This code will run if ?run=true is set. passthru("./check_sample.sh"); } ? For passing parameters you can just form the add it to the command like this. (escapeshellarg will handle the escaping and quoting of the value for you) passthru("./check_sample.sh ".escapeshellarg($_POST["fieldname"])); If you need the output as a string your options are to use popen or surround the passthru in an output buffering block: ie: ob_start(); /* passthru call */ $data = ob_get_clean();

Categories : PHP

Keep UI updated while script is running
You can try researching WebWorkers. Or you can split your work into separate chunks and call each chunk after the next using setTimeout with a timeout of 0. setTimeout( function() { executeNextChunk(); }, 0 ) This gives the browser time to do other stuff in between invocations.

Categories : Javascript

Running a script from within a shell
the sage shell is a process running in the foreground and due to the sequential nature of your script, the sage shell has to finish running before the next line of the script is executed. It is after the sage shell exits that the easy_install line is run. The script is performing as written.

Categories : Python

Running a php script with a .bat file
The START command optionally accepts a title for the created window as its first argument; in this case, it thinks that C:Program Files (x86)PHPv5.3php.exe is the title to display and -f (the second argument) is the executable you want to run. You can therefore fix this by providing a placeholder title, e.g. start "email reminder task" "C:Program Files (x86)PHPv5.3php.exe" -f C:inetpubwwwrootsitenamecrons eminder-email.php Or, preferably, you can ditch the START command altogether (you aren't using any of its unique facilities) and just run PHP directly: "C:Program Files (x86)PHPv5.3php.exe" -f C:inetpubwwwrootsitenamecrons eminder-email.php

Categories : PHP

Is it even possible to delete from HTML source once you run a jquery script to remove something
Not even possible. Javascript runs on the client-side, aka the browser. You should look into find and sed

Categories : Jquery

Batch script to unzip and delete compressed file
Found this online: http://blogs.msdn.com/b/ben/archive/2007/03/09/path-manipulation-in-a-batch-file.aspx Path Manipulation in a Batch File Have you ever typed "help for" at a command line? If you write a lot of batch files, read through it and you'll probably save yourself some time. Today I was trying to figure out how to get just the filename out of a path that may or may not contain the fully qualified filename. All I had to do was "%~nx1". Brilliant! Here are a few more nifty variable modifiers from the help docs: %~I - expands %I removing any surrounding quotes (") %~fI - expands %I to a fully qualified path name %~dI - expands %I to a drive letter only %~pI - expands %I to a path only %~nI - expands %I to a file name only %~xI - expands %I to a file extension only %~sI - expanded

Categories : Batch File



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.