The standalone version is more up to date and is here:Ibidem wrote: Did some poking at this (or rather the other version of this), and it works...except it stops halfway through.
You need to multiply (len*channels) by 2, since a short is 2 bytes.
(Thinking about a "multimedia edition" of toybox: include mix, wavplay, and oggplay.)
https://github.com/technosaurus/PDVorbi ... oggplay2.c
I started using google's DNS servers lately because my ISP (a major cable company) has really slow and sometimes incorrect responses. This reminded me of what a PITA it is to simply translate a host name into an IP address for a wget-like tool, so I wrote a simple host->IP function
http://murga-linux.com/puppy/viewtopic. ... 724#810724
Switching to this drastically shrunk the size of my static build and the query time went from 500ms to about 20ms using google dns, but then I realized that it bypasses /etc/hosts ... kind of bad but useful for making a local caching CDN instead of the hacky version I did here:
http://www.murga-linux.com/puppy/viewtopic.php?t=82639
But this got me wondering how DNS caching works in Linux, but it turns out there isn't any by default. So now I am wondering about making one that can be used without a daemon process (those exist, but none are exactly suckless) Here is my outline:
* cached addresses are all stored in a common directory using the filesystem as a database
* blacklisting is done by making a hard link to a '0' file with "\0\0\0\0" stored as the ip address
* each hostname is first checked to see if there is a matching file name in the directory
* if the hostname exists, the ip address is read and returned,
* otherwise a DNS query is performed, IPs stored and returned
This also makes it straight forward to use groups for controlling access to sites with chgrp to make it {kid,workplace}-safe
To allow local CDN-like caching for all browsers, downloaders etc... just prepend the IP address list with 0x7F000001 (127.0.0.1) such that a local server can check its on disk cache, then use the second IP address to fetch it if not found ... maybe using the file's time stamp as the expiry time.