Search Results

Search found 7 results on 1 pages for 'djb'.

Page 1/1 | 1 

  • How can I whitelist a user-agent in nginx?

    - by djb
    I'm trying to figure out how to whitelist a user agent from my nginx conf. All other agents should be shown a password. In my naivity, I tried to put the following in before deny all: if ($http_user_agent ~* SpecialAgent ) { allow; } but I'm told "allow" directive is not allowed here (!). How can I make it work? A chunk of my config file: server { server_name site.com; root /var/www/site; auth_basic "Restricted"; auth_basic_user_file /usr/local/nginx/conf/htpasswd; allow 123.456.789.123; deny all; satisfy any; #other stuff... } Thanks for any help.

    Read the article

  • How to whitelist a user agent for nginx?

    - by djb
    I'm trying to figure out how to whitelist a user agent from my nginx conf. All other agents should be shown a password prompt. In my naivity, I tried to put the following in before deny all: if ($http_user_agent ~* SpecialAgent ) { allow; } but I'm told "allow" directive is not allowed here (!). How can I make it work? A chunk of my config file: server { server_name site.com; root /var/www/site; auth_basic "Restricted"; auth_basic_user_file /usr/local/nginx/conf/htpasswd; allow 123.456.789.123; deny all; satisfy any; #other stuff... } Thanks for any help.

    Read the article

  • 403 error with codeignitor

    - by DJB
    When I type in the standard web address for my site, I get a 403 error. However, when I type in a more exact address, say pointing to an index.php file, everything shows up fine. I'm using Anodyne Productions' Nova (SMS 3) which uses codeignitor. All accompanying software (PHP/MySQL) is compatible. I'm not a very technical person, so I'm hoping that this is an easy fix. Thanks for taking the time to answer.

    Read the article

  • How to quickly generate a new string hash after concatenating 2 strings

    - by philcolbourn
    If my math is right, I can quickly generate a new hash value for the concatenation of two strings if I already have the individual hash values for each string. But only if the hash function is of the form: hash(n) = k * hash(n-1) + c(n), and h(0) = 0. In this case, hash( concat(s1,s2) ) = k**length(s2) * hash(s1) + hash(s2) eg. h1 = makeHash32_SDBM( "abcdef", 6 ); h2 = makeHash32_SDBM( "ghijklmn", 8 ); h12 = makeHash32_SDBM( "abcdefghijklmn", 14 ); hx = mod32_powI( 65599, 8 ) * h1 + h2; h1 = 2534611139 h2 = 2107082500 h12 = 1695963591 hx = 1695963591 Note that h12 = hx so this demonstrates the idea. Now, for the SDBM hash k=65599. Whereas the DJB hash has k=33 (or perhaps 31?) and h(0) = 5381 so to make it work you can set h(0) = 0 instead. But a modification on the DJB hash uses xor instead of + to add each character. http://www.cse.yorku.ca/~oz/hash.html Is there another technique to quickly calculate the hash value of concatenated strings if the hash function uses xor instead of +?

    Read the article

  • Can I configure a DNS cache not to forward AAAA queries?

    - by itsadok
    I'm setting up an internal DNS cache because my firewall is having trouble handling all the sessions created by DNS requests. I tried using bind9, dnsmasq and DJB dnscache, they all help reduce the number of requests leaving my network, but there are still a lot of request being made. Looking at the log files, and tcpdump and dnstop outputs, it seems that requests that return SERVFAIL do not get cached at all. And a lot of those failed requests are AAAA requests, which is a shame, because I do not have ipv6 enabled on any server. I've looked at several ways to help the situation, and I think if I could somehow prevent AAAA record requests from being forwarded by the DNS cache, it would reduce the number of requests significantly. The closest thing I found was the filter-aaaa-on-v4 option in BIND9. However, this only removes the record from the server response, and does not prevent it from forwarding it. Any help would be appreciated.

    Read the article

  • Alternative to Daemontools (djbtools) to supervise unix processes?

    - by Stefan Lasiewski
    I've used Daemontools to provide a simple and reliable way to supervise Unix services on my servers. It works well, but it requires a different way of thinking (The DJB Way) and some common complaints are: TAI64N based timestamps Doesn't store scripts under /etc/init.d (or (/usr/local)/etc/rc.d) Doesn't always work with scripts like apachectl. Some scripts need to be rewritten. I remember that some similar "supervisor/watchdog" daemons were in the works about two years ago, but some were still a little rough around the edges. If you have switched from Daemontools to something else, what did you choose and did it work well for you? Does RedHat or Ubuntu come with any process supervisor utilities by default?

    Read the article

  • Why is this not a bug in qmail?

    - by jemfinch
    I was reading DJB's "Some thoughts on security after ten years of Qmail 1.0" and he listed this function for moving a file descriptor: int fd_move(to,from) int to; int from; { if (to == from) return 0; if (fd_copy(to,from) == -1) return -1; close(from); return 0; } It occurred to me that this code does not check the return value of close, so I read the man page for close(2), and it seems it can fail with EINTR, in which case the appropriate behavior would seem to be to call close again with the same argument. Since this code was written by someone with far more experience than I in both C and UNIX, and additionally has stood unchanged in qmail for over a decade, I assume there must be some nuance that I'm missing that makes this code correct. Can anyone explain that nuance to me?

    Read the article

1