w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Emails not arriving on dovecot/postfix (debian)
Can you please post the output of /var/log/mail.log ? Because as far as i think the mail.log would contain something like "could not connect to /var/run/dovecot/auth-master: permission denied". If this is the case then all you have to do is change the permissions of /var/run/dovecot/auth-master so that vmail user can access it. But there's a catch to it. Whenever dovecot is restarted the permissions are reverted. You will have to give them again or you can write a script that does that for you every time dovecot or system is restarted. If this is not the case then post the log here for more clarification.

Categories : Misc

Linux postfix/dovecot 554 Relay access denied
If you use a postfix version newer then 2.10, then you need to add the smtpd_relay_restrictions option as described here: # With Postfix 2.10 and later, the mail relay policy is # preferably specified under smtpd_relay_restrictions. /etc/postfix/main.cf: smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination # Older configurations combine relay control and spam control under # smtpd_recipient_restrictions. To use this example with Postfix ≥ # 2.10 specify "smtpd_relay_restrictions=". /etc/postfix/main.cf: smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination ...other rules... After that, any sasl authenticated user should be able to send mails through the

Categories : Linux

unable to semd 1000 mail from cakephp to centos(postfix/covedot)
I'd say this is probably due to the php script taking too long to execute. One solution is to send the emails using BCC but this isn't always an option if you are trying to track emails. You might try sending using a less memory intensive way. What is your current Configemail.php

Categories : Cakephp

Postfix - status=bounced (unknown user "myuser")
you have added mydestination = mydomain.com and so the valid users for mydomain.com will be searched in local_recipient_maps. It is very clear from the logline that local delivery agent is selected to deliver the mail, as local domain class matched. See postfix address classes for more help Modify your main.cf like below #/etc/postfix/main.cf mydestination = # set to localhost localhost.$mydomain or remove mydomain.com for now # Ensure that postmap -q mydomain.com mysql:/etc/postfix/mysql-virtual-mailbox-domains.cf is returning mydomain.com and # postmap -q myuser@mydomain.com mysql:/etc/postfix/mysql-virtual-mailbox-maps.cf succeeds

Categories : Linux

Receiving status updates from cmd application
You need to use the OutputDataRecieved event to handle the redirected output. Add these lines after reciever.Start() receiver.OutputDataReceived += receiver_OutputDataReceived; receiver.BeginOutputReadLine(); and then add the event handler void reciever_OutputDataReceived(object sender, DataReceivedEventArgs e) { ... } More information can be found here http://msdn.microsoft.com/en-us/library/system.diagnostics.process.outputdatareceived.aspx

Categories : C#

SQL Server Service Broker Message vs Conversation vs Dialog
I found this very confusing also when I was learning ServiceBroker... If I recall correctly, a Dialog is a type of Conversation(**). Now as it happens there is only one type of Conversation (Dialogs), so they are effectively the same thing, and the doc frequently talks about them as though they are the same thing. But they are not quite the same, and if Microsoft ever adds another type, then it will be important to distinguish between them. A Messsage is pretty much what you think it is: Conversations consist of a sequence of Messages. (** -- I may have this backwards. Hopefully @RemusRusanu will correct me if I do :-) )

Categories : Sql Server

Checking device status, while receiving data from serial port c#
Listen to the WM_DEVICECHANGE event that will be fired when a device is removed or inserted. Here is an example of a implementation and some more information: Detect serial port insertion/removal http://www.codemiles.com/download/file.php?id=719 (USB Sample) http://msdn.microsoft.com/en-us/library/windows/desktop/aa363480(v=vs.85).aspx

Categories : C#

How to authenticate Facebook User after receiving response.status === 'connected'?
Nothing to be surprised. You can fetch the basic details of any user of the facebook using the access token of any user of the facebook.. So this isnt really good way to validate the token. Moreover, that confirmation of token part isnt required. If you want the authorization through server side go through.this link

Categories : Facebook

Receiving hidden status bar/entering a full screen activity event on a Service
Ok, if anyone is interested, I've solved my problem this way: Added a transparent view to the window manager, with 1px width and match_parent height. Then added a global layout listener to this view, and everytime there's a change on the layout, I check the position of this view on screen. If it's Y is 0, then the status bar is not visible, so a full screen app must be running. This works even better than the native View.OnSystemUiVisibilityChangeListener because it seems there are some apps that somehow don't trigger that method (like the new yahoo weather).

Categories : Android

Jquery Deferred. Multiple ajax calls. deferred vs async false
You can use $.when to combine multiple promises to one that resolves when all of them have been fulfilled. If I got you correctly, you want function lookupInit() { return $.when( http.get('api/employmenttype').done(function (response) { console.log('loaded: employmenttype'); vm.lookups.allEmploymentTypes(response); }), http.get('api/actionlist').done(function (response) { console.log('loaded: actionlist'); vm.lookups.allActionListOptions(response); }), http.get('api/company').done(function (response) { console.log('loaded: company'); vm.lookups.allCompanies(response); }), // … some more ); } Then somewhere else lookupInit(id).then(functio

Categories : Javascript

How to make a jQuery Deferred object resolve/reject with the same 'resolved/rejected' state of another deferred?
I think you may not understand promises. Using the .then method of a promise ( pipe in jQuery < 1.8 ), you can return a new promise and so on. That's how you build up a promise chain. Here's an example of something that's similar to what you're trying to do: function returnOne() { return $.Deferred(function( dfr ) { dfr.resolve( 1 ); }).promise(); } // Number will be the result of the original Deferred/Promise function addTwo( num ) { return $.Deferred(function( dfr ) { dfr.resolve( num + 2 ); }).promise(); } returnOne().then( addTwo ).then(function( result ) { // Will be 3 console.log( result ); }); Using that logic, you can filter the resolution or rejections of your promises however you want, including just re-resolving or rejecting with the s

Categories : Javascript

Why is my deferred object set to resolved instead of pending when calling a function that sets a new $.Deferred multiple times?
Found a snippet extending jQuery deferred to handle "multiple deferred setters and resolvers": $.extend({ StatelessDeferred: function () { var doneList = $.Callbacks("memory"), promise = { done: doneList.add, // Get a promise for this deferred // If obj is provided, the promise aspect is added to the object promise: function (obj) { var i, keys = ['done', 'promise']; if (obj === undefined) { obj = promise; } else { for (i = 0; i < keys.length; i += 1) { obj[keys[i]] = promise[keys[i]]; } } return obj; } }, deferred = promise.promise({}); deferred.resolveWith = doneList.fireWith; deferred.resolve = doneLi

Categories : Javascript

What's the difference between "java.io.IOException: Connection timed out" and "SocketTimeoutException: Read timed out"
A connection timeout means you attempted to connect to the remote IP/port pair and failed to do so: it did not answer at all. Another possible error at that stage would be connection refused, in which this pair is available but rejected your connection attempt. Both of these errors appear on the initial setup of a socket. Note that these errors only occur with TCP, since a TCP connection requires the establishment of a session. When you have a socket read timeout, it means you are connected, but failed to read data in time. Timeouts on sockets are configurable. You may also get a connection reset error, which means you did connect successfully, but the other end decided that after all you're not worth it :p

Categories : Java

Pattern for wrapping a jQuery Deferred around another Deferred?
You can achieve this with .then(). I noticed you are already using .then() in your code, but you are only using it as a callback. You may not know that you can use .then() to modify the original promise to create a "chain" of steps. Here's an example of using .then() to create a "chain": function foo(value) { var dfd = $.Deferred(); dfd.resolve(value); return dfd.promise() .then(function step1(value) { return value * 2; }) .then(function step2(value) { return value + 2 }) .then(function step3(value) { return value * 3 }); }); foo(5).done(function(result) { console.log(result); //"36" }); foo(2).done(function(result) { console.log(result); //"18" }); Even more useful is .then()'s ability to chain p

Categories : Jquery

When to use timed cookies over a timed interval in a database
I believe you should use combination of both - database to store the data and client's cookies to identify row in the database table. Using IP address for identification is not very reliable because: More clients may have the same IP Client's IP address might change randomly (i.e. wifi / gsm connection on the smartphones) You can also use sessions which are probably faster and easier way to store user's information, and if you don't want to manage cookies by yourself, it's a way to go.

Categories : PHP

How to test whether MySQL connection has been timed out by the server (Java)?
I have encountered the same problem. A solution that must be tested is to call the "isValid(int timeout)" method from the java.sql.Connection Or set autoreconnect in mysql: http://dev.mysql.com/doc/refman/5.0/en/auto-reconnect.html Or change the timeout in mysql (default = 8 hours): http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_wait_timeout EDIT: but I think that the best pratice is to open the connection during a transaction and then close it directly after that.

Categories : Java

how to process varying number of timed jobs in app server
I would start with spring's TaskScheduler: http://static.springsource.org/spring/docs/3.2.x/spring-framework-reference/html/scheduling.html#scheduling-task-scheduler But no matter what you use you're going to have to write a non-trivial amount code to support all of this. You'll have to support things like loading all tasks on server startup, ensuring tasks only run on one server (if the app is deployed to multiple glassshish instances), monitoring DB table for deleted users/jobs, etc.

Categories : Java

PHP modules on CentOS Server - Which ones do I need?
I may not have the complete list, but here would be some suggestions: php-mysql php-pdo php-pear php-pecl php-xml If I were you, however, I would install the PEAR package manager, and install all your required extensions or modules from that. Seems like that would be easier to manage all your php libraries from a single source, because I would bet that at some point you'll want to use a php library that's not available via your yum repository.

Categories : PHP

Server sent event: Client not receiving response from server
You need to add in res.end(); somewhere and remove the 'setInterval'. It looks like what you're trying to do, however, is keep the connection alive, in which case you need to change your code significantly. Look into the 'net' module, which is more designed for a "constant on" interactive type of connection. http://nodejs.org/api/net.html#net_net The http module is designed for finite, exchange of data, type of requests. You're trying to make it do something it isn't designed to do. /*jshint node:true */ var http = require('http'); http.createServer(function (req, res) { 'use strict'; console.log('GOOD request recieved'); res.write('hi there'); res.end(); console.log('GOOD end sent'); }).listen(8888); http.createServer(function (req, res) { 'use strict';

Categories : HTML

Centos 6 lamp server security
This is probably off-topic for stackoverflow, you might look at serverfault. However, some quick hints: Disable access to all unnecessary ports, probably by configuring iptables. You shouldn't need to open more than 22,80, and 443. If you do run ssh, edit /etc/ssh/sshd_config and disable root login. I recommend DenyHosts as well. Turn SELinux back on. You just need to use setsebool to enable the right things. This might be all you need $ sudo setsebool httpd_can_network_connect_db 1 This will let you look at related booleans. $ getsebool -a | egrep '(http|php)'

Categories : Wordpress

VirtualHost on Apache Server -- CentOS
try adding these to your httpd.conf <VirtualHost IP:80> DocumentRoot /fullpath/to/ca/crl/ ServerName CA-Test.abc.net </VirtualHost> Now restart your httpd and try browsing the url http://CA-Test.abc.net/root.crl Now public can't access the contents in the folder "ca". Let us know if that helped you.

Categories : Apache

How to set max file size in Linux CeNTOS to server.log
You can use logrotate to deal with log files. It allows automatic rotation, compression, removal, and mailing of log files. Each log file may be handled daily, weekly, monthly, or when it grows too large. It has a size option, so you can configure it to stay under 500MB for your "server.log"

Categories : Linux

How to install Django if I have my own VPS server with Centos and cpanel/WHM?
I don't know if you still need the help but I installed it with this tutorial in ubuntu you should try it here...

Categories : Django

PC not synchronizing time automatically with NTP Server (Centos 6)
Perhaps you can create a cron job schedule the synchronization by way of ntpdate, by adding a line to your root crontab like so: 5 * * * * /usr/sbin/ntpdate your.ntpserver.com

Categories : Linux

Installing Levenstein Functions on centos 6 cloud server
It seems that you're trying to use the damlev.so library included in the damlev.zip file of the Levi's site, but that library is for an Ubuntu 32-bit system, therefore it cannot work on your Centos 64-bit system, so you'll have to compile from sources. As a prerequisite, you must install the g++ compiler and the mysql development libraries: yum install gcc-c++ mysql-devel Also, if you don't have wget and unzip, install them with the following command: yum install wget unzip Then download the source code and unzip it somewhere: cd tmp mkdir damlev cd damlev wget http://samjlevy.com/wp-content/uploads/2011/03/damlev.zip unzip damlev.zip cd src Finally compile, install the plugin and restart the mysql server: g++ -fPIC -I /usr/include/mysql/ -o damlev.so -shared damlev.cpp cp damlev

Categories : Mysql

Chef cookbooks to set up a Rails production server (CentOS)
You can try looking at my repo at https://github.com/dmytro/chef-solo I am using it to bootstrap Rails environments for myself. Additionally it can be combined with Capistrano deployment. I use this in my capistrano recipes https://github.com/dmytro/capistrano-recipes I've put blog post on these. Please lake a look too: http://dmytro.github.io/2013/05/21/easy_spawn_new_hosts_with_capistrano.html

Categories : Ruby On Rails

JavaMail: MessagingException: Got bad greeting from SMTP host — Error Code 250
Try this public static void mail(Reporter report) { if(!sendEmail.trim().equalsIgnoreCase("true")){ return; } Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } }); try { Message message = new MimeMessage(session); message.setFrom(new InternetAddress("from-email@gmail.c

Categories : Java

NGINX: upstream timed out (110: Connection timed out) while reading response header from upstream
Might be worth the look http://howtounix.info/howto/110-connection-timed-out-error-in-nginx (he put the proxy_read_timeout in the location block

Categories : Nginx

the server responded with a status of 500 (Internal Server Error) when calling webservice
Your service could do with some exception handling to trap an error and write it to the event log (or something) so you can see what's going on. Alternatively, run it in Debug Mode through Visual Studio and issue your test -- it should catch at the breakpoint and allow you to step through to see what the problem is.

Categories : Asp Net

How to properly catch the initial response of a server?
I think you don't need to catch answer of server. If your program connects to some port, then some server listening to this port and is OK. So just open connection and check socket variable. PS: A lot of servers don't do anything until you send data to them (not sure about FTP), you have to send something to get answer. But to have status succesfull connection is enough.

Categories : C++

Qt: server receiving data from a socket
The connection is all right, because waitForReadyRead returned 'true', or the connection is not all right, because waitForReadyRead returned false after 1000ms. How would you know the difference? Better work asynchronously with signals. Connect your socket to 'readyRead()'. Or at least test the return value of waitForReadyRead.

Categories : C++

Twisted AMP Server is not receiving data
You can only call reactor.run once per process. I am guessing that you are calling send_fence_to_device once per request. This means that it may work once, but all subsequent calls will fail. If you are set on using Twisted reliably inside a Django application, Crochet might help.

Categories : Python

receiving a web page from web server in a c program
One typical solution is to call recv(2) in a loop and keep processing (printing ?) received bytes. That way you can receive pages of any size. ssize_t nread; while ((nread = recv(sockfd, page, sizeof page, 0)) > 0) { /* .... */ } if (nread < 0) perror("recv");

Categories : C

Receiving Data On Sinatra Server
That's not going to work. Sinatra's server understands and speaks a language called the http protocol, so sending the string: "This is a text please work" through a socket to a Sinatra app is a hopeless prayer. A protocol is a set of rules that specify how the client and the server will speak to each other--then each party can understand exactly what other party is saying. For the http protocol, clients send something known as a request, and servers reply with something known as a response. The request and the response must be formatted precisely according to the rules specified by the http protocol. The gory details for a request are here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html So your java program needs to send a request to Sinatra's server, which is simply a

Categories : Java

Express server receiving POST Request
You do not have a route which handles a POST request. You should have something like app.post('/route', function(request, response, next) { ... });. You will also need to use the Express body parser to get the data from the POST request i.e. app.use(express.bodyParser());. Then you can access the data off request.body in your middleware function.

Categories : Node Js

Why am I receiving an exception on my server when creating a TIFF?
After a lot of struggle, the last parameter of line 222 was changed from 4L to 24L, and it worked! Thanks to my PM! encoderparams.Param[1] = new EncoderParameter(System.Drawing.Imaging.Encoder.ColorDepth, 24L); It seems that older versions of windows do not support some TIFF codecs. The older code was tested on Windows Server 2012 too, and it works.

Categories : C#

Android socket client not receiving from server
Is there a return being sent on the last line? If not readLine() will hang until a return is sent. Also, if you are using HTTP 1.1 the connection may be left open and waiting for response. Make sure that your Content-Length header is correct as well.

Categories : Java

AsyncTask. Problems with receiving from Java Server
Hi If your getting some thing from server you have to call web server url for fetching data. After data arrives response have some type it will JSON/XML if they are restful services if they are SOAP services they are in envelope. So after response return get that and parse them as per logic. Look for HTTP get/post (for ping to server and get data )and parsing (JSON/XML).

Categories : Android

Receiving a Http Post request on my server
First, you have to make sure you have the line for ScriptService namespace MyName { ... [ScriptService] ... public class MyClass: MyWebService { ... Then you only need to read through the stream to get the Body StreamReader reader = new StreamReader(Context.Request.InputStream); Context.Request.InputStream.Position = 0; String Body= reader.ReadToEnd().ToString(); Context.Request.XXX provides many useful messages for interoperating the request you received. For example - Context.Request.Headers, Context.Request.RawUrl, and Context.Request.HttpMethod.

Categories : Misc

Receiving int values one after another from server using socket programming
There is no way for the receiver to know that you are sending 2 items or a single large item.You may need to implement your own protocol here. If you know the size of each item you can try to read only that much from the recv buffer. If the item sizes vary you can simply send the size first and then the item, so that at the receiving end you can read the integer first and then set the buffer to that size and read the remaining. In your case prefix each sent with the length of the string (4 bytes) at the receiving end read 4 bytes and convert it to int32 and you get the length of your message to be read. Now you can set the buffer size to the required size and read. As Damien_The_Unbeliever mentioned you cannot make sure you have received the full message in one go, you may have to loop

Categories : C



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