Caliper benchmark online results are not generated - caliper

I followed the isnstructions in http://code.google.com/p/caliper/wiki/OnlineResults?show=content and have a key generated for me. I put this key into the file ~/.caliperrc in my Linux machine and defined the account on Google. When I run my benchmark nothing happens there: on my page on http://microbenchmarks.appspot.com it is "No benchmarks yet".

So, this should definitely work for you. A few things to check:
You included the whole line. The "apiKey:" part is necessary. So you should have a whole line that looks like: apiKey: ffffffff-0000-0000-0000-ffffffffffff
It could be that there are connectivity issues. You're not behind a proxy or something are you? If you need to, you can specify the proxy as: proxy: foo.com:8080

Related

"+having+" in $GET/$POST causes server to return 403 Forbidden

One of my clients has a PHP script that kept crashing inexplicably. After hours of research, I determined if you send any PHP script a variable (either through GET or POST) that contains " having t", or escaped for the URL "+having+t", it crashes the script and returns a "403 forbidden error". To test it, I made a sample script with the entire contents:
<?php echo "works";
I put it live (temporarily) here: http://primecarerefer.com/test/test.php
Now if you try sending it some data like: http://primecarerefer.com/test/test.php?x=+having+x
It fails. The last letter can be any letter and it will still crash, but changing any other letter makes the script load fine. What would cause this and how can it be fixed? The link is live for now if anyone wants to try out different combinations.
PS - I found that if I get the 403 error a bunch of times in a row, the sever blocks me for 15 minutes.
I had this type of issue on a webserver that ran apache mod_security, but it was very poorly configured, actually mod_security has very bad default regex rules, which are very easy to trip with valid POST or GET data.
To be clear, this has nothing to do with PHP or HTML, it's about POST and GET data passing through mod_security, almost certainly, and mod_security rejecting the request because it believes it is an sql injection attempt.
You can edit the rules yourself depending on the server access, but I don't believe you can do anything, well, if it's mod_security, I know you can't do anything via PHP to get around this.
/etc/httpd/conf.d/mod_security.conf (old path, it's changed, but it gives the idea)
Examples of the default rules:
SecFilter "delete[[:space:]]+from"
SecFilter "insert[[:space:]]+into"
SecFilter "select.+from"
These are samples of the rules
https://www.howtoforge.com/apache_mod_security
here they trip the filter:
http://primecarerefer.com/test/test.php?x=%20%22%20%20select%20from%22
Note that the article is very old and the rules actually are quite differently structured now, but the bad regex remains, ie: select[any number of characters, no matter how far removed, or close]from will trip it, any sql that matches these loose rules will trip it.
But since editing those default files requires access to them, and also assumes they won't be altered in an upgrade of apache mod_security at some point, it's not a good way to fix the problem I found, moving to a better, more professionally setup, hoster, fixed those issues for us. But it does help if you talk to the hosting support to know what the cause of the issue is.
In fact 'having' is not irrelevant at all, it's part of sql injection filters in the regex rules in the security filters run on POST/GET. We used to hit this all the time when admins would edit CMS pages, which would trigger invariably some sql filter, since any string of human words would invariably contain something like 'select.*from' or 'insert.*into' etc.
This mod_security issue used to drive me bonkers trying to debug why backend edit form updates would just hang, until I finally realized it was badly done generic regex patterns in the mod_security file itself.
In a sense, this isn't an answer, because the only fix is going into the server and either editing the rules file, which is pretty easy, or disabling mod_security, or moving to a web hoster that doesn't use those bad generic defaults.

Eclipse plugin problem

When ever I try to do soft ware updates through my Eclipse Galileo, I get the following error
Unable to connect to repository http://pydev.org/updates/content.xml
Connection timed out: connect
Please help!!
That's a redirect to: http://update-production-pydev.s3.amazonaws.com/pydev/updates (so, you can try that directly).
If it still fails, it means that amazon is having issues (which means you'll have to try later again).
Cheers,
Are you using (just) http://pydev.org/updates as the url? The "location" field should only have "http://pydev.org/updates", no content.xml. Seems to be working fine for me (with Helios).
Actually I checked what happens when you use "http://pydev.org/updates/content.xml", and it does seem to give the type of error you describe. (You would think it could give a slightly better error, but oh well.)

NodeJS - use remote module?

I'm working with node and would like to include a module stored on a remote server in my app.
I.E. I'd like to do something along these lines (which does not work as is):
var remoteMod = require('http:// ... url to my remote module ... ');
As a workaround I'd be happy with just grabbing the contents of the remote file and parsing out what I need if that's easier - though I haven't had much luck with that either. I have a feeling I'm missing something basic here (as I'm a relative beginner with node), but couldn't turn up anything after scouring the docs.
EDIT:
I own both local and remote servers so I'm not concerned with security issues here.
If I'm just going to grab the file contents I'd like to do so this synchronously. Using require('http').get can get me the file, but working from within the callback is not optimal for what I'm trying to do. I'd really be looking for something akin to php's fopen function - if that's even doable with node.
Running code loaded from another server is very dangerous. What if someone can modify this code? This person would be able to run every code he wants on your server.
You can grab remote file just via http
http://nodejs.org/docs/v0.4.6/api/http.html#http.get
require('http').get({host: 'www.example.com', path: '/mystaticfile.txt'}, function(res) {
//do something
});

IIS/Cache problem?

I have a program that checks if a file is present every 3 seconds, using webrequest and webresponse. If that file is present it does something if not, ect, that part works fine. I have a web page that controls the program by creating the file with a message and other variables as entered into the page, and then creates it and shoots it over to the folder that the program is checking. There is also a "stop" button that deletes that file.
This works well except that after one message is launched and then deleted, when it is launched the second time with a different message the program still sees the old message. I watch the file be deleted in IIS, so that is not the issue.
I've thought about meta tags to prevent caching, but would having the file be dynamically named solve this issue also? How would I make the program be able to check for a file where only the first part of the filename is known? I've found solutions for checking directories on local machines, but that won't work here.
Any ideas welcome, thanks.
I'm not that used to IIS, but in Apache you can create a .htaccess and set/modify HTTP-Headers.
With 'Cache-Control' you can tell a proxy/browser not to cache a file.
http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html
A solution like this may work in IIS too if it is really a cache problem.
(To test this, open using your preffered browser with caching turned off
A simple hack is to add something unique to the url each time
http://www.yourdomain.com/yourpage.aspx?random=123489797
Adding a random number to the URL forces it to be fresh. Even if you don't use the querystring param, IIS doesnt know that, so executes the page again anyways.

Up and download directly - no waiting

I would want to program something where you upload a file on the one side and the other person can download it the moment I start uploading. I knew such a service but can't remember the name. If you know the service I'd like to know the name if its not there anymore I'd like to program it as an opensource project.
And it is supposed to be a website
What you're describing sounds a lot like Bit Torrent.
You might be able to achieve this by uploading via a custom ISAPI filter (if you use IIS) -- all CGI implementations won't start to run your script until the request has completed, which makes sense, as you won't have been told all the values just yet, I'd suspect ISAPI may fall foul of this as well.
So, your next best bet is to write a custom HTTP server, that can handle the serving of files yet to finish uploading.
pipebytes.com I found it :)