Jump to content
Can't remember your login details? Read more... ×

stickmangumby

Atømican
  • Content Count

    14
  • Joined

  • Last visited

Community Reputation

0 Serf

About stickmangumby

  • Rank
    Serf
  1. stickmangumby

    eBay funny

    Oh wow, you're right http://www.uglycable.com.au/storefrontprof...amp;i=247375596 Rob. Heh, what are the chances of that?
  2. stickmangumby

    Using curl to POST a file to a form

    Gibberish output was simply a gzipped error message that didn't provide any useful information. I have double checked for javascript in the page containing the form, and am pretty sure there is nothing relevant. Cookie seems to be working ok as well.
  3. stickmangumby

    Using curl to POST a file to a form

    Looking to simulate a user filling out a form as follows: <form action="" enctype="multipart/form-data" method="post"> <input name="file" type="file" size="40" /> <input name="email" type="text" /> <input name="submit" type="submit" value="submit" /> </form> Using netcat to listen to a manual POST using firefox, I dumped the following: POST / HTTP/1.1 Host: 127.0.0.1 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.9) Gecko/2009042113 Ubuntu/8.04 (hardy) Firefox/3.0.9 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Language: en-us,en;q=0.5 Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7 Keep-Alive: 300 Connection: keep-alive Content-Type: multipart/form-data; boundary=---------------------------2778875461958961895357284724 Content-Length: 493 -----------------------------2778875461958961895357284724 Content-Disposition: form-data; name="file"; filename="test" Content-Type: application/octet-stream Testing... -----------------------------2778875461958961895357284724 Content-Disposition: form-data; name="email" asd@asd.com -----------------------------2778875461958961895357284724 Content-Disposition: form-data; name="submit" submit -----------------------------2778875461958961895357284724-- I've managed to get basically the same using curl by setting --header options, and using the --form option for each form field and the file to be uploaded. The only difference between the output is the Content-Length header, and the string "-----------------------------2778875461958961895357284724". My Content-Length is shorter, and the boundary string appears in hex. Posting to the actual URL doesn't work - it literally returns gibberish characters to my console, with the string "curl: (18) transfer closed with 2562 bytes remaining to read" in the middle somewhere. I am receiving, storing and returning a cookie set by my web server. Any pointers as to where I am going wrong? Am I missing something important?
  4. I'm doing some work for a client, and aren't sure how much I should be charging. The work involves building a network for public use, and protecting their current staff network from the public network. Basically, I will be: - Selecting server hardware and building server - Installing and configuring Linux, Apache and PHP - Setting up squid as a transparent proxy with delay pools - Writing a web interface for users to authenticate with the proxy - Configuring iptables to block all traffic between the public access and the staff network, and only allow processes communicating on specific ports through to the Internet - Configuring iptables for transparent proxying, and to redirect all unauthenticated users to the locally running webserver to force them to authenticate before being allowed internet access - Setting up linux on several public access PCs, and restricting what can be done on them - Setting up a wireless network for students The majority of this work will be done offsite, but part of it will be onsite. How much do you think this job is worth, at an hourly rate?
  5. stickmangumby

    Where do you buy your SSL certificates from?

    Thanks Jeruselem. They are a lot cheaper, and are included in FFs root CA store. I like!
  6. I'm looking to get an SSL certificate, but can't afford to pay through the nose for it. I know a little about SSL certificates, but not a lot. My understanding is that you can self-sign, but most browsers will now crap their pants if you do that. I want to get something that won't be flagged in customer's browsers, and obviously that will provide encryption! Verisign's cheapest certificate is $400US a year, which is way beyond my budget. I'm looking at paying around $250/year for hosting, so I can't justify spending very much on an SSL certificate. So, where do you buy your SSL certificates from, and for how much? What's the turnaround time like? Are they good to deal with? Thanks :) stickmangumby
  7. stickmangumby

    How many virtual hosts can a low spec dedicated server handle?

    So after a little looking around, the plan I'm looking at comes with 10Mbit or 100Mbit uplink ($10 more for the latter), and 750GB/month of traffic (both incoming and outgoing). 10 megabits/second = 1280 kilobytes/second, which means 750GB will last for at least 614,400 seconds ~= 170 hours ~= 7 days. So by my calculations, data allowance will be the bottleneck. Does this seem correct? Actually, on second thoughts, if each request serves an average of 32 kilobytes of data, would the server be able to maintain 40 requests per second? Of course, 10 megabits/second is a theoretical maximum, but I'm comfortable speculating to this degree of accuracy, as long as I'm not out by more than 20%!
  8. stickmangumby

    How many virtual hosts can a low spec dedicated server handle?

    Thanks guys. It sounds like limitations will be based on the network. I'll be running some kind of *nix, depends on what hosting company. Bandwidth and WAN speed also vary, but I'd expect GigE LAN so that won't be the bottleneck. I'll look into a few packages and post back with specific details. Does anyone know what an average upload bandwidth would be? Also, now that I think about it, I reckon dave_blob is on the ball with the requests/second rather than virtual hosts. My understanding of Apache is that it spawns a whole bunch of processes to handle requests, and the overhead of them serving different virtual hosts should be close to nil.
  9. Consider the following dedicated server: - P4 2.4GHz - 512MB DDR400 - 40GB HDD Approximately how many low traffic, static websites with no server side processing or database access could such a server be expected to host? Say if each site had maybe 10 visitors per day, simply viewing HTML pages and occasionally downloading small (~1MB) documents? What is the bottleneck likely to be? Will it actually be the network connection/bandwidth allowance rather than the server hardware? Is all webserver software created equal, or are some massively more efficient than others? Would this be a consideration? Thanks for the input :)
  10. stickmangumby

    Generating clean HTML output from server side code

    Thanks for the replies everyone. My main concern is the fact that I'm using helpers that are generating their own code that I want to be able to easily look at and debug. This is slow to find and hard to read when my HTML is full of misaligned tabs and awkward newlines. @dave_blob, thanks for the tip on converting tabs to spaces. I've got that going and it certainly is helpful... 8 spaces in a tab is too many in Firefox! @SledgY, I just got into Firebug on the weekend, I'll check it out. @hetman, you win at Ruby on Rails again! I just had a bit of a browse of the reference for HAML, and it looks friggen awesome. I'll give it a go tomorrow, but it seems very promising if I can get used to it :)
  11. I'm a bit of a neat freak. I like it when all my <td>'s line up and stuff. I'm trying to figure out a good method to write readable ERb templates, that produce readable HTML. I'm finding that if I want to tab-align my interpreted code, I get a whole lot of leading tabs being appended to my actual HTML output. For example: <% if @foo.value == "1" -%> <td> <% (1..5).each do |i| -%> <span> <% if i / 2 == 0 -%> <%= i * 5 %> <% else -%> <%= i -%> <% end -%> </span> <% end -%> </td> <% end -%> Produces something awful like this: <td> <span> 1 </span> <span> 10 </span> <span> 3 </span> <span> 20 </span> <span> 5 </span> </td> As you can imagine, when you're iterating through table cells and printing a lot of fields, either you HTML output gets messy, or your ERb templates get messy (say if you had everything from <span> to </span> on the one line). One thing I've tried, and not liked, is not indenting the <% opening tags, and indenting the code within them. However, with a tab width of 2, and the fact that one uses both <% and <%- opening tags, this doesn't really help much. Does anyone have any wisdom to share?
  12. stickmangumby

    How do I use variables as 'method pointers' in Ruby?

    +1 to hetman! Thanks, that was exactly what I needed to know, and also filled in a few gaps :)
  13. I've got a bit of background in programming, but am new to Ruby and don't program in OO languages very much. I'm looking to clean up the following code: if @timeframe == 'day' @next_period = @start_period + 1.day @previous_period = @start_period - 1.day elsif @timeframe == 'week' @next_period = @start_period + 1.week @previous_period = @start_period - 1.week elsif @timeframe == 'month' @next_period = @start_period + 1.month @previous_period = @start_period - 1.month end I want to do something like this: @next_period = @start_period + 1.@timeframe Is it possible to use a variable as a 'method pointer' (dunno about my terminology!)? How do I parse @timeframe to the right kind of object to use to do this?
×