Wikipedia:Reference desk/Archives/Computing/2007 October 13

= October 13 =

Rebuilding a TOR circuit on Ubuntu
I want to get past a website that restricts from where you can access it (one of those "You don't appear to be in the US"-things), and on windows I always used TOR to do that, it just seemed like the easiest way. It had that nice little GUI with a button that said "rebuild identity" that rebuilt your TOR-circuit. However, I have no idea how to do that on Ubuntu. I installed the thing fine and it's working, but it's dead-slow and I can't find anything in the tor man-page that instructs me how to rebuild the path. How do you do it? 83.249.109.188 00:23, 13 October 2007 (UTC)
 * You may want to look up command line options for tor. I'm sorry, I'd look it up myself but my school would have an aneurysm if it thought I was using tor.. they're big on censorship (I don't mind much, mostly it's just blocking porn, though it's annoying not to be able to access 4chan, ytmnd, uncyclopedia, encyclopedia dramatica, etc) --⁪frotht 17:48, 13 October 2007 (UTC)

ray node traversal image
I wonder if anyone could help me find an interesting image I'd like to see?

What I'm looking for is a comparison between a ray traced scene and an image (greyscale perhaps) representing the number of BSP-boundarys/triangles/bounding boxes/sum of all traversed per ray-pixel. Anyone got or seen anything like this? Cheers83.100.254.51 17:11, 13 October 2007 (UTC)

"shopping cart" for ecommerce
My client purchased a "virtual terminal" to process credit card payments, and has asked me to find a suitable shopping cart system to allow her to process online orders on her website. Unfortunatly, to date I've only set up informational websites, so I'm out of the loop as to what to look for in a shopping cart system. I'm familiar with HTML and Java and Javascript and Perl, not so much with PHP or Mywhatever thingie MySQL (thanks, Froth), but if I sit down and write something in Perl it'll take me quite a while and she's paying by the hour, so she'd prefer to purchase something readymade and have me install it. She's looking to spend maybe $150. What are my options and how do they work? She's rather particular about the design itself, since she's an artist, rather than caring about the technical details (which is why she hires me). Kuronue | Talk 17:47, 13 October 2007 (UTC)
 * You mean MySQL. I really have no idea.. usually smallish sites will just use Google Checkout (or others)'s built in shopping cart functionality (which precludes the necessity to process your own card payments) and largish sites will make their own. It probably wouldn't be too difficult to do with non-expiring cookies so you wouldn't necessarily need mysql, but if you hope to let people log in to track their shipments, view past invoices, etc then you'll definately need it. Fully featured "shopping cart" applications that you'd buy would probably include this functionality so you'll need some sort of database server running. And I have no idea what a virtual terminal is but if it's not just an access code or something that you stick in a configuration file to make things work, then it may be difficult to get it to interact with prewritten code, or you may even have to find a particular piece of shopping cart software to fit your "virtual terminal". Whatever that is. >.> ermm --⁪frotht 17:54, 13 October 2007 (UTC)
 * I found some possibilities: http://www.zen-cart.com and http://www.x-cart.com/. They both seem to require mysql/php and of course you need your webserver set up with SSL to process payments securely (this is stupidly difficult on apache, and whether you use IIS or apache you'll need to pay Thawte or Verisign some big bucks to issue you a root-issued ssl certificate). Zen-cart is open source and hosted on sourceforge but there are just a few too many asterisks all over everything for my comfort. --⁪frotht 18:05, 13 October 2007 (UTC)
 * Oh and keep in mind that this kind of software usually acts without actually affecting your pages, to give you design flexibility. You'll likely have to make it look good yourself --⁪frotht 18:08, 13 October 2007 (UTC)
 * Designing I can do. She replied to my request for more information: she's applied for "Linkpoint Central", one of about five billion services this company offers, and I'm not too sure on the differences between them. Preliminary research indicates that she'll need Linkpoint Connect or Linpoint API, and that API seems better because it includes credit card payments and SSL, but I'm not entirely certain on that point or how they interface, if at all, with Linkpoint Central. Kuronue | Talk 18:21, 13 October 2007 (UTC)
 * oh, and she's got third-party hosting, so I'm not in charge of the server, just design and maintenance. So it's a matter of, does she need to upgrade her package or change hosts, rather than, can I implement technology on her server. It's a very small business. Kuronue | Talk 18:25, 13 October 2007 (UTC)
 * For a very small business, as this one seems to be, I believe you need a simpler solution. I suggest the online payment services that PayPal provides. Working as a volunteer, I set up online ticket sales for a small non-profit organization, but I know that the same interface provides shopping cart support. Buyers don't need to pay with a PayPal account, the service takes all the major credit cards. It is completely hosted on their site; your payment page just links to a PayPal URL. There is no startup cost at all (at least for the feature I used), they take a fee which is of the same order as normal credit-card processing fees. The $150 budget would not stretch to cover the type of programming mentioned by the other responders. With PayPal, the highest-tech operation is to generate a few hundred bytes of HTML, using their generator, and copy it into a web page. So you *do* need to know basic HTML. You don't need to know anything about SSL, because PayPal is doing all the security. You do, of course, have to trust PayPal, but for non-profit event tickets there was nothing to ship and not much chance of fraud. EdJohnston 19:13, 13 October 2007 (UTC)
 * Paypal is evil, but they probably won't target a small business for its evilness. --⁪frotht 20:02, 13 October 2007 (UTC)

cURL Login?
Hi,

I am fully aware that it is quite easy to use the Wikipedia API to do a cURL login, and have had this working perfectly and so on. However, for some random reasons (non-Wikipedia related) I need to use cURL to log in to a Wiki without using the API. I can post fine, but it refuses to remember that I've logged on.

Basically, does someone know why this POST is failing?

Builder function:

$this->ch = curl_init; $this->uid = dechex(rand(0,99999999)); curl_setopt($this->ch,CURLOPT_COOKIEFILE,'/tmp/testingphp.cookies.'.$this->uid.'.dat'); curl_setopt($this->ch,CURLOPT_COOKIEJAR,'/tmp/testingphp.cookies.'.$this->uid.'.dat'); curl_setopt($this->ch,CURLOPT_MAXCONNECTS,100); curl_setopt($this->ch,CURLOPT_CLOSEPOLICY,CURLCLOSEPOLICY_LEAST_RECENTLY_USED);

Post function: function post ($postto,$postwhat) { curl_setopt($this->ch,CURLOPT_URL,$postto); curl_setopt($this->ch,CURLOPT_POST,1); curl_setopt($this->ch,CURLOPT_FOLLOWLOCATION,1); curl_setopt($this->ch,CURLOPT_MAXREDIRS,10); curl_setopt($this->ch,CURLOPT_HEADER,1); curl_setopt($this->ch,CURLOPT_RETURNTRANSFER,1); curl_setopt($this->ch,CURLOPT_USERAGENT,'Ale_jrb'); curl_setopt($this->ch,CURLOPT_TIMEOUT,25); curl_setopt($this->ch,CURLOPT_CONNECTTIMEOUT,15); curl_setopt($this->ch,CURLOPT_POSTFIELDS, substr($this->data_encode($postwhat), 0, -1) ); return curl_exec($this->ch); }

Login function: function login ($username,$password) { $login['wpName1'] = $username; $login['wpPassword1'] = $password; $login['wpRemember'] = 1; $this->http->post('http://en.wikipedia.org/w/index.php?title=Special:Userlogin&action=submitlogin&type=login&returnto=User:Ale_jrb',$login); print_r($this->http->get('http://en.wikipedia.org/wiki/Main_Page')); }

Login call: login('Username','Password');

Thanks! A le_Jrb talk 21:13, 13 October 2007 (UTC)


 * I've never tried to do this with cURL, but if it is receiving the POST but not "remembering" the login then it sounds like a problem with not setting its login cookie correctly (or something along those lines). --24.147.86.187 00:00, 14 October 2007 (UTC)


 * I thought that, but using exactly the same post method but posting to the api.php login, it works fine (and remembers it etc.) so I don't see how that could be the problem... It makes me think that it probably isn't receiving post, but I don't know why. A le_Jrb talk  10:02, 14 October 2007 (UTC)


 * Are you able to see the response from the POST? I remember playing around with POSTing to Wikipedia awhile back and realized that it was prejudicial against certain UserAgents. --24.147.86.187 14:36, 14 October 2007 (UTC)


 * Oops - missed this! I can't get a response from the POST (that I'm aware) but the headers from the GETs are:
 * Using API:

HTTP/1.0 200 OK Date: Tue, 16 Oct 2007 17:55:54 GMT Server: Apache X-Powered-By: PHP/5.2.1 Set-Cookie: enwiki_session=561064099f9b0c165ef68e71935bba49; path=/ Content-Language: en Vary: Accept-Encoding,Cookie Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: private, s-maxage=0, max-age=0, must-revalidate Last-Modified: Tue, 16 Oct 2007 16:55:24 GMT Content-Length: 53353 Content-Type: text/html; charset=utf-8 X-Cache: MISS from sq27.wikimedia.org X-Cache-Lookup: MISS from sq27.wikimedia.org:3128 X-Cache: MISS from sq34.wikimedia.org X-Cache-Lookup: MISS from sq34.wikimedia.org:80 Via: 1.0 sq27.wikimedia.org:3128 (squid/2.6.STABLE13), 1.0 sq34.wikimedia.org:80 (squid/2.6.STABLE13) Connection: close


 * Using Special:Login:

HTTP/1.0 200 OK Date: Tue, 16 Oct 2007 17:56:56 GMT Server: Apache X-Powered-By: PHP/5.1.4 Content-Language: en Vary: Accept-Encoding,Cookie Expires: Thu, 01 Jan 1970 00:00:00 GMT Cache-Control: private, s-maxage=0, max-age=0, must-revalidate Last-Modified: Tue, 16 Oct 2007 16:55:24 GMT Content-Length: 52109 Content-Type: text/html; charset=utf-8 X-Cache: MISS from sq27.wikimedia.org X-Cache-Lookup: MISS from sq27.wikimedia.org:3128 X-Cache: MISS from sq36.wikimedia.org X-Cache-Lookup: MISS from sq36.wikimedia.org:80 Via: 1.0 sq27.wikimedia.org:3128 (squid/2.6.STABLE13), 1.0 sq36.wikimedia.org:80 (squid/2.6.STABLE13) Connection: close


 * Any ideas? Thanks! A le_Jrb talk  18:00, 16 October 2007 (UTC)


 * Nevermind, solved it now! A le_Jrb talk  19:02, 16 October 2007 (UTC)

Content-Type and XHTML 1.1
Whenever I send a Content-Type of "application/xhtml+xml", Firefox fails to render my background image. Why is that? --wj32 talk 23:47, 13 October 2007 (UTC)
 * Never mind, I found a good answer here: --wj32 talk 00:20, 14 October 2007 (UTC)