w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
For a Ruby CLI, what is the most reliable way to change directory to users root/home directory?
To summarize Avdi Grimm's screencast on the same subject, If you're using a Ruby version greater than 1.9, the Dir module provides a method #home. However, this depends on the environment variable HOME set on the user's shell session. To reliably get the home dir, you should pass in the login name of the current user to the Dir.home command. Or, in code: # Works if HOME is set in the environment i.e., if "echo $HOME" returns the home directory # when that command is run on the command-line Dir.home # => /Users/<username>, Works if HOME is set # If the HOME environment variable is not set, you should explicitly pass in the username # of the currently logged-in user Dir.home(username) # => /Users/<username> # The current username can be obtained using username

Categories : Ruby

How to set up local repo to have different root directory than remote "upstream" directory of an open source project?
Broadly speaking, No. Git does not allow you to have two different view of the same repository that have different directory structures. Solution 1: Ignore git altogether for uploading That said, I think you don't need this anyway. If your webhost provides public_html, why not just scp the files you want to the location you want? You could make this a task in a Makefile/Rakefile/whatever and then run it from your local machine when you want to upload, for example, a makefile task could look like: upload: scp -r ./upload/* me@myhost:/home/me/public_html/ .PHONY: upload Solution 2: link into your git directory on your webhost Instead of manually uploading your files, simply link your public_html directory to your upload directory in your git repository on your server. For example:

Categories : GIT

How to launch process from android app with ROOT permissions
There is a difference on how to build command-line for process for ProcessBuilder: NOT working code: commandLine.add("su -c"); commandLine.add("app"); commandLine.add("params") commandLine.add("sudo"); commandLine.add("app"); commandLine.add("params") WORKING code: commandDownloader.add("su"); commandDownloader.add("-c"); commandLine.add("app"); For working code i'm asked for permission by Android OS (MIUI in my case to be more detailed)

Categories : Android

Hadoop word count example without root permissions
The problem was solved by editing the etc/hosts file. We have to put our Ip address and host name to /etc/hosts file. example , If your Ip is 192.255.50.1 then your user name is 'user' you have to put them both on your hosts file as , 192.255.50.1 user

Categories : Java

mysql grant remote permissions via non-root user
Well with root SSH access you can restart MySQL and tell it not to check for the root password by running (once MySQL has been stopped) 'sudo /usr/sbin/mysqld --skip-grant-tables --skip-networking &' then you could create a user and grant that user the grant_option.

Categories : Mysql

I need root permissions to execute a native application under Android?
These guys say root is needed: How can i run C binary (executable file) in Android from Android Shell From my understanding, the regular sdcard is mounted with no execution permission, so you need to write to something like /data/local/, which indeed requires root access.

Categories : Android

How to set gecos attribute in Active Directory using directory services(C#)
I finally found the way to access the attribute. Instead of using directly the DirectoryEntry to connect to the LDAP such as : DirectoryEntry DEBase = new DirectoryEntry("LDAP://" + DomaineName); I used DirectoryContext context = new DirectoryContext(DirectoryContextType.Domain, domaineName)); DirectoryEntry dERoot = System.DirectoryServices.ActiveDirectory.Domain.GetDomain(context).GetDirectoryEntry(); Then I have no problem accessing the gecos attribute

Categories : C#

upload image to root directory from sub directory php
As far as I know there is no problem with accessing other directories, as long as your user has sufficient file access permissions. Maybe try using a full file path $_SERVER["SCRIPT_FILENAME"] and save your file with an absolute path?

Categories : PHP

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

iis permissions and directory access
What you need to do is add a new IIS AppPool identity, not a new system user, and give this new identity full control on the website dir root. (http://technet.microsoft.com/en-us/library/cc731784%28v=ws.10%29.aspx) Open IIS Manager. In the Connections pane, expand the server node and click Application Pools. On the Application Pools page, in the Actions pane, click Add Application Pool. On the Add Application Pool dialog box, type a friendly name for the application pool in the Name box. From the .NET Framework version list, select the version of the .NET Framework required by your managed applications, modules, and handlers. Or select No Managed Code if the applications that you run in this application pool do not require the .NET Framework. From the Managed pipeline mode list, select o

Categories : Asp Net

set file permissions in one directory to match another
It could be easy as using get/setfacl (check the generated file has relative paths): cd dir-a && getfacl -R . > /permissions.acl cd dir-b && setfacl --restore=/permissions.acl

Categories : Python

Add recursive command to set sub directory permissions in C#
First, if your target framework is 4.0, recommend that you use the Directory.EnumerateFiles method (you can also find 3rd code that does the same thing.) Assuming this is a no-go, you can simplify your recursive processing by using the yield keyword, e.g. make a traverse method based on yield -- I'm showing this with a filter function to since it would often be useful in directory traversal ad should give you ideas. static IEnumerable<string> traverse(string path, Func<string, bool> filter) { foreach (string f in Directory.GetFiles(path).Where(filter)) { yield return f; } foreach (string d in Directory.GetDirectories(path)) { foreach (string f in traverse(d, filter)) { yield return f; } } } Then you use tr

Categories : C#

How do I move a spreadsheet from the root to my active folder?
You can use DocsList service to move your file after its creation, try like this : ... var ssOut = SpreadsheetApp.create(output_name); // Create a new spreadsheet, output_name. var root = DocsList.getRootFolder(); var folder = DocsList.getFolderById('your folder Id');// or use getFolderByName if you want var ssOutId = ssOut.getId(); var newFile = DocsList.getFileById(ssOutId); // begin the 'move to folder process' newFile.addToFolder(folder); newFile.removeFromFolder(root);// had to do it in 2 separate steps }

Categories : Google Apps Script

permissions for the /Library/Ruby/Gems/1.8 directory
Your question lack some basic information, I would say ;) For this kind of problem you should include at least your OS (I guess you are on mac os because of the /Library directory) What the error says is that, as a normal user, you cannot write in the /Library directory, which is a system directory (and as such require administrator privilege). From what I read, there is no root account on mac os by default, but maybe you can use sudo to issue a command with temporary privilege: try sudo gem install bundler and see if it works (it should prompt you from your password). Otherwise, you can certainly install the program locally (in your $HOME), but as I never used mac os I can't really help you here. If the above does not work, I suggest you rephrase your question as "using gem on mac o

Categories : Misc

Apply directory permissions to all new subdirectories in linux
Most unix command come with a recursive option. In this case: -R, --recursive It seems like you are trying to use this, but you have -Rm. That is not the correct option. I think what you need is: sudo setfacl -R -m g:users:rwX,d:g:users:rwX index/ I typically use chmod instead of setfacl. chmod -R 777 *

Categories : Linux

How to copy a directory with its attributes/permissions from one location to another?
Answering my own question: /** * Copies a directory. * <p> * NOTE: This method is not thread-safe. * <p> * * @param source * the directory to copy from * @param target * the directory to copy into * @throws IOException * if an I/O error occurs */ private static void copyDirectory(final Path source, final Path target) throws IOException { Files.walkFileTree(source, EnumSet.of(FileVisitOption.FOLLOW_LINKS), Integer.MAX_VALUE, new FileVisitor<Path>() { @Override public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes sourceBasic) throws IOException { Path targetDir = Files.createDirectories(target .resolve(source.

Categories : Java

Chef: Insufficient permissions creating a directory in C:
Per http://tickets.opscode.com/browse/CHEF-3787?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel it looks like this is a bug. My resolution to this is to just go the ruby route require 'fileutils' FileUtils.mkdir_p node['app']['unzip_path'] The problem here is that I lose the idempotence property that chef's directory resource provides, but if you need to put stuff into program files, this seems to be the only route for now

Categories : Ruby

Rails Active Model serializers not setting root
If using default_serializer_options inside your controller doesn't work, maybe you should have a look into config/initializers/wrap_parameters.rb for include_root_in_json option. If you are curious, concerned source code for that option can be found here.

Categories : Misc

How to use a Puppet File Resource to give different permissions on a directory than to it's files?
Create a define containing an exec to change the mode of the directory after it is recursed. http://projects.puppetlabs.com/projects/1/wiki/File_Permission_Check_Patterns

Categories : Ruby

Solr index directory of files add file permissions from database
Yes, if you are on Solr 4+, you can push a Partial Update to Solr index. SCHEMA For partial update, all fields in your schema.xml need to be stored. This is how your fields section should look like in schema.xml: <fields> <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="title" type="text_general" indexed="true" stored="true"/> <field name="description" type="text_general" indexed="true" stored="true" /> <field name="body" type="text_general" indexed="true" stored="true"/> <field name="permission" type="integer" indexed="true" stored="true" /> </fields> INDEXING: You can first index all documents(directory of pdf and word) to your index. Then you can send a partial update to the permissi

Categories : Wordpress

How to get the root directory
Use Path.GetPathRoot method provided by the framework Gets the root directory information of the specified path For your case you can use: string rootPath = Path.GetPathRoot(filename);

Categories : C#

zip with php in root directory
Use the second parameter of ZipArchive::addFile() to specify under which file name the file appears in the archive. basename($file) is a good candidate for that.

Categories : PHP

How can a directory with wide open permissions throw an EPERM error (hadoop)?
This is the standard Linux behavior. When attempting to chmod, its not the permissions that matter but the user attempting it. The thread at http://unix.stackexchange.com/questions/52519/when-does-chmod-fail answers further on this.

Categories : Hadoop

Download to root directory
Try something like this: Dim baseDir As String = AppDomain.CurrentDomain.BaseDirectory Dim launcherDir As String = Path.Combine(baseDir, "Launcher") If Not Directory.Exists(launcherDir) Then Directory.CreateDirectory(launcherDir) End If Dim targetFile = Path.Combine(launcherDir, Path.GetFileName(fileUrl)) Me.downloader.DownloadFileAsync(New Uri(fileUrl), targetFile, Stopwatch.StartNew)

Categories : Vb.Net

PHP warning from root directory
Either: Include relative the the file: __DIR__.'/../somefile';/__DIR__.'/somepath/somefile'; Include relative to a known dir: $_SERVER['DOCUMENT_ROOT'] is often used, as is a PROJECT_DIR-like define() in your bootstrap code. Change the working directory to a known/static dir chdir('/some/dir');. Not recommended as calling code may not expect this.

Categories : PHP

Travis CI with Rails Not In Root Directory
I'll try and address what you should change one error at a time. With the first error: The command "psql -c 'create database test-postgres_production;' -U test-postgres" failed and exited with 2 during before_script. Let's add the following to get a postgres database going on Travis CI: env: - DB=postgresql script: - bundle exec rake db:migrate - bundle exec rake db:test:prepare - bundle exec rake spec before_script: - bundle exec rake db:create RAILS_ENV=test Now that we're running a rake tast to create the database you should be able to remove what you currently had in before_script: Now for the second error: -mongodb: unrecognized service I think you just need a space before the mongodb like so: services: - mongodb And with the third and last error: rake abor

Categories : Ruby On Rails

How do I get the root directory of my ASP.NET server application?
Server.MapPath("~"); Will get you the root directory of the current application, as a path on the disk. E.g., C:inetpub... Note that the ~ character can be used as part of web paths in ASP.NET controls as well, it'll fill in the URL to your application.

Categories : Asp Net

Getting Revisions ONLY in my directory and not in root Repository
I figured out my issue this morning, to answer my own question, when working with subfolders out of a checked out repository, every time a svn update -r PREV command is called, it updates to the previous revisions in me directory. However, running svnversion on at that point will give you the previous revision in ../../repos/users to solve this issue, I called svn info . in the me directory and noted that the Last Changed Rev: had the number that I needed. To get this I called svn info (this is in php btw): exec('svn info .', $info); Then I used a regular expression to grab the key: $versionKey = array_keys(preg_grep('/Last Changed Rev/', $info)); And then set the version to that revision number using substr with an offset of 18: $version = substr($info[$versionKey[0]], 18);

Categories : PHP

what would be the path for the file in the root directory?
When you say "root directory" that usually means the root directory of a filesystem. On most *nix (Linux, FreeBSD, Unix) installs, that means your filesystem path is simply "/". That is, if your config file is there, your PHP file should look like this: <?php include('/config.php'); ?> However, it would generally be both a bad idea and would require superuser privileges to actually put a file at the filesystem root of "/". So it's likely (but we have to guess), that you mean the DOCUMENT ROOT for your web server. Most web servers running PHP make that value available via the super-global $_SERVER['DOCUMENT_ROOT'] as mentioned by Kai Qing in his comment. If that is where your file is, then you could put this in your PHP file: <?php include($_SERVER['DOCUMENT_ROOT']

Categories : PHP

Split-Path with Root UNC Directory
By using the System.Uri class and querying its host property: $uri = new-object System.Uri("\serverfolder") $uri.host # add "\" in front to get exactly what you asked Note: For a UNC path, the root directory is the servername plus the share name part.

Categories : String

Return value from Active Directory
FindName returns a string but you never use it anywhere string result = FindName(account); you can then use the local variable result inside your bExport_Click method as you wish

Categories : C#

C# Active Directory authentication
I am not sure I understand AngularJS angle. If I had a regular WCF service I would use WindowsIdentity from ServiceSecurityContext.Current. http://msdn.microsoft.com/en-us/library/system.servicemodel.servicesecuritycontext.aspx ServiceSecurityContext securityContext = ServiceSecurityContext.Current; if (securityContext == null) throw new Exception("Failed to retrieve Service Security Context"); WindowsIdentity identity = securityContext.WindowsIdentity; currentUser.name = identity.Name

Categories : C#

Searching Active Directory using Sid
You can bind to an object directly given its SID like this: var entry = new DirectoryEntry("LDAP://<SID=S-your-sid-here>"); Both SID and sAMAccountName are unique in the domain.

Categories : C#

integration between active directory and EPM
The latest version of the /n software BizTalk Adapters includes an LDAP Adapter that can be used to access active directory http://www.nsoftware.com/products/biztalk/adapters/ldap.aspx

Categories : Dotnet

php Active Directory lookup
I think this filter should work: (&(objectClass=user)(sAMAccountName=yourUserName) (memberof=CN=YourGroup,OU=Users,DC=YourDomain,DC=com)) Well I am sure this could be tuned to work for you. -jim

Categories : PHP

Accessing Active Directory using C
If you are looking for other option other than openldap on Windows. You can try winldap, for more info you can visit their msdn page, there are some examples too which can help you. http://msdn.microsoft.com/en-us/library/windows/desktop/aa367033(v=vs.85).aspx

Categories : C

Phonegap Build - Get application root directory?
In my case after asking the guys at phonegap, they say that you dont really need to do any of this can just use location.hostname so am looking at using that approach for now, the main reason for asking this is because in trigger.io I would be using tools.getUrl. So I assumed in Phonegap I would need to do something similar. http://legacy-docs.trigger.io/en/v1.4/modules/tools.html

Categories : Javascript

PHP root folder directory - include_once and echo
First you need to declare your root variable like so: $baseURL = "../.."; // or whatever it is Then you can use the variable in the include like so: include_once("{$baseURL}/asset/header.php"); // means include_once("../../asset/header.php"); Just make sure when you put the path inside of include_once, you use DOUBLE quotes and not single quotes, or else you can't incorporate variables like above. Edit: One thing to remember, $baseURL must be in the scope of your include. As in, if it's a global and you're using it inside of a function, make sure you declare it as a global. More on scopes: http://php.net/manual/en/language.variables.scope.php

Categories : PHP

Get user root directory from windows service
I found this under Win7 registry. XP looks to have the same registry keys, but the values have "All Users" profile within it. [HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionExplorerShell Folders] "Common Desktop"="C:\Users\Public\Desktop" "Common Start Menu"="C:\ProgramData\Microsoft\Windows\Start Menu" "CommonVideo"="C:\Users\Public\Videos" "CommonPictures"="C:\Users\Public\Pictures" "Common Programs"="C:\ProgramData\Microsoft\Windows\Start Menu\Programs" "CommonMusic"="C:\Users\Public\Music" "Common Administrative Tools"="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Administrative Tools" "Common Startup"="C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup" "Common Documents"="C:\Users\Public\Documents" "OEM Links"="C:\ProgramData\OEM Links" "Common Template

Categories : C#

phonegap set the root directory for asset files
Maybe a solution is to use the base tag witch allow you to set a default base to all yours relatives links. So for android it will be: <base href="file:///android_asset/www/" target="_blank"> And all yours link will be: <img src="img/logo.png">

Categories : Cordova



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