<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Programming on René Moser</title><link>https://www.renemoser.net/categories/programming/</link><description>Recent content in Programming on René Moser</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Tue, 23 Dec 2008 00:00:00 +0000</lastBuildDate><atom:link href="https://www.renemoser.net/categories/programming/index.xml" rel="self" type="application/rss+xml"/><item><title>Assigning IP addresses to a geographical location</title><link>https://www.renemoser.net/blog/2008/12/23/assign-ips-to-geographical-location/</link><pubDate>Tue, 23 Dec 2008 00:00:00 +0000</pubDate><guid>https://www.renemoser.net/blog/2008/12/23/assign-ips-to-geographical-location/</guid><description>Knowing roughly where a visitor is connecting from is genuinely useful: you can send them to the shop of their own country, show events happening near them, or keep whole regions away from your SSH daemon.
It is not, however, something to build a security control on. Visitors behind a proxy in another country, behind a corporate VPN, or coming out of a Tor exit node will be placed wherever their exit point is, and mobile carriers routinely hand out addresses that geolocate hundreds of kilometres from the actual device.</description></item><item><title>Use DNS Blacklists in PHP</title><link>https://www.renemoser.net/blog/2008/12/09/use-dns-blacklists-in-php/</link><pubDate>Tue, 09 Dec 2008 00:00:00 +0000</pubDate><guid>https://www.renemoser.net/blog/2008/12/09/use-dns-blacklists-in-php/</guid><description>A DNS blacklist (DNSBL) is queried like any other DNS name: reverse the octets of the address you want to check, append the zone of the list, and resolve it. If the name resolves, the address is listed. No API keys, no HTTP client, no library — a resolver is all you need.
The snippet below checks one address against a list of DNSBL zones and stops at the first hit.</description></item><item><title>LDAP Authentication using Java</title><link>https://www.renemoser.net/blog/2008/01/15/ldap-authentication-using-java/</link><pubDate>Tue, 15 Jan 2008 00:00:00 +0000</pubDate><guid>https://www.renemoser.net/blog/2008/01/15/ldap-authentication-using-java/</guid><description>Authenticating a user against an LDAP directory does not require a framework. A plain JNDI context is enough: bind to the directory as the user with the password they supplied and let the directory server decide whether the credentials are valid.
This post was written in 2008. The JNDI API shown here is still part of the JDK and still works, but the original example connected over an unencrypted ldap:// URL, which sends the password over the network in clear text.</description></item></channel></rss>