w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I use rsync to backup the "/root" folder to a network share?
i assume you run the backup as a normal user and try to backup files that belong to the root user. this will not work because of permission problems. run the rsync command as user root, or gain root privileges temporarily by prepending sudo in front of the command, e.g. sudo rsync -ruvz --no-o --no-g --delete "/root" "/mnt/backup-drive"

Categories : Linux

Linux skip /root/.gvfs when executing df command with non-root user
I got the solution for my own question :) In df command you can pass the file system types which you would like to exclude, in this case it is 'fuse.gvfs-fuse-daemon'. So when I execute the below the command I no more get this message "df: `/root/.gvfs': Permission denied" df -x fuse.gvfs-fuse-daemon For more details one can look into df --help option.

Categories : Linux

Root immediate child nodes icons not visible when hiding root
JTree#setShowsRootHandles(boolean newValue) controls the state of the handles for root elements. Normally, this is false. Try changing to true

Categories : Java

Is sudo-ing tomcat's startup with a non-root user the same as running it as root?
Do be aware that the recommended solution to run tomcat on port 80 is to use mod-jk with the Apache web server, not to have tomcat listen on port 80 directly.

Categories : Unix

Reset MAMP Pro username and password to root/root
Assuming you still know the password, you can change the password back to root using /Applications/MAMP/Library/bin/mysqladmin -u root -p password root It'll prompt you to enter a password again, after which it'll be reset to root

Categories : Mysql

Read and Write root folder wihout root
You can use run-as on some devices to execute commands as a particular package. Google have fixed this on Jelly Bean so it no longer works: adb shell run-as app.package.name cp /data/data/package.name/file.txt /sdcard/ exit adb pull /sdcard/file.txt ~/ Here is a good article explaining file access in Android without root permissions, including a one-liner for the above script. It details how to use the new backup command: backup -f ~/data.ab -noapk app.package.name And how to extract the contents of the resulting .ab file: dd if=data.ab bs=1 skip=24 | openssl zlib -d | tar -xvf - You will most likely need the android.permission.BACKUP permission.

Categories : Android

SVN (svnserve) virtual root --root= not recognized
svn+ssh handles the whole transaction including writing and reading the files so it ignores the --root parameter in svnserve. Here is how to fix it over at serverfault -- Basically you just make svnserve into a script that calls svnserve with the proper variables.

Categories : Svn

Document root element "hibernate-configuration", must match DOCTYPE root "hibernate-mapping"
DOCTYPE for <hibernate-configuration> should be: <!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

Categories : Hibernate

is there any method to draw a tree with a root , the root's previous nodes and successor nodes?
Couple of ideas you might find useful: You can use the tree layout to place the nodes in the canvas, create link objects pointing back and forth, then bind the link objects to a diagonal. http://www.durablejs.org/examples/flowchart/1/admin.html You can also use place the nodes using a pack layout, create the link objects pointing back and forth, and bind the links to a Bezier curve. http://www.durablejs.org/examples/statechart/1/admin.html You can find the code for the graphs above: https://github.com/jruizgit/durable/tree/master/lib/durabjevisual.js

Categories : D3 Js

Including from child theme root or else include from parent theme root
To answer your question directly based on your sample, i would not check to see if the file has been placed in the child theme. If a child-theme developer has customized the file, they can simply declare the function and include their own file (wherever they place it). There is no risk of code duplication because your sample function is simple enough. Even if you simplified your code for the purposes of placing it here....you can always keep includes wrapped in a very simple function that can be declared by a child theme. This will keep PHP running efficient and not having to check for files all the time.

Categories : Wordpress

How can I remove the root node and make the first child the new root node with XSLT?
Add a rule to the identity transform that adds nothing to the result tree for your document element other than the processing of its children: <?xml version="1.0" encoding="US-ASCII"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:template match="/*"> <xsl:apply-templates select="*[1]"/> </xsl:template> <xsl:template match="@*|node()"><!--identity for all other nodes--> <xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> (edited to be agnostic to the name of the document element) (edited again to only preserve the first child element of the document element)

Categories : Xml

Linking to ROOT files in xCode
This has nothing to do with ROOT. To link against a library named libSomething.so in your library search path you can use a linker flag -lSomething. You want to link against e.g. libTree.so, so the correct flag to use would be -lTree, not -llibTree which would look for liblibTree.

Categories : C++

Grails Files in Root not found
you can use the UrlMappings.groovy to map an Url to a view like "/robots.txt" (view: "/robots") and in the "/views/" directory is your robots.gsp, then yoou shouldn´t have any environment specific-problems

Categories : Tomcat

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

Sub Domain utilizing same application files as root (using PHP)
As it is on the same server, it should be no problem. You should use absolute paths for including, so for example /web/www/htdocs/config.inc.php instead of ../htdocs/config.inc.php, as it would get really confusing. It would be the best to have a simple pathConf.inc.php in api directory and root directory, containing this absolute path - so you will be able to easily change it afterwards. Then, use this path configured in pathConf.inc.php and include your classes, db configs etc.

Categories : PHP

Apache mod rewrite all .zip files from my root to another domain
If you've moved all the zip files to the root of your new domain use RewriteRule ^.*?/?([^/]+.zip)$ http://myotherdomain.com/$1 [R=301,NC,L] If you've maintained the same folder structure (i.e. you want to move /files/*.zip to newdomain.com/files/*.zip) use RewriteRule ^(.+.zip)$ http://myotherdomain.com/$1 [R=301,NC,L] Keep your current rule that redirects everything under /files/ at the top. RewriteRule ^files/(.*) http://myotherdomain.com/$1 [R=301,NC,L] Then when you only want to redirect the /files/*.zip simple turn it off with a # in front of it. [QSA] is not required because we haven't touched the query string here. EDIT : Okay, to redirect only mydomain.com/*.zip mydomain.com/files/*.zip Use the following rule RewriteRule ^(?:files/)?([^/]+.zip)$ http://myotherdomai

Categories : Apache

python unzip files below the root folder
You have to use a more complex (and therefore more customizable) way to unzip. Instead of using the 'extractall' method, you must extract each files separately with the 'extract' method. Then you will be able to change the destination directory, omitting archive's sub-directories. Here is your code with the modification you needed : def unzip_artifact( local_directory, file_path ): fileName, ext = os.path.splitext( file_path ) if ext == ".zip": Downloadfile = fileName + ext print 'unzipping file ' + Downloadfile try: #zipfile.ZipFile(file_path).extractall(local_directory) # Old way # Open the zip with zipfile.ZipFile(file_path) as zf: # For each members of the archive for member in zf.in

Categories : Python

Nginx: Serve Files from different Root Locations
First of all I advice you to take a backup of your conf file before starting all this. Anyway, you were doing great at first, but then you added stuff that didn't need to be added, like for example try_files $uri $uri/ @handler; This line doesn't really need to be split into two, you could just merge the rewrite into it try_files $uri $uri/ /index.php; But then it makes me wonder how it's working without the $request_uri, so if doesn't work i would try using this line instead: try_files $uri $uri/ /index.php$request_uri; Now this block i don't really understand what it's supposed to do location ~.php/ { rewrite ^(.*.php)/ $1 last; } I'd say it's safe to remove it entirely, cause it seems to be rewriting the request to the same thing it was. And inside the php conf, the w

Categories : Codeigniter

Defining root of HTML in a folder within the site root folder
You need to set the base tag. If you add the tag in your page <head> like this: <base href="http://yoursite.tld/folder/"> it should display images and with sources relative to this base path.

Categories : HTML

How can I add or remove any files into and from initramfs root file system?
How is your kernel/initramfs build ? Is it Buildroot or ptxdist or similar tool ? You need to know what is done during the compilation/build phase, maybe there is a skeleton elsewhere and you need to add your flash dir into this skeleton.

Categories : File

How to get relative path of files from defined root directory?
That would be os.path.relpath(): >>> import os >>> filename = "C:/test/media/blog_images/2013/06/15/yay.gif" >>> blog_images = "C:/test/media/blog_images/" >>> os.path.relpath(filename, blog_images) '2013\06\15\yay.gif'

Categories : Python

I want to set authenticated users' root to a nested resource, their dashboard, instead of the home#index page non-authenticated users use as root
Option 1: In your dashboards controller, change to: @user = current_user @dashboard = current_user.dashboard This will also prevent users from seeing other user's dashboards. Option 2: Now, if users can see other user's dashboard fine, then change your route: root :to => "dashboards#find", as: :authenticated_root and in your dashboards controller: def find redirect_to user_dashboard_path(current_user, current_user.dashboard) end

Categories : Ruby On Rails

Windows batch script to name files after containing subfolder and copy to root
Here I made this my self. I created a similar situation to yours and it worked fine for me. However you have to specify the location to copy all the files to. for /d %%a in (*) do ( cd %%a for /r %%b in (*) do ( copy %%b C: [root] \%%a%%~xb ) cd.. ) pause Hopes this helps. Yours Mona.

Categories : Windows

Open root owned system files for reading with python
One option would be to do this somewhat sensitive "su" work in a background process that is disconnected from the web. Likely running via cron, this script would take the root owned log files, possibly change them to a format that the web-side code could deal with easily like loading them into a database, or merely unzipping them and placing them into a different location with slightly more laxed permissions. Then the web-side code could easily have access to the data without having to jump through the "su" hoops. From my perspective this plan does not seem to violate your contractual rules. The web server config, permissions, etc remain intact.

Categories : Python

Batch Script to Delete Files with Unique Root Stem in Directory
The way i'd go about this is as follows, i will explain the logic and i'll leave you to do the coding. You will parse all the file names into variables, while increasing each time. Then you will set a limit to the number of loops to go through. Then you will search the first 13 characters of the file name and if the number of lines is equal to 1 then delete it. After you will increase the variable by 1 and go through the loop, at the end of each loop it will check if it has reached the limit aka the number of files in the directory, if it has reached the limit, end the loop, otherwise continue. hah, i finally decided to do it after a guy decided to use my idea i described into actual code, anyway this is way shorter and a lot faster than his, tested+verified to work: @echo off & setl

Categories : Batch File

Maven: Not copying files from src/main/resources to the classpath root - Executable Jar
You can try replacing your Configuration as follows; <configuration> <archive> <manifest> <mainClass>xx.com.xxx.xxxx.xx.xxxx.InterfaceRunner</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <finalName>InterfaceRunner</finalName> </configuration> And then mvn package

Categories : Java

Apache giving 403 error when accessing root; viewing .html files is working
You may be lacking a .htaccess file in the root directory. If this is the case, you will need to create one with, at a minimum, the content: DirectoryIndex index.html This will allow "/" to map to the correct location.

Categories : Apache

wrong child root name in rabl and can't set child root name
I've encountered the same exact bug, the problem seems to be setting the object_root to false. Following the comment of Bigxiang I have experimented a bit and found that this works fantastically: child( {:rsvp => :rsvp}, {:object_root => false} ) do extends "users/index" end Note both the round parentheses "()" and braces "{}".

Categories : Ruby On Rails

Reference another Aggregate Root inside another Aggregate root?
By the sounds of it you have an Installation AR. When requiring an AR in another you should model the contained AR as a only the ID in the container or a VO if required. You need to have hard edges around your ARs. Back to the Order / OrderLine example :) An OrderLine seems to 'require' a Product but you shouldn't ever give a Product instance tot eh OrderLine. Instead only model, say, the ProductName and ProductId as a VO in the OrderLine. Now you have a distinct edge to your Order AR. Hope that helps somewhat.

Categories : Entity Framework

Is it webapp-root/META-INF or webapp-root/WEB-INF/classes/META-INF (Tomcat 7)
I guess it is all right. They both might have slightly different purposes. webapp-root/META-INF is directory for metadata of the web application, which you can access via servletContext.getResource("/META-INF/foo"). webapp-root/WEB-INF/classes/META-INF is directory for metadata of java classes, which you can read via getContextClassLoader().getResource("/META-INF/foo").

Categories : Spring

Google drive: Get (root) file and folders with javascript api (get only deleted files on drive)
Same situation as following question: google drive api, javascript list files returns nothing I needed to add to the scope the path 'drive' at authorizing, I had only drive.file which is intent to create/edit files only. The weird thing is that the API returns deleted files when you don't have permissions to view files, I think it's a bug in the API (a serious one). Post this bug on google drive: https://productforums.google.com/forum/#!searchin/drive/security$20issue$20permission$20view/drive/pupjKxTz9FU/cUarGIl_Ah0J

Categories : Javascript

How exactly does rsync work? Is it smart enough not to transfer anything if your files aren't different?
Directly from the man page (http://linux.die.net/man/1/rsync): "Rsync finds files that need to be transferred using a lqquick checkrq algorithm (by default) that looks for files that have changed in size or in last-modified time. Any changes in the other preserved attributes (as requested by options) are made on the destination file directly when the quick check indicates that the file's data does not need to be updated."

Categories : Linux

Sometimes Rsync fails to copy files from the remote machine
For validation: If you want to check if all files were copied, you can do a simple glob or list for list of files in the remote dir. Then compare to the glob list of files in the target dir. set globResult [ exec rsh -l $user $host "cd $dir; ls -l | wc -l" ] Or if you go further, you can always checksum on both the remote and the target directory. As for the reason for failure, it could've been network or server issues. While you are doing rsync, have you check the return exit status to make sure rsync has completed successfully?

Categories : Perl

How to count number of files available in a directory recursively in Python using rsync?
I would use a different approach using fabric, which is a great tool for executing remote commands. from fabric.api import run, env env.host_string = 'example.org' output = run('find /tmp -type f | wc -l') num_files = int(output) Now you have the number of files in your variable num_files. I was just using the find command to search for files recursively beginning at directory /tmp, and counted the returned lines with wc -l.

Categories : Python

Where is Doc Root
You can not say in advance if $_SERVER['DOCUMENT_ROOT'] contains a slash at the end or not. It varies according to the environment. In most cases, it doesn't have the trailing /, but in Windows, a trailing slash will cause issues. The solution here, as Dave suggested, would be to append the trailing slash if it doesn't exist. $_SERVER['DOCUMENT_ROOT'] = sprintf('%s/', rtrim($_SERVER['DOCUMENT_ROOT'], '/')); An alternative solution: $_SERVER['DOCUMENT_ROOT'] .= (substr($_SERVER['DOCUMENT_ROOT'], -1) == '/')?'':'/'; Hope this helps!

Categories : PHP

XML::LibXML: doc - root
Any prefixes defined in the topic node are adopted by the xpc, so the two are different if there are prefixes defined on the root node. use warnings; use strict; use feature qw( say ); use XML::LibXML qw( ); my $xml = <<'__EOI__'; <root xmlns:foo="uri:xxx"> <foo:bar/> </root> __EOI__ my $doc = XML::LibXML->load_xml( string => $xml ); my $root = $doc->documentElement(); { my $xpc = XML::LibXML::XPathContext->new($doc); say "doc:"; say $_->nodeName for $xpc->findnodes('foo:bar'); } say ""; { my $xpc = XML::LibXML::XPathContext->new($root); say "root:"; say $_->nodeName for $xpc->findnodes('foo:bar'); } doc: root: foo:bar

Categories : Xml

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 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#

Difference between root to and get
root_to: is used to show the home page. i.e., page which is user landed into site. To solve your problem: First provide route to static_pages/home using get "static_pages/home" and then add root to: "static_pages#home"

Categories : Ruby On Rails

Root log all level
This appears to be the way log4net works. When your config file is processed it behaves as if it has been configured like: <logger name="IBatisNet.DataMapper.Commands.DefaultPreparedCommand" additivity="false"> <level value="DEBUG" /> <appender-ref ref="SpecificAppender"/> <appender-ref ref="ConsoleAppender" /> <appender-ref ref="LogBufferingAppender" /> </logger> Fortunately there is a workaround and that is to set a level filter on your appenders, e.g. for the ConsoleAppender: <appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender"> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%d{HH:mm:ss,fff} [%t] %-5p %c{1} - %m%n" /> </layout> <filter ty

Categories : C#



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