w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Where is my nginx being configured? Changing nginx.conf still brings me to the 'Welcome to nginx' page
when you rewrited the nginx.conf in the folder of source code of nginx and installed it firstly, it will be copied to /usr/local/nginx/conf/nginx.conf (without specially modification of the configure in the folder of source code). But when you do this secondly, the nginx.conf in the folder of source code will be copied to /usr/local/nginx/conf/nginx.conf.defualt,and it usually don't work unless you use nginx -c /usr/local/nginx/conf/nginx.conf.defualt to assign its configure file evertime. There is a line NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" in your script above,which indicates the configure file clearly. To handle this, I suggest rewrite /usr/local/nginx/conf/nginx.conf (not the one in the folder of source code) instead.

Categories : Nginx

Make all new directories have 777 permissions
Put: os.umask(0000) in the Python script before it creates the directory. If you can't change the Python script, put: umask(0000) in the Perl script before it calls the Python script. When a new file or directory is created, the permissions are determined by taking the permissions specified in the call to creat() or mkdir(), and then masking off the bits that are specified in the umask. Typically, applications specify 0666 or 0777 permissions when they call the function (depending on whether they're creating something that should be executable or not). A common value for umask is 022, which turns off group and world write permissions. If you don't want them turned off, use the above umask value to keep the permissions specified in the call.

Categories : Python

how to make application with time limit before it automatically closed in C
If you are on a POSIX system then use alarm(3) (credit to @Duck for suggesting this first in his comment): #include <stdio.h> #include <signal.h> #include <unistd.h> static void sighandler(int sig) { if (sig == SIGALRM) exit(0); } int main(int argc, const char **argv) { signal(SIGALRM, sighandler); alarm(15); // do things here }

Categories : C

I want to encrypt my symfony 2 application and make closed source
Does the entity work properly before encoding your project with Zend Guard? Is the following at the top of your entity class? <?php namespace SevenDaysTradeGestionDeStockBundleEntity; use DoctrineORMMapping as ORM; Note that you can't just use DoctrineORMMapping because the annotation is @ORMTable.

Categories : Symfony2

How to make a timer continuously running until closed by user?
Please have a look at the timers method: Timer.scheduleAtFixedRate(yourtimertask, yourdelay, yourinterval); Ths method will execute the code inside your TimerTask everytime the interval time passes. Here is a simple example of a Timer inside an Activity: @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.yourlayout); MyTimerTask yourTask = new MyTimerTask(); Timer t = new Timer(); t.scheduleAtFixedRate(yourTask, 0, 10000); // 10 sec interval } class MyTimerTask extends TimerTask { public void run() { // do whatever you want in here } } I created my own TimerTask where I can do stuff inside its run method. In the onCreate() method, I start the timer and execute

Categories : Android

How to make URL case insensitive with Nginx
server { # Default, you don't need this! #listen 80; server_name www.abc.com; # Index and root are global configurations for the whole server. index index.html; root /home/www.abc.com/; location / { location ~* ^/sub/ { # The tilde and asterisks ensure that this location will # be matched case insensitive. nginx does not support # setting absolutely everything to be case insensitive. # The reason is easy, it's costly in terms of performance. } } }

Categories : Nginx

What minimum permissions/access rights does a SAP user need to be able to make RFC calls using JCo?
Behind the scenes, SAP makes several calls within one RFC call. In addition, SAP makes security calls to ensure you have the rights to invoke what you're invoking. It does this for any function module call, not just RFC ones.I don't know what DDIF_FIELDINFO_GET does in particular - it may be one of the calls SAP makes to satisfy your overall call RFC_SYSTEM_INFO.In addition, to be eligible to be called as part of an RFC, the SAP function module has to be "remote enabled" (that may be in SE37 but don't quote me on that).

Categories : Java

How do I get the checkbox "Allow access to file URLs" to show up next to my app? I have file write permissions in manifest
To get this to work you need either: permissions: [ "<all_urls>" ] or a scheme starting with file:///. If you try *://*/* that will not work as it only represents http or https

Categories : Google Chrome

Cannot read XLSX file - Exception with Stream "Cannot access Closed File
The difference is probably in the method: excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream); Can you show us that code and verify that you're not accidentally prematurely closing the stream?

Categories : C#

jQuery UI Tabs - Default Closed? How to make Collapsed on page load?
This could use some polish, but it should get you on the right track. http://jsfiddle.net/vbmMJ/2/ <html> <head> <link rel="stylesheet" type="text/css" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css"/> <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> <script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script> <script type="text/javascript"> $(function() { $("#tabs").tabs(); $(".tab-content").hide(); $(".ui-tabs-active").removeClass("ui-tabs-active"); $(".ui-state-active").removeClass("ui-state-active"); $(".ui-tabs-anchor").click(function() { $($(this).attr("href") + " .tab-content").first().show(); }); }); </script> </head>

Categories : Jquery

Make git reset --hard to ignore permission changes
Try setting core.fileMode to false as described here (docs) (git config core.fileMode false should do the trick). This seems to make Git ignore any permission changes when hard resetting. Now, I did find that if Git couldn't read the file (e.g., I'd set the permissions to 000), a hard reset would restore the original permissions it was committed with. Another thought, which might be of interest, would be to write a hook which would set the permissions of all files in the repo to whatever you wanted. That might also give you some assurance that you weren't accidentally leaving a new file with dangerous permissions.

Categories : GIT

How to make R ignore duplicate entries in history?
Assuming a duplicate command is a call identical to a previous one, regardless of order, you could simply do something like this: tmp <- tempfile() savehistory(tmp) hist <- readLines(tmp) hist[! duplicated(hist)] or this, to preserve the last instance of a command hist[! duplicated(hist, fromLast=TRUE)]

Categories : R

Two identical object names; how to make VS ignore one of them?
You can alias your Namespace or Class, or Microsoft's Namespace or Class: Replace: using Website.Models.Users; With: using myUsers = Website.Models.Users; or using myUser = Website.Models.Users.User; Then use it as: if(myUser. or if(myUsers.User. in your code Alternatively, you could just rename your classes so there are no collisions.

Categories : C#

How to make clang ignore c-c++ incompatibility errors?
Is completely and utterly impossible. The only way to include a C++ header is to be writing C++ code. So the only option is to rewrite your C source to be valid C++. This is not a big stretch for most C.

Categories : C

Libgdx Make Lights Ignore Bodies
You can use the following method : cone.setContactFilter(categoryBits, groupIndex, maskBits); where cone is an object of type ConeLight. Now this light will ignore the bodies having the specified categoryBits,groupIndex and the maskBits. You can set the categoryBits,groupIndex and the maskBits through the body's fixture in the following manner- fixture.filter.categoryBits = your value; (categoryBits : The collision category bits. Normally you would just set one bit.) fixture.filter.groupIndex = your value; ( groupIndex: Collision groups allow a certain group of objects to never collide (negative) or always collide (positive). Zero means no collision group. Non-zero group filtering always wins against the mask bits.) fixture.filter.maskBits = your value (maskBits:The collision

Categories : Java

Make nginx load different locations for PC and mobile devices
The problem is as indicated: the location directive is not allowed inside an if. There are actually only a few things that are safe to do within if directives, examples are rewrite and return. See the documentation for more detailed information. Something the documentation doesn't mention is that under certain conditions set is also safe to use. In your specific case, try something like this: if ($http_user_agent ~* android) { rewrite ^ /mobile/$request_uri last; # internal rewrite } location /mobile { } Note that I haven't verified your regular expression. I am sure you can tweak that according to your needs.

Categories : Nginx

Incomplete lines written into txt file when the file is closed - Android
Try using flush before closing: public void stopSaving() { try { myPrintWriter.flush(); myPrintWriter.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } try { myOutWriter.flush(); myOutWriter.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } try { fOut.flush(); fOut.close(); } catch (IOException e) { e.printStackTrace(); } catch (NullPointerException e) { e.printStackTrace(); } }

Categories : Android

How can I make my select all check box ignore disabled items?
You can combine the :not() and :disabled selectors: $(".lv:not(:disabled)").prop("checked", isChecked("selectall"));

Categories : Javascript

Make rails ignore inputs if user is admin
update_attribute Updates the attribute without doing validations, you need this one. check out this api doc EDIT: Speaking about reading documentation Here is an abstract from the method documentation update_attribute(name, value) public Updates a single attribute and saves the record. This is especially useful for boolean flags on existing records. Also note that Validation is skipped. Callbacks are invoked. updated_at/updated_on column is updated if that column is available. Updates all the attributes that are dirty in this object. EDIT: If you still need to validate with this method, note that it says that callbacks are invoked, so what you can do is write your own code to validate input and use callbacks as described here.

Categories : Ruby On Rails

Make eclipse ignore all errors in current project
Please close all the remaining projects and look in to problems.So that you will get only the open project errors. Before starting please add required jar(it may be maven also).So that it will be very easy. Not recommended, But if you dont want to see the error lines UPDATE: Window->Preferences->General->Editors->Text Editors->Annotations->Errors->Un check all.

Categories : Java

How can I make Jetty 9 ignore keypass while accesing keystore?
There are two passwords involved: the keystore password (KeyStorePassword) and the key password (KeyManagerPassword). For PKCS#12 store, they are the same. Since you've imported the key from the PKCS#12 store into the JKS store using the keystore's password, that doesn't mean that the password of the key itself was changed, and it's probably not "keypwd" (Jetty's default). Try to replace the value of KeyManagerPassword with your PKCS#12 store's password. (Note that in general, you don't need to convert the keystore, you could have used PKCS12 as the KeyStoreType.)

Categories : Ssl

Make javah ignore inner classes when generating JNI headers?
I don't know any way to do that. (I use the Oracle JDK.) I understand the annoyance but the problem is limited to unnecessary files and their unnecessary regeneration (outer class changes result in rewriting the useless header files for inner classes). To solve the problem, I just delete all the empty header files. I use Ant, since it is available as a generic project builder step in Eclipse. <?xml version="1.0" encoding="UTF-8"?> <project name="javah"> <mkdir dir="javah" /> <javah classpath="bin" destdir="javah"> <!-- list classes here --> <class name="com.example.Outer" /> <class name="com.example.OuterWithNatives" /> </javah> <delete> <fileset dir="javah"> <no

Categories : Java

Can I make VC++ Intellisense ignore some things it considers invalid?
The "problem" is that the Intellisense compiler is built on top of EDG's compiler, not MSVC itself. EDG's compiler is far closer to the standard, which means that it catches problems today which MSVC might catch next year. Intellisense can't be turned on or off on parts of your code base. That just doesn't make sense. Assume it would ignore int foo(int) and then the compiler would include int foo(int) in overload resolution. Your whole program could change.

Categories : C++

How to make Beyond Compare ignore whitespace, but still show changes in comments
Use the Session->Session Settings menu item. Go to the Importance tab. In the list box on the top left, check Comments. In the drop-down at the bottom left, choose Also update session defaults. (if you want to change it permanently) Click OK. Enable Ignore Unimportant Differences

Categories : Misc

Router ignore resource´s path, always make the same request
In router.js I think that you need to use resource instead of route for any URL fragments that you want to result in API calls. routes are just for 'static' data.

Categories : Ember Js

Way to make screen-readers ignore content-desc
Is there a way to make screen-readers ignore some content-descriptions on android? No, sorry. The primary point of android:contentDescription is to support screen readers. Use by testing tools like uiautomator is secondary.

Categories : Android

How do I make nginx proxy some urls on a domain to one location and the rest to somewhere else
You can refer to "rewrite" and "proxy_pass" directive in nginx manual and this can be solved easily: location ~* "^/$|^/(a|b|c).*?$" { rewrite "^/(.*)$" /site/$1 break; proxy_pass; ......; // to add any commands you need break; } location / { proxy_pass; ......; // to add any commands you need break; } Because no rewrite directive wrote in server block, Nginx start to match url in location phase. If is is caught by one location (here using the 1st one as example), then enter into rewrite loop. "break" in the end of rewrite means jump out the rewrite loop. Then start dealing with other directives in this location ,here proxy_pass will be dealt with. General process in this case would be: location match --> rew

Categories : Nginx

FBSession.activeSession.permissions does not appear to accurately depict the valid granted permissions
If you were using iOS SDK 3.0, then this was due to a bug in the SDK. See the bug report for more details. Symptom summary: After authorizing user with openActiveSessionWithPermissions method, the sessions variable in callback method contains extended permissions that were not allowed by a user.

Categories : IOS

Is it possible to make oracle database procedures to ignore commit statements?
I don't think you can do that. You'll have to add a parameter to those procedures like"do commit"with a default value true. And you call them with parameter set to false. Pass the parameter value on, if they are nested. That way the legacy code still behaves the same but you get transaction control.

Categories : Java

Have you managed to make your node nginx proxy setup on Heroku work?
This article contains instructions on setting up nginx as a proxy on Heroku, in conjunction with OpenResty, Lua, and LuaRocks. node.js isn't mentioned. It uses this buildpack. Haven't tried it myself but seems someone has got it working.

Categories : Node Js

Make Rails ignore daylight saving time when displaying a date
Create a helper that utilizes the dst? method on TimeZone to check whether the passed timezone is currently in DST. If it is, then subtract an hour from the supplied DateTime instance: # helper function module TimeConversion def no_dst(datetime, timezone) Time.zone = timezone if Time.zone.now.dst? return datetime - 1.hour end return datetime end end Then, render the adjusted (or non-adjusted) time in your view: # in your view <%= no_dst(DateTime.parse("2013-08-26T00:00:00Z"), 'Eastern Time (US & Canada)') %> #=> Sun, 25 Aug 2013 19:00:00 EDT -04:00

Categories : Ruby On Rails

Finalizing a Cursor that has not been deactivated or closed or database not closed error
When you are done with the cursor, you need to call Cursor.close(). Leaving it not closed leads to memory leaks. E.g.: Cursor cursor = null; try { cursor = getContentResolver().query(myUri, MY_PROJECTION, null, null, null); if (cursor != null && cursor.moveToFirst()) { // moar code } } finally { if (cursor != null) { cursor.close(); } }

Categories : Android

Google API file permissions
I was never able to set up Google and Ubuntu to allow me to run the Google custom search client from multiple users, so I created a workaround. :) I set up a web page under apache that calls each of the search scripts I wanted to run. Any user must use the web page to run the script. That way all searches run under the www-data user id. I just have to be careful not to try to run the custom search client any other way (from the command line).

Categories : PHP

Changing permissions on a file
The only people that can change the permissions of files are the people that own the files (in your case, jim) and the root user. This is to prevent users from doing something malicious, like changing the permission of someone else's file to r/w and then deleting everything in the file, or something similar.

Categories : Linux

File permissions and security
That depends. To modify the file, an attacker must be able to execute some kind of code on the server, e.g. have shell access. If this is the case, the permission is your smallest problem. If you are on a shared hosting environment (other customers you don't know use your webserver) these other users possibly can change the file too, if your provider did not setup their security right and they know the path. It is just not considered best practice to set 666 permissions. However most of these kind of attacks happen over your webserver, so restriscting the permission do not solve the problem, as the server needs to have write access. So what you can do: Change the mode to 664 and change the group to that of the webserver is running in - other users may still have write access by using t

Categories : File

Directory permissions to a php file
try this <?php chmod("/somedir/somefile", 755); // decimal; probably incorrect chmod("/somedir/somefile", "u+rwx,go+rx"); // string; incorrect chmod("/somedir/somefile", 0755); // octal; correct value of mode ?> here /somedir/somefile is your file path and read this article

Categories : PHP

copy OSX file with permissions
you can use cp -p -p Cause cp to preserve the following attributes of each source file in the copy: modification time, access time, file flags, file mode, user ID, and group ID, as allowed by permissions. Access Control Lists (ACLs) and Extended Attributes (EAs), including resource forks, will also be preserved.

Categories : Osx

File permissions are not being preserved while after zip
It looks like you will need to try a different archive format. Perhaps tar --preserve-permissions. The other option would be to save the permissions separately and the reapply them upon decompression. You could add a .saved_permissions file to the archive. There are some examples of scripts that can do this on StackOverflow.

Categories : Java

Cant open a closed file
You need to have all code that references fs inside of the using, otherwise you are attempting to access an object that has already been disposed. I would also do the same thing with the BinaryReader, since it also implements IDisposable: Dim data() As Byte Using fs As New FileStream(FileName, FileMode.Open, FileAccess.Read) data = New Byte(fs.Length) {} Using br As New BinaryReader(fs) br.Read(data, 0, data.Length) End Using End Using ...

Categories : Asp Net

Reopening closed file: Lua
So, now the problem is that the "LoadScript" function isn't doing what you expect: Because I'm psychic, i have divined that you're writing a Crysis plugin, and are attempting to use it's LoadScript API call. (Please don't assume everyone here would guess this, or be bothered to look for it. It's vital information that must form part of your questions) The script you're writing attempts to set Backup - but your script, as written - does not separate lines with newline characters. As the first line is a comment, the entire script will be ignored. Basicallty the script you've written looks like this, which is all treated as a comment. --[[ comment ]]--Backup="Hello!" You need to write a " " after the comment (and, I'd recommend in other places too) to make it like this. In fact, you d

Categories : Windows

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