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

Reading in a file, loading correctly but not formatting correctly
Try to use this line: Navi_Endo_RefHomCell = textscan(Navi_HomMat_File_ID, '%f %f %f %f'); You will end up with a cell Navi_Endo_RefHomCell but you can use cell2mat to solve this.

Categories : Matlab

Reading PGM Image in C (Not Reading File Correctly)
The PGM format goes as P5 wid ht xxx xxx xxx xxx where xxx are the raster values. You need to get rid of each getc function before reading the width, or perform an ungetc when it fails to find the character you are looking for. Then, the width will be read appropriately.

Categories : C

Modify the location of php-fpm.conf and php-fpm.d/*.conf?
Certainly, all you have to do is pass the --fpm-config option when starting up FPM /usr/local/sbin/php-fpm --fpm-config <file> You can also specify a specific php.ini path by /usr/local/sbin/php-fpm -c <path> I have mine located in /usr/local/etc/ where I also keep my PEAR and other PHP configurations.

Categories : Misc

Html Utility Pack not reading non-ASCII text correctly
This fixed it: HtmlWeb web = new HtmlWeb(); web.OverrideEncoding = Encoding.GetEncoding(932); doc = web.Load(url); I looked at the Encoding property of the HtmlDocument after it was loaded to find code page 932. Even though it was detected it wasn't used during the initial read. UTF8 wasn't the right encoding.

Categories : C#

How do I correctly use COMMTIMEOUTS with OVERLAPPED IO mode reading from a Serial port
if (dwLastError == ERROR_IO_PENDING) { DWORD ovlStatus = ::WaitForSingleObject(mpOverlappedRx->hEvent, ...); //... } This is a very common mistake when programmers use overlapped I/O. The core idea is that you use it to allow the device driver to start working on the job with the first ReadFile() call. It is going to take a while, I/O always does, and especially with serial ports since they are very slow devices. So you ask the driver "get started on it" and it goes about its job. The driver will, eventually, signal it is done by calling the SetEvent() method on the OVERLAPPED.hEvent. Which completes your WaitForSingleObject() call. What you are supposed to do while the driver is working on it is something else. Another job that your thread ought to do,

Categories : C++

Python correctly finding and reading windows application event logs
You are using a 32bits python on a 64bit install of windows. In most cases, whenever a 32-bit application attempts to access %windir%System32, the access is redirected to %windir%SysWOW64 You can use os.listdir("c:windowssysnativewinevtlogs") as a workaround to read from the real system32 dir from a 32bit python interpretter runing on a 64bit windows... Sources: http://msdn.microsoft.com/en-us/library/windows/desktop/aa384187(v=vs.85).aspx http://support.microsoft.com/kb/942589

Categories : Python

How to use conf file in php
//Include conf.php in every other pages conf.php <?php try { $dbh = new PDO('mysql:dbname=theaterdb;host=localhost','tiger','tiger'); } catch (PDOException $e) { echo 'Connection failed: ' . $e->getMessage(); } ?> other_page.php <?php include("conf.php"); $q = strtolower(trim($_GET["q"])); $sql = 'SELECT address FROM theater WHERE LOWER(theater_name) = :q'; $sth = $dbh->prepare($sql); $sth->bindValue(':q', $q); $sth->execute(); ?>

Categories : PHP

redmine example conf
I don't understand your question but this might help # These modules must be enabled : passenger <VirtualHost *:80> # ServerName my.domain.name # this is the passenger config RailsEnv production # create a link in /var/lib/redmine/default/passenger to /usr/share/redmine PassengerAppRoot /var/lib/redmine/default/passenger SetEnv X_DEBIAN_SITEID "default" Alias "/plugin_assets/" /var/cache/redmine/default/ plugin_assets/ DocumentRoot /usr/share/redmine/public <Directory "/usr/share/redmine/public"> Order allow,deny Allow from all </Directory> </VirtualHost>

Categories : Apache

sed replace in conf 2 different patterns
It is happening because your first matching regex is: server: 127.0.0.1 And 2nd one is: next_server: 127.0.0.1 As you can see first regex will match both the patterns since server: 127.0.0.1 is found for both cases. Fix: To avoid unwanted matching you need to use word boundaries like this: sed -i.bak 's/(server: )127.0.0.1/1xxx.xxx.xxx.xxx/' /etc/cobbler/settings Note: On OSX you need to use this weird syntax for word boundaries: sed -i.bak 's/[[:<:]](server: )127.0.0.1/1xxx.xxx.xxx.xxx/' /etc/cobbler/settings

Categories : Bash

no conf inside $CATALINA_HOME
Yes catlina home points right but there is no means of a tomcat.conf file in a default and plain vanilla Tomcat installation. You however can find several configuration files in the /conf folder. Details/manuals about those can be found at the Apache Tomcat Configuration Reference. And you should always check your etc directory for configuration files. Hope this helps.

Categories : Apache

nginx.conf for url routing
You might want to try something like this, works like a charm for me: location / { try_files $uri $uri/ @rules; } location @rules { rewrite ^/(.*)$ /index.php?param=$1; } This looks for the location at / which is your web root. All of your web accessible files are found in this directory. If a file exists, it'll take you to that file. If not, then it'll throw you into the @rules block. You can use regexp matching to vary your url formatting. But in short, the (.*) matches any string in your url and takes you to your index. I modified what you had written slightly to feed the original input in to index.php as a parameter. If you don't do this, your script won't have any info about how to route the request. For example, then going to /blablabla will mask the url but pull u

Categories : PHP

Django: Issue with url conf
You get the error because the URL conf has not been loaded yet when the class is defined. Use reverse_lazy instead of reverse. from django.core.urlresolvers import reverse_lazy success_url = reverse_lazy('home_page')

Categories : Django

Mock settings in Web.conf with moq
You are better off if you abstract the config file reading, and inject this abstraction into your class, instead of using directly ConfigurationManager. Then for your tests you can mock the abstraction. Create a IConfigurationReader interface: public interface IConfigurationReader { string GetConfigSetting(string settingName); } The real implementation will use ConfigurationManager, but for tests you can mock IConfigurationReader. It may seem overkill, but it's one time work which can be reused all over your application(s). The added benefit is, that if some day you decide to read configuration settings from somewhere else, you just change the implementation, w/o touching your consumers.

Categories : C#

Hadoop conf to determine num map tasks
You should look at the settings of memory management like io.sort.mb or mapred.cluster.map.memory.mb because heap space errors are generally due to an allocation problem and not to map number. If you want to force your map number you have to consider that some values are used prior to others. For instance mapreduce.input.fileinputformat.split.maxsize if small will generate a huge amount of taks even if you set mapred.tasktracker.map.tasks.maximum to a small value. The dfs.block.size has impact on generated map number only if it is greater than the mapreduce.input.fileinputformat.split.maxsize

Categories : Hadoop

nodejs configuration httpd.conf
Node.js is just a JS framework with a system API. Technically, you could reimplement Apache HTTP Server in Node.js, mimicking its behaviour and its configuration structure. But would you? I believe you are using Node.js' HTTP module. Look at the docs: there's no way to read configuration from a file. The server is programmatically created using http.createServer. You provide a callback that listens to requests. This callback provides an http.IncomingMessage parameter (first parameter) which contains everything you need. Here's an example: // load the module var http = require('http'); // create the HTTP server var server = http.createServer(function(request, response) { // use the "request" object to know everything about the request console.log('got request!'); // method ('GET'

Categories : Node Js

Redirecting a .txt file to /etc/resolv.conf
Try this: cat yourfile.txt >> target_file ">>" here means append its content to the end of target file. Don't mistake it to ">", which will overwrite the target file except you mean it

Categories : Unix

error in Apache2.conf
oh, this looks easy...i think. You'll see <VirtualHosts> near or at the top of the file /etc/apache2/sites-enabled/example.com (error says line 1). Scroll down through everything. if you do not see </VirtualHosts> (notice the slash), put that in the bottom of the file. Save and close, then restart apache Regarding the "operation not permitted": you may have to use sudo to elevate your privileges (assuming you are on unix, which i think you are). Research how to do this if you don't know.

Categories : Apache

Akka not loading application.conf
Try putting your file into src/main/resources/ - application.conf is not a scala file, so it doesn't belong in src/main/scala/resources which is the folder for the package root.resources scala sources. OK. I see what is the problem now. I don't think there's a loglevel setting NONE. According to the doc there are four settings: # Options: ERROR, WARNING, INFO, DEBUG loglevel = "DEBUG" Try setting it to WARNING. Also, you have typo in loglevel - please note it's not a camelCase name, but all-lower loglevel. Side note - add akka microkernel plugin to your SBT build and add runner that can be launched either with run or re-start action.

Categories : Scala

Nginx and Cakephp .conf file
Have you tried this? http://book.cakephp.org/2.0/en/installation/url-rewriting.html#pretty-urls-on-nginx If not try my config files. cakephp2-rewrite-rules.conf if (-f $request_filename) { break; } if (!-f $request_filename) { rewrite ^/(.+)$ /index.php?url=$1 last; break; } cake2app.conf location / { index index.html index.htm index.php; allow all; include cakephp2-rewrite-rules.conf; } include php-fastcgi.conf; vhosts.conf server { root /foo/bar; listen vhost:80; server_name vhost; include vhost/cake2app.conf; } Include the vhosts.conf in your nginx.conf in the http section. include vhost/vhosts.conf;

Categories : Cakephp

Unable to source .tmux.conf
The problem is that you are trying to run it as a script file when it is a config that should sit in the root of your home directory, tmux will look for a file of that name in that location when you create a new session. If you have a tmux session open you you can reload a config by typing Prefix+B : Then type: source-file ~/.tmux.conf

Categories : Bash

How do I create a .conf file in Mac osx Lion?
Open TextEdit's Preferences, and switch to the Open and Save section. Under the When Saving a File panel, uncheck the Add '.txt' extension to plain text files option.

Categories : Osx

sed can't edit ssl.conf "Permission denied"
sed tries to create a temp file... see the errors... and has no permission to write to the directory ( /etc/httpd/conf.d ) see sed command creates random named files for possible other solutions

Categories : PHP

Default nginx conf file
I guess, first vhost would be used. If you use including virtual hosts (/etc/nginx/sites-enabled/*) the hosts would be included in alphabetical order. So, if you have hosts "a", "b" and "c", first of them will be "a".

Categories : Nginx

bash sed substitution in httpd.conf
When using sed and file paths, it's easier to avoid the "/" delimiter, else you'll be escaping it everytime. This "picket fence" format makes it terrible to read. Assuming you're trying to replace "DocumentRoot /var/www/html" with "DocumentRoot /usr/share/rt3/html/", try this: sed 's_DocumentRoot /var/www/html_DocumentRoot /usr/share/rt3/html/_' /etc/httpd/conf/httpd.conf Example: ~> echo "DocumentRoot /var/www/html" | sed 's_DocumentRoot /var/www/html_DocumentRoot /usr/share/rt3/html/_' DocumentRoot /usr/share/rt3/html/ ~> EDIT: From your comment, you're wanting to 1) open the file, 2) replace the string, and 3) save changes to the original file. In this case, you can use sed's -i flag (in-place editing). Try this: sed -i 's_DocumentRoot /var/www/html_DocumentRoot /usr/share

Categories : Bash

Does C# have any built in parsing for config files other than app.conf
It sounds like you could make use of profiles in ASP.NET. There is an introduction you can find here: http://www.codeproject.com/Articles/420052/Implementing-User-Profiles-in-ASP-NET-A-Beginners

Categories : C#

Postgresql "no pg_hba.conf entry" error
pg_hba.conf is supposed to be copied to your data directory. According to the list here, it should be in ~/Library/Application Support/Postgres/var. Hope that helps...

Categories : Ruby On Rails

Django URL conf without a view - to link to another domain
I don't think you can/should directly add external urls to your urls.py. That file is for URLs that must be resolved from the django server, so if the page is in another server... and, you want to make use of {% url %} it must be through a redirect. I would do this: from django.conf.urls import patterns, url from django.views.generic import RedirectView urlpatterns = patterns('', # ... url(r'^remote_admin/$', RedirectView.as_view(url='http://admin.mydomain.com'), name='remote_admin'), url(r'^dev_admin/$', RedirectView.as_view(url='http://devadmin.localhost'), name='dev_admin'), ) Then {% url %} should work as usual: {% url 'remote_admin' %}

Categories : Django

How to use python functions in conf.py file in Sphinx
Try: from function import function . With: import function Python tries to import a module; which your file obviously isn't. See sections from the http://docs.python.org/2/tutorial/modules.html#more-on-modules

Categories : Python

django Apache httpd.conf Setup
I had assumed I was using the 64 bit version of WAMP but although I am still unsure if I am using 32 or 64 bit WAMP, I have concluded I am using 32 bit. I used the 32 bit version mod_wsgi.so, restarted the server and it worked. I used this block of code to run the server (below) and I can access it from: http://localhost/first-django-site WSGIScriptAlias /first-django-site "C:/wamp/www-src/first_django_site/first_django_site/wsgi.py" WSGIPythonPath "C:/wamp/www-src/first_django_site/" <Directory "C:/wamp/www-src/first_django_site/first_django_site/"> <Files wsgi.py> Order deny,allow Require all granted </Files> </Directory> I have also downloaded the new WampServer 2.4 64 bit and have also successfully set up the django startproject wi

Categories : Django

How to specify a listening port for OpenLDAP in slapd.conf
The port slapd should listen on is set through binary startup arguments, with an ldap uri, your answer is in man (8) slapd , not in slapd.conf manpage. http://linux.die.net/man/8/slapd

Categories : Linux

Where does Apache install httpd.conf by default?
What you did "wrong" was to not read the documentation, which clearly states: PREFIX must be replaced with the filesystem path under which the server should be installed. If PREFIX is not specified, it defaults to /usr/local/apache2. However, I put "wrong" in quotes because I cannot find anything wrong with those directories. What's so bad about /usr/local?

Categories : Linux

Cannot disable Directory Listing in httpd.conf
The error message is pretty clear. To rephrase / show examples: # relative to whatever lower precedence section applies Options -Indexes If your goal is to turn off indexes. If you want to make sure FollowSymlinks is also set, put a + in front of it: # relative to whatever lower precedence section applies Options -Indexes +FollowSymlinks If you want to turn everything but FollowSymlinks off: # not relative Options FollowSymlinks

Categories : Apache

Apache Tomcat does not contain conf/Catalina/localhost
If all you want is to create something.xml in correct location then all you should do is this. In Netbeans search for context.xml in your project. Add your data there. When you will deploy your project a file will be automatically generated with your {projectname}.xml and will be dropped in correct conf folder

Categories : Java

mongodb.conf bind_ip = 127.0.0.1 does not work but 0.0.0.0 works
You can't access your machine when you bind it to 127.0.0.1 on EC2. That's not a bug, it's reasoned by the network interface bindings. 127.0.0.1 will only bind to the loopback interface (so you will only be able to access it locally), while 0.0.0.0 will bind it to all network interfaces that are available. That's why you can access your mongodb on EC2 when you bind it to 0.0.0.0(as it's available through the internet now) and not via 127.0.0.1. For local servers (like a WAMP or a local mongodb server) that won't look different to you, but for that case you should also thing that binding to 0.0.0.0 for local servers might make them available over all network interfaces (so it might be public for someone who knows your IP, if there is no firewall!) Read on a similar question on Server Fa

Categories : Mongodb

mod_rewrite in httpd.conf not working (but does in .htaccess)
The rewrite rule for your LAMP server is just putting in domain.com. RewriteCond %{HTTP_HOST} stats.(.*) [NC] RewriteRule ^$ http://%1/awstats/awstats.pl?config=%1 [L,R=301] Your comment above says it should be www, more like the first rule. RewriteRule ^.*$ http://www.%1/awstats/awstats.pl?config=%1 [L,R=301]

Categories : Apache

Access remote MySQL server without editing my.conf
The bind-address doesn't specify which IPs can connect to that server, but which address is MySQL listening to. So, just set it to 0.0.0.0 and it will work. Please make sure you've got a user account with that address. Check mysql.user table. Addressing the root-access thing: * If you installed mysql manually, you've got root access. * If you didn't install mysql manually, but it's a service provided by the VPS hosting, then the bind-address should be 0.0.0.0 (or at least not 127.0.0.1). If it's not the case, contact them because they're screwing up pretty bad. Hope it helps. EDIT, CLARIFICATION: MySQL bind-address is not a security constraint. If you want to allow some addresses to connect to the server you should create/grant users with the that address specified, like this CREATE U

Categories : Mysql

Apache CONF: How to add outside directories without showing the location in source
For Apache, you are looking for either Alias or AliasMatch. For PHP, you are looking for include_path

Categories : PHP

Apache httpd.conf User/Group Setting
I finally found a moment to check it more deeply, and it is because Override behaviour. I have briefly checked with 2.4.4 source, and it seems to me, that basically only directives which are on "Override" list in current Directory or Location contexts are overridable with If/Else. As "User" and "Group" are supposed to be set once for the whole installation, and not to be modified by ".htaccess" or depending on Directory/Location context, therefore they are not on some default "AllowOverride" list, and you cannot simply put it into such context to make them overridable. Makes sense though, to force User/Group options to be valid only on top of apache internal "configuration tree". To achieve behaviour you need in reasonable way, as I explained shortly in my comment, you should use "envvar

Categories : Apache



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