root

What is the best practices for checking if the user of a Python script has root-like privileges?

I have a Python script that will be doing a lot of things that would require root-level privileges, such as moving files in /etc, installing with apt-get, and so on. I currently have: if os.geteuid() != 0: exit("You need to have root privileges to run this script.\nPlease try again, this time using 'sudo'. Exiting.") Is this the b...

writing a Simplest XML DeSerialization class for the simplest xml file. How to avoid the nesting? deserialize at root?

Hi, I want to deserialize an xml file which has to be just in this form <Basket> <Fruit>Apple</Fruit> <Fruit>Orange</Fruit> <Fruit>Grapes</Fruit> </Basket> Out of the examples I read on internet the least possible format I could find was the following <Basket> <FruitArray> <Fruit>Apple</Fruit> </FruitArray> <FruitArr...

Diffie-Hellman -- Primitive root mod n -- cryptography question.

In the below snippet, please explain starting with the first "for" loop what is happening and why. Why is 0 added, why is 1 added in the second loop. What is going on in the "if" statement under bigi. Finally explain the modPow method. Thank you in advance for meaningful replies. public static boolean isPrimitive(BigInteger m, BigInteg...

What method do you use to identify the Aggregate Roots in Domain Drive Design?

When applying Domain Driven Design to a project, how do you identify the Aggregate Roots? For example, in a standard E-Commerce website, you might say that the Order is one, and the User is the other. But what if your Users belong to a Company? Does that make your Company the aggregate root? I'm interested in hearing people's approache...

A series of simple Aggregate Root questions (Domain Driven Design)

I have a few (hopefully) simple questions about aggregate roots in domain driven design: Is it okay to have an aggregate root as a property of another aggregate root? Is it okay to have a given entity inside two or more aggregate roots? My final question is a bit more involved. I have a website that has a few entities that really bel...

how to debug application as root in eclipse in Ubuntu?

I'm programming application using libpcap. when I debug the application in normal mode, pcap cannot get the network device. it seems that I have to debug the application in root. How can I debug the application in root? I have the root password. I think eclipse has such an option that can add root for the debugging application,but I don'...

NHibernate : Root collection with an root object

Hi, I want to track a list of root objects which are not contained by any element. I want the following pseudo code to work: using (session1 = [...]) { IList<FavoriteItem>list = session1.Linq<FavoriteItem>().ToList(); } list.Add(item1); list.Add(item2); list.Remove(item3); list.Remove(item4); var item5 = list.First(i => i.Name = "Fo...

include and Get not working on index

I have a problem with my index.php, i have this small script that decides what content to deliver <?php $clase = $_GET['clase']; if ($clase == empresa) {include ("empresa.php");} elseif ($clase == productos) {include("productos.php");} else {include ($_SERVER['DOCUMENT_ROOT']."/inicio.html"); } ?> it works when i go to www.mys...

How can get dtrace to run the traced command with non-root priviledges ?

OS X lacks linux's strace, but it has dtrace which is supposed to be so much better. However, I miss the ability to do simple tracing on individual commands. For example, on linux I can write strace -f gcc hello.c to caputre all system calls, which gives me the list of all the filenames needed by the compiler to compile my program (th...

Finding the root directory of a multi module maven reactor project

I want to use the maven-dependency-plugin to copy EAR-files from all sub-modules of my multi-module project to a directory that is relative to the root directory of the entire project. That is, my layout looks similar to this, names changed: to-deploy/ my-project/ ear-module-a/ ear-module-b/ more-modules-1/ ear-modu...

Aggregates and Value Objects: Delete?

Hi, I'm currently determining the entities, value objects and aggregates in a system. Say the following Entities have been identified: Customer, CustomerEmail, Email, CustomerAddress, Address, AddressType where Customers -> Emails is a many to many relationship, as is Customers -> Addresses (with an address type). These relationships ...

I can't set the root password for MySQL

I've just set up a LAMP server using SuSE Server 10. I want to set the root password for MySQL, so I entered the following in the terminal: mysqladmin -u root password MyPassword and the output is: mysqladmin: Can't turn off logging; error: 'Access denied; you need SUPER privilege for this operation' I'm not really certain what S...

Find root of implicit function in Python

I have an implicit function, for example: f(x,y) = x**y + y**y - 3*x I want to solve the root on a meshgrid. So f(x,y) = 0 Drawing the solution is easy: x = linspace(-2,2,11) y = linspace(-2,2,11) (X,Y) = meshgrid(x,y) A = X**Y + Y**Y - 3*X contour(X,Y,A,0) This works great, I have a drawing of the curve I need, however I would l...

Installing Jinja2 on a server without root access

I am trying to install Jinja2 on a web server. I tried running the command "easy_install Jinja2" as they suggested and got an error: [Errno 13] Permission denied: '/usr/lib/python2.5/site-packages/test-easy-install-15897.write-test' I thought that since this was a permission problem, I tried the same thing with "sudo". I was asked ...

htaccess rewrite everything but index and root

I'm trying to set up a site that forwards everything but the root directory and index into a variable. I have the htaccess file set up like this right now: Options +FollowSymlinks RewriteEngine on RewriteRule -(.*)$ http://blah.com/blah.php?name=$1 [R,NC] just so that the index works and anything that starts with a hyphen(-) is rewri...

.htaccess redirect "domain.tld/" to "domain.tld/home.html"

Hello everybody. I have a website here on my localhost : http://localhost/mysite/www/index.php I have some RewriteRules to redirect like this : http://localhost/mysite/www/index.php?page=home -> http://localhost/mysite/www/home.html And now, I want to do a redirection like this : http://localhost/mysite/www/ -> http://localhost...

PHP5 doesn't work an a custom DocumentRoot

Hi, I am currently struggling with the following problem. I have successfully installed Apache2 and PHP5. And it works until I change the DocumentRoot of the Apache2 to something different than /var/www. I want to set the DocumentRoot to /home//wwwroot, but after doing this all php pages are just white. (no download message or sth.) H...

Uninstall packages invisible in Android

Hi, I want do uninstall some useless apps from /system. I have super access, and the permission DELETE_PACKAGE in the manifest. But when i run Runtime.exec("pm uninstall package") I get ERROR/AndroidRuntime(10981): java.lang.SecurityException: Neither user 10094 nor current process has android.permission.DELETE_PACKAGES. Anyone know how...

JSP unable to find Struts2 action

Hi All, I use resin 3.0.25 web server for my application. Earlier application's context path was "/myApp". But now I have deployed it as ROOT, So I changed the context path to "". I have an index.jsp which is the welcome page of the application and it does nothing except for redirecting to my struts 2 action. When the context p...

sudo in andLinux allows root access without password

Hi! While working under andLinux on a bash script that has to sudo some stuff, I arrived at the following line.. this line seems to provide root access but doesn't require a valid password: echo | sudo -S cat /etc/shadow >/dev/tty Can anyone explain why this happens? Without the 'echo |' or the '>/dev/tty' this doesn't work and reques...