riahc3 50 Â Team Colleague

Thank you!

riahc3 50 Â Team Colleague

That's the root directory (where every directory is branched off, read this intro to unix file system). Why would you allow public to read/write the root directory? It is not Windows. What you may need to do is to allow access to a correct directory from the root, not the root directory.

The reason is irrelevant :) I know the security risks/issues. If a exploit is found, the person has access to the entire system. I fully understand this.

I just want to do it :)

riahc3 50 Â Team Colleague

I was going to start Apache/Tomcat as root but Ive rethought it and have gone against it.

How can I make my web service read/write from "/"? I keep getting permission denied exceptions...

riahc3 50 Â Team Colleague

Hey

How do I run my web service as root? Yes, I know the security implecations of this.

Thanks

riahc3 50 Â Team Colleague

Note that users are never exported, you will have to recreate these manually.

No way to do this? Third party tool?

riahc3 50 Â Team Colleague

Hey

I want to make a backup and restore of a MySQL SERVER to another machine. Please note the SERVER part; I want to backup/restore datebases, tables, procedures, users, configuration, etc....EVERYTHING

What is the best way to do this? Thank you

riahc3 50 Â Team Colleague

Tomcat is installable from aptitude (apt-get) and synaptic package managers. I don't know about Axis2. I am installing an Ubuntu 12.04 image on a VM over the next couple of days (the DVD's are downloading now), so I'll reply back about that when I know a bit more. Usually, if you can install a package from the system repositories, it is preferable to installing from source or whatever.

Yeah, Tomcat is the easy part; The hard part is Axis 2.

riahc3 50 Â Team Colleague

Hey

Im looking for a easy and fast way to install Apache Tomcat and Axis 2 on a Ubuntu box. I followed a guide but it left my PC a mess (I couldnt get updates correctly)

Thank you

riahc3 50 Â Team Colleague

instead

In my opinion, instead of establishing db connection, why don't you try to use cache to set the time. What I mean is use php to establish a cache which will expire in a certain time. Then, use the login function to assign the cache data. If the data is not exist, display the login form.

And I do this how?

riahc3 50 Â Team Colleague

Hey

I want to make a website lets say http://www.mysite.com but before they view it, they have to login with username and password (those are stored in a DB). It doesnt matter if they access http://www.mysite.com/hello http://www.mysite.com/hello.html or http://www.mysite.com/hello/something/j.php ect the first time they access, they have to login, else they cannot view any content at all.

Once they are logged in, Im thinking of 2 alternatives (depends on which is more easy to implement and when has better security)

1: Once they log in, in a DB the date/time they login is stored. If in say 5 minutes, they dont do anything on the site, they have to input again their username and pass. If they do, the NEW date/time is stored and sofore.
2: A simple cookie that expires in a hour (or whatever time)

Thank you

riahc3 50 Â Team Colleague

But where is my password? When I call sudo (or su in my case) it has to always ask me for my password.

riahc3 50 Â Team Colleague

Im trying with the full path name and exactly how it is written (case sensitive). But nothing.....

Something like:

system("touch /tmp/test");

Doesnt work either.

riahc3 50 Â Team Colleague

Hello

Im posting this in C because Arena is highly influenced by C....

Im trying to open a file using fopen but I cant get it to work. Ive made the permissions on the file 777 (all) just in case but it doesnt work. Can someone please test that it works out correctly?

Thank you

riahc3 50 Â Team Colleague

Hello

I want to run a command as sudo (to be especific open a file) but I dont want to run the entire program as sudo obviously. How do i do a fopen with sudo previlges? I dont mind hardcoding the password (eg, so it wont ask me for my password) as this is for me and only I will use it.

Thank you

riahc3 50 Â Team Colleague

Im wondering if there is a program for building GUIs with XML where I can simply build it visually (WYSIWYG style) and copy/paste the code in my Android IDE.

Thanks

riahc3 50 Â Team Colleague

im using ash btw

riahc3 50 Â Team Colleague

thanks anyways soapyillusion :) but a function is not ideal for this

riahc3 50 Â Team Colleague

Hello

I want to make two shell scripts but they shell scripts isnt exactly my language :P

The following is all pseudocode
The first script will run every say 5 minutes:

if /tmp/media/sda1 exists or /tmp/media/sda2 exists or /tmp/media/sda3 exists or /tmp/media/sda4 exists
then do
        variable storage=what ever above first returns true (lets say /tmp/media/sda3)
        //storage=/tmp/media/sda3
        if storage+"/"+.runmescript exist
        then do
        ./runmescript
        end if
end if

thats the first one.

Now we have on the harddrive a file called "someconf" at /etc/ also at /tmp/media/sda3 we have a file called "update". someconf has a line that says "dot=99" while update has a line that says "dot=11"

".runmescript" would be.

load /etc/someconf
     search for "dot=99" in /etc/someconf
          load /tmp/media/sda3/update
             search for "dot=11"
             replace line from update in somesonf
save

how can i do this? thank you!

riahc3 50 Â Team Colleague

Noone has information on this?

riahc3 50 Â Team Colleague

usb drives automount themselves rite? (unless you are using a min ver of linux)

riahc3 50 Â Team Colleague

There has to be some way how to do this.....

riahc3 50 Â Team Colleague

Later in the same run of the program

Im going to try to read a bit more of the code to say what I do with that temp file and try to describe it better.

riahc3 50 Â Team Colleague

How do i make a autorun usb that executes a shell script that is on the USB drive? This would be only for my system so if there is something i have to enable, no problem (i imagine something like this would be disabled for security reasons)

I believe the shell used would be either ash or busybox. i think its ash but cant confirm.

Thanks

riahc3 50 Â Team Colleague

That's not good; using a common file name which can be used by multiple threads is not a good idea. The java.io.File class has a method for creating a random named temporary file. Use that if all you want to do is access the file just for a single request.

The problem is that I need to know that file name to later discard it.

riahc3 50 Â Team Colleague

Without specifics, it's kind of hard to suggest what you should try out. As already mentioned, web services implemented on the Java platform are by default multithread ready. You should try to investigate the errors you get and dig out the underlying problem. And like I mentioned, I also deal with file systems (writing/reading/etc files/folders) so yes, those are 2 shared resources I use which may cause problems. Just to be clear here, using the FileSystem doesn't cause any problems. As long as the different threads are writing to different files, the OS takes care of the concurrency. The problem comes when two or more users try to access the same resource. If your code is simply writing to a file which has a unique name for each user request, you should be good to go.

" The problem comes when two or more users try to access the same resource."

Exactly. My code tries to access the database continually which is were the main problem is.

When interacting with the file system, all names are unique. They are generated via timestamp so there isnt any problem. I DO though use a temp file called temp.txt (literally) which is sometimes when I try to access it with more than one user at a time, it spits out a error because it cant be found.

The routine of that file is is create it, write to it, read from it, and delete it.

Well I already tried to specify …

riahc3 50 Â Team Colleague

AFAIK, Axis2 uses servlet specification under the hood for serving the content i.e. it runs on a servlet container like Tomcat, Jetty etc. Aren't you using one of these for hosting your web service? Come to think of it, what makes you say that the current service is one thread / one user? As always, you just have to make sure you are properly handling the shared resources (databases, file systems etc.) and the concurrency can be easily taken care by the framework.

Yes, its a servlet like you mentioned (Tomcat). I apoligize for the misunderstanding.

Well it makes me say this because Ive ran it with 2 users and it errors out :P I believe the main reason is like you mentioned: shared resources, more so the databases. So Im not sure how I would have to implement this with databases.

Maybe with some simple examples with databases I might be able to implement it but Im not so sure where to even start.

And like I mentioned, I also deal with file systems (writing/reading/etc files/folders) so yes, those are 2 shared resources I use which may cause problems.

riahc3 50 Â Team Colleague

Not enough details. When you say web service, what does your current service do? "Official" web services fall under two categories: SOAP and REST with SOAP IMO being the more complicated one. These typically run in a web container which automatically helps you take advantage of the servlet specification and implementation (which is also used by web applications). As a starting point look at Resteasy and Restlet frameworks.

OK, great, Ill give you some details of what my web service does and I hope it helps...

It is not a servlet. It uses the Axis2 framework.

First off, this is based of a existing C++ application. Its basically a straight port from a C++ application to a Java web service (only thing changing is synaxis). No GUI, just internal programming (2+2, nothing like drawing the GUI was ported)

There are a lot of math calculations. Most of the program is just based on that.

It access a MySQL server (for read/write). This point I believe will bring several problems to multiuser. Also does FTP transfers (it only sends files, never recieves).

The sum up of the program is basically this:

1: When the web service is called, it checks to verify that certain parameters have been sent correctly.
2: Once thats done it gets a parameter that was sent called ID to read certain fields in the data base that match that ID.
3: With the parameters that data from the data base, it does all its math …

riahc3 50 Â Team Colleague

Hey

I want to make a multithreaded and multiuser web service in Java. Where do I even start looking?

Currently I have a web service that is one user and one thread. I think Ill problably have to completely rewrite it from almost scratch so....

Where can I see some ways how to do it?

Thanks!

riahc3 50 Â Team Colleague

Hey

Im having problemas getting/setting cookies. On local side I can do it but only I cant....

I set a cookie at http://example.com/folder/index.html

and I cant read it at for example http://example.com/folder/otherfolder/file

This does NOT work:

            function setCookie(c_name,value,exdays)
            {
                var exdate=new Date();
                exdate.setDate(exdate.getDate() + exdays);
                var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
                document.cookie=c_name + "=" + c_value;
            }


            setCookie(nombrecorte+this.getParameterByName("idProd"),document.getElementById('nombrecorte').value,365);

This does WORK

            nombrecorte+this.getParameterByName("idProd")+'='+document.getElementById('nombrecorte').value+'; domain=.'+domain+'; expires='+dia.toGMTString()+'; path=/';   

But only like I said, local. Never online.

What could be the problem? Any more information needed?

Thanks

riahc3 50 Â Team Colleague

Well, it seems that Ill have to put a alert box even though it looks horrible...

riahc3 50 Â Team Colleague

BTW, this has no excuse.... ne

riahc3 50 Â Team Colleague

Is the last page in this thread "broken"?

riahc3 50 Â Team Colleague

I literally cannot quote you because every time I try to copy/paste a line you wrote, the browser crashes........

1: I understand it is a personal opinion
2: The one improvement I stated, I think before vBulletin, is let people choose a plain text mode and post a message "as is". In that plain text box you can support things like [b]hi[/b] and have that converted into **hi or whatever it is.
3: Well im glad you stopped them; I was referring to the PM system
4: I want to post. PMs dont really effect the posting system so I just delete them. If you want, I can forward the
5: It is. The tab has crashed 3 times when copy/pasting your post. 3 times!!! My best constructive criticism would be to allow people to plain text post besides this Markdown crap. Also (I think someone said it) the ability to disable the live preview.

riahc3 50 Â Team Colleague

You didn't use the link mechanism for the link you posted, that's why it is broken. For the link, you should have used this: the link name which produces the link name, and it is not broken. You can also use the link button of the editor by selecting the link name, clicking the Link button, and entering the URL. This is just as easy, if not easier than it was before, it also encourages giving names to links as opposed to just dumping the URL in the middle of the post. But I guess this minor issue could be solved by disabling markup when a link is detected (from http://). I suggest you read the formatting help page, because the new markup system is very nice to use compared to the old BBCODE, once you get to know it (and it is also more in harmony with markups used in other forums).

Is there any other forum our there that uses this "link mechanism"? No.

Forums use this:

[url="Title"]www.google.com[/url] (or reverse cant remeber right now)

its always been this way. So yes, it is broken.

You might want to read up on Markdown formatting. Note that we switched from BBCode to Markdown, and * is the starting character for italics. If it bothers you in the editor, you can escape that character with a backslash and it won't be highlighted.

Once again, read up on Markdown. Double asterisks are the starting sequence for bold. …

riahc3 50 Â Team Colleague

I thought of a dirty hack but Im not sure if it is possible

Make a blank alert appear and then disppear. This would remove the alert from being shown and would make this finally work.

riahc3 50 Â Team Colleague

Thank you pritaeas....

The way I have it implanted should work but nothing.......

riahc3 50 Â Team Colleague

Ill try to explain my code a bit to see if that helps:

First I have a canvas object which is basically my product. I draw different points at coordenates such as X:10 Y:7 X:8 Y: 10 etc..........When Im done, I use a function to convert that canvas into Data URI and I store it using localStorage. I do this similar to this:

var something="X10Y7X8Y10";
localStorage.setItem(something,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg==");

As you see I strip it of ":" and " " just to make sure the browser doesnt interpret it in some weird way.

I do this for each product I want. When I go to the cart, the coordenates are passed as well and I restrip them again. I search for the coordenates in localStorage and the image is displayed. Once again this works perfectly in local but not online, which is what pisses me off.

riahc3 50 Â Team Colleague

Ill try to explain my code a bit to see if that helps:

First I have a canvas object which is basically my product. I draw different points at coordenates such as X:10 Y:7 X:8 Y: 10 etc..........When Im done, I use a function to convert that canvas into Data URI and I store it using localStorage. I do this similar to this:

localStorage.setItem("X10Y7X8Y10","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUA
AAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO
9TXL0Y4OHwAAAABJRU5ErkJggg=="

As you see I strip it of ":" and " " just to make sure the browser doesnt interpret it in some weird way.

I do this for each product I want. When I go to the cart, the coordenates are passed as well and I restrip them again. I search for the coordenates in localStorage and the image is displayed. Once again this works perfectly in local but not online, which is what pisses me off.

riahc3 50 Â Team Colleague

The funny thing is that a couple of days ago, instead of the value (which is a base64 image, I believe it is called) I decided to change it to a simply cookie, with is alot easier. That doesnt work either.....

riahc3 50 Â Team Colleague

Made the line exactly like it was in the beginning and now it just shows the second value.

This semiworks because with one alert line it pops up three times for two different values (that was a tongue twister....)

Yup, Im detecting that the problem isnt with the code you guys put (thanks again) but of the implementation of the function that I got off the site. I was hoping maybe someone could see it.

Yeah, its kind of difficult to describe without showing the page itself as its PHTML/JS. If you dont mind and have 15 minutes, I could show you thru TV/VNC as you have been helpful, like the rest, giving ideas.

I am thinking this is more and more related to how it was implanted. The article was written in 2010 and it is 2012 so maybe something has changed. All these test and its results are being conducted under Firefox (latest version). I have not even begun to think how it will act in other browsers....

Maybe explaining it would be better so if anyone has 15 minutes (even less, its nothing too complicated) for a VNC/TV session, please PM. This is enough to drive anyone nuts (more so, if Daniweb's posting system is horrible)

riahc3 50 Â Team Colleague

Look! The link above breaks and it is a normal link......

riahc3 50 Â Team Colleague

I copy and pasted a code right now and had to remove comments. I COULDNT. The editor erased the line above when the line selected as another one.

Well, if you arent powered by vBulletin, you have two choices:

1: Switch back (which was perfected: If it aint broke, dont fix it)
2: Modify it. Im sure that whatever system you have HAS to have a option to modify this.

Here is a list of forum packages (in PHP since vBulletin was based on it and I dont think you guys would change)....

http://en.wikipedia.org/wiki/Comparison_of_Internet_forum_software_(PHP)

riahc3 50 Â Team Colleague

To confirm the code is:

  remoteStorage.requestValue(stringdepuntos, function(key, value){

    this.val = value;
    remoteStorage.val=value;
    somefunction(value);

});




            function somefunction(value)
            {
            alert ("inside somefunction start function " + value);
                hero<?php echo $_SESSION['countforfor']; ?> = value;
                document.getElementById("fotop<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                document.getElementById("fotog<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                alert ("inside somefunction end function " + value);

            }       
riahc3 50 Â Team Colleague

This line:

this._requests[data.id].callback.call(this, data.key, data.value);

is the one giving all the problems

riahc3 50 Â Team Colleague

pubsub method gives same results.........As a matter of fact, identical I believe....

riahc3 50 Â Team Colleague

Thank you for your help :)

I tried the first method "method within callback" such as this:

var remoteStorage = new CrossDomainStorage("http://someher.com", "/server.html");


remoteStorage.requestValue(stringdepuntos, function(key, value){
    this.val = value;
    remoteStorage.val=value;
    somefunction(value);
/*1*/   alert ("inside one function " + value);
});



            function somefunction(value)
            {
    /*2*/       alert ("inside somefunction start function " + value);
                hero<?php echo $_SESSION['countforfor']; ?> = value;
                document.getElementById("fotop<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                document.getElementById("fotog<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
        /*3*/       alert ("inside somefunction end function " + value);

}

This is with 2 values. As you can see there are a total of 3 alerts. When I use this the following happens:

9 alert popsup turn up (triple the amount of the ones in my code)
Now here is the popups in the order I see them and that I press intro to (As you can see Ive put a 1 2 and 3 next to them to make it easier):

2 (no value) (this is suppose to have the last value)
3 (the last value I entered appears)
1 (the last value I entered appears)
2 (the last value I entered appears)
3 (the last value I entered appears)
1 (the last value I entered appears)
2 (the last value I entered appears)
3 (the FIRST value I entered appears)
1 (the first value I entered appears)

Im going to attempt the pubsub method which I have even less clue what it is …

riahc3 50 Â Team Colleague

With this code it works twice: Afterwards it repeats the second value the entire time:

remoteStorage.requestValue(stringdepuntos, function(key, value){

    this.val = value;
    remoteStorage.val=value;
});








                setTimeout(function(){
                remoteStorage.requestValue(stringdepuntos, function(key, value){

                this.val = value;
                remoteStorage.val=value;
                });
                hero<?php echo $_SESSION['countforfor']; ?> = remoteStorage.val;
                document.getElementById("fotop<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                document.getElementById("fotog<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                },3000);
riahc3 50 Â Team Colleague

Also (although I think this is pretty obvious)

hero<?php echo $_SESSION['countforfor']; ?> = remoteStorage.val;
                    document.getElementById("fotop<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                    document.getElementById("fotog<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;

alert('outside ' + remoteStorage.val);

Shows undefined and does NOT work

alert('outside ' + remoteStorage.val);

hero<?php echo $_SESSION['countforfor']; ?> = remoteStorage.val;
                    document.getElementById("fotop<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;
                    document.getElementById("fotog<?php echo $_SESSION['countforfor']; ?>").src=hero<?php echo $_SESSION['countforfor']; ?>;

Shows undefined and WORKS

riahc3 50 Â Team Colleague

Well....at least we can pretty much confirm something else is going on because if your code is suppose to work as is, then there is something else going on, more importantly, on that issue with why it works with a alert and why it doesnt work without it.

Its pretty much beyond my scope as I dont know where/what the issue could be. Should I post this also in the PHP/HTML/etc forums?

riahc3 50 Â Team Colleague

It says "outside undefined" but when I assign it to a element in the page, it gets it correctly BUT this only works, once again, if I put a alert. Without the alert, it stays undefined and does not set it.