w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
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

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

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

How to Map home page to "root of application" in Java EE?
Simply put a web server before your app server and you can map any URL to any application/page. Also don't publish an app server directly. Are you using Tomcat I presume, so you probably deployed ROOT application, right? (you should go with the web server anyway)

Categories : Java

How to launch root activity(Restart Application) using home key in Android?
Unfortunately, it seems the excludeFromRecents is only true for the root activity. So if you set the android:excludeFromRecents="true" in your root activity, then your app will not show in the Recents (long press Home key). You can set android:clearTaskOnLaunch="true" in your root activity then every time your app is relaunch, it will start from the root activity.

Categories : Android

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

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

what 's difference between android system user and linux root user
As far as Linux is concerned, the system user is just a regular user (UID 1000). Android services however give it special permissions and you can get access to pretty much anything. Most services have code like this somewhere: private static final void enforceSystemOrRoot(String message) { final int uid = Binder.getCallingUid(); if (uid != Process.SYSTEM_UID && uid != 0) { throw new SecurityException(message); } } What that does is deny access to anyone who is not root or system. The shell user (UID 2000) (what you get when doing adb shell) is another user with a lot of power (member of many groups). Cf. system: $ su 1000 $ id uid=1000(system) gid=1000(system) groups=1003(graphics),1004(input),1007(log),1009(mount), 1011(adb),1015(sdcard_rw),1028(sdc

Categories : Android

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

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

How to know if user is root or fakeroot?
It looks as if your binary (busybox) is compiled against a static libc. fakeroot uses dynamic library preloading to intercept and replace calls to various libc functions, but this only works if your binary is dynamically linked to libc. If it is statically linked, the function calls are bound to the real calls inside the binary, so there is no way to intercept them.

Categories : C

How to run node.js as non-root user?
Option 1 requires you launch the node server as root. Not ideal. Option 2 adds overhead to every handled request and adds another failure point to your stack. Option 3 Is the simplest and most efficient method. To implement Option 3, add the following to your system init scripts. (/etc/rc.d/rc.local on RedHat based systems like AWS). iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 3000 That will redirect requests from port 80 to port 3000.

Categories : Node Js

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

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

User able to modify file owned by root. Why?
You don't change a file when renaming it or moving it in the same filesystem, because a file is really an inode (which may have zero, one or more filenames in directories). Renaming a file is an operation inside the relevant directories (not on the file itself). Perhaps removing write access to the directory might help (but if the user owns the directory, he could change again these permissions on the directory with chmod). Read also more about sticky bit on directories. BTW, the user could also hard link that same file, i.e. add a new filename to it. Then each filename is refering to the same file.

Categories : Linux

Creating another user account having power of root
Each Unix system should have one, and one only, root user. Unix systems are built on that rule. If you want to promote a user for any reason, the user should use the sudo command. $ sudo <command> <options> Or allow temporary super-user by loging in as the root (use with extreme caution) $ su One should manually edit the sudo configuration to specify which user can do what: $ sudo visudo Then you can add users one by one or add a group of users. Another way, would be to add users one by one to the sudo group. $ sudo adduser <username> sudo You said you updated the sudoers list. Then your user should be able to run sudo. If not, your configuration might be wrong. Remember to always log out and in after you modify the current user's sudoers' privileges. Or yo

Categories : Linux

Devise custom user root is not working
My problem was that I was redirecting in the after_sign_in_path(resource) method instead of just returning the path: def after_sign_in_path_for(resource) return user_path(:user_id=>current_user.id) end is the correct way to do this.

Categories : Ruby On Rails

How to run AT commands in Android terminal as root user?
You can use the program atinout which will allow you to easily send AT commands from the commands line. Example to hang up a call: $ echo ATH | atinout - /dev/ttyACM0 - ATH OK $ You need to find the name of the serial device for android (on desktop linux it is typically /dev/ttyACM0 but Android use something different as far as I remember).

Categories : Android

Why do I get "Access denied for user 'root'@'localhost'"?
Basic trouble-shooting 101: If the literal strings work, and variable assignments don't, then suspect your variable assignments; Something could be wrong with one of them, such as an invisible character. Try: vars = ('localhost','root','admin','one') Mysql.new(*vars) Then try: vars = %w(localhost root admin one) Mysql.new(*vars) or: host, username, password, db = %w(localhost root admin one) Mysql.new(host, username, password, db) or: host, username, password, db = 'localhost','root','admin','one' Mysql.new(host, username, password, db) The idea is to start with what you know works, and work backwards until assigning to variables works, or it breaks. At that point you've either fixed the problem (possibly without knowing why), or you've learned what broke it. Either way you'r

Categories : Mysql

(Rails) Test if user tries to get root directories
Try this: def path_valid?(path, base = Rails.public_path) expanded_path_name = Pathname.new(path).realpath.to_s expanded_path_name.starts_with? base end Pathname#realpath will resolve a path to an absolute path, as well as do symlink resolution. This will let you test precisely where the path of the file to be operated on is, and ensure that it is inside a given path.

Categories : Ruby On Rails

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#

Unit test for only root user in python
If you're using unittest, you can skip tests or entire test cases using unittest.skipIf and unittest.skipUnless. Here, you could do: import os @unittest.skipUnless(os.getuid() == 0) # Root has an uid of 0 def test_bla_as_root(self): ... Which could be simplified in a (less readable): @unittest.skipIf(os.getuid())

Categories : Python

mysql reset root user privileges
I have had issues with GRANT ... TO 'user'@'%' ... before. Try to additionally issue the following GRANT statement: GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION; For me, this did the trick. Somehow mysql seems picky when it comes to localhost

Categories : Mysql

Numpy segfault on large SVD as user but not as root
Looks like the comment is the answer, hence re-posting it as such: I would check if you are using the same python and libraries with the two accounts. Maybe the PATH, PYTHONPATH, LD_LIBRARY_PATH env vars are different and you are using a different version with the root account.

Categories : Python

Access denied for user 'root'@'localhost'
Start mysql client in the console and execute this query: select Host, User from mysql.user;. You MUST have a row like this: +----------------+------------------+ | Host | User | +----------------+------------------+ | localhost | root | +----------------+------------------+ a row with "localhost" in Host and "root" in User. If you don't have it that's the cause of your problem (it doesn't matter if you have other rows with "root" in User) If you don't have such row, add a new user with this: CREATE USER 'appUser'@'localhost' IDENTIFIED BY 'appPassword'; Change 'appUser' by 'root' if you want, but I strongly suggest to use another user. Then add permissions to your new user by executing this in the mysql client: GRANT ALL PRIVILEGES O

Categories : Java

sudo: different path variables for root and user
Try the following command in your user account: env | grep ^PATH= Now, compare this to the output from the same command run as root: sudo env | grep ^PATH= Are the paths the same?

Categories : Linux

Fabric sudo as another user with root privileges
1: You said MyAppUser wasn't in sudoers. So it can't run sudo. Use the debug flag to see this, but you're essentially doing this: $ ssh MyAppUser@myapp.mycompany.com "sudo -u me 'sudo cp ...'" So if MyAppUser can't sudo at all, then fabric connecting as this use can not sudo. 2: If you have multiple users able to connect to this machine, use the settings() context manager or the execute() function and supply me (see prompted user) as the user to connect with in the host string. eg: execute(setup_task, host="me@myapp.mycompany.com") Where setup_task is the task doing the copy into the init dir.

Categories : Bash

Running/Debugging an app on Xcode as root user
I think running things as root is typically not advised, and I think that you wouldn't be able to get special write access on an actual device, but you could try logging in as root on your mac and launching Xcode from there. I have not tried it, but it may enable the "Run as root" option

Categories : IOS

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

Launch a Python GUI from a C program running with user root
The reason it works when you run it the first way is that the DISPLAY environment variable is already set before you start the C program, and it will be inherited by subprocesses. If you're launching the C program on bootup, the DISPLAY variable (probably) won't be set, so you'll need to set it before spawning the subprocess, with something like... #include <stdlib.h> setenv("DISPLAY", something, 1); // Now launch the Python script The tricky bit is what to put in for something. It needs to be whatever you get when you do echo $DISPLAY from a regular X11 session, assuming the C program runs on the same system as your X11 session. You'll either have to hardcode a value which works, or find some way to pass the correct value to the C program. Update Regarding permissions issu

Categories : Python

Devise in Rails redirects to root URL when editing user
Maybe this guide can help you https://github.com/plataformatec/devise/wiki/How-To:-Customize-the-redirect-after-a-user-edits-their-profile

Categories : Ruby On Rails

WampServer - Access denied for user 'root'@'localhost'
Wamp is usually without a MySQL-password. Try replacinng C:/wampdirectory/apps/phpmyadmin-versionthing/config.inc.php, with this version: (simply remove THE WHOLE CONTENT of your current file) <?php $cfg['blowfish_secret'] = 'a8b7c6d'; $i = 0; $i++; $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; $cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = true; $cfg['UploadDir'] = ''; $cfg['SaveDir'] = ''; ?>

Categories : PHP

Scp fails in one direction for admin but is successful with root user
This looks like a known issue .bashrc and scp (excacly output from bash and non interactive shell). I solved this problem by modifying the part of .bashrc to execute only for interactive shell case $- in *i*) # interactive shell alias cc='clearCache.sh' echo 'Alias: cc - clear cache ;; esac Links to such problems: http://www.linuxquestions.org/questions/linux-server-73/strange-scp-error-and-fail-664945/ https://bugzilla.redhat.com/show_bug.cgi?id=20527 http://serverfault.com/questions/485487/use-bashrc-without-breaking-sftp

Categories : Misc

Running python cron script as non-root user
Cron jobs run with the permissions of the user that the cron job was setup under. I.E. Whatever is in the cron table of the reports user, will be run as the reports user. If you're having to so sudo to get the script to run when logged in as reports, then the script likely won't run as a cron job either. Can you run this script when logged in as reports without sudo? If not, then the cron job can't either. Make sense? Check your logs - are you getting permissions errors? There are a myriad of reasons why your script would need certain privs, but an easy way to fix this is to set the cron job up under root instead of reports. The longer way is to see what exactly is requiring elevated permissions and fix that. Is it file permissions? A protected command? Maybe adding reports to certai

Categories : Python

MYSQL Access denied for user 'root'@'localhost'
It was absolutely correct what you did,but I guess not working just for a small thing.You should make identified by the password when you are going to grant privileges like the following example which I did.. mysql> GRANT ALL PRIVILEGES ONE `*`.`*` TO 'root'@'localhost' IDENTIFIED BY PASSWORD '*A4B6157319038724E3560894F7F932C8886EBFCF' WITH GRANT OPTION; Try this,I hope your problem will be solved.

Categories : Mysql

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

Jetty bash script works only with root user
Check the ${jetty.home}/logs/start.log (or similarly named log file) That will tell you why it failed. Also, you might want to look into the optional setuid support. http://www.eclipse.org/jetty/documentation/current/setuid.html

Categories : Linux



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