September 14, 2010, 9:37 am
nginx uses similar syntax to that of Apache to allow users to access a directory, depending if their IP or username/pass matches (i.e. you want all users to present a valid username/pass match, but want to let some automated checks coming from specified IPs through, i.e. from ldirectord or nagios). Here is an example.
Continue reading ‘nginx auth – allowing IP or password-based access’ »
September 13, 2010, 4:29 pm
Sometimes, you may want some services (i.e. web) to be routed through a different interface. Here is a quick setup with some common problems.
Continue reading ‘Source port routing’ »
September 12, 2010, 2:45 pm
This piece of Perl code should get you IP address for eth0 into $ip variable:
my $ip;
my $device = "eth0";
if ((`/sbin/ifconfig $device`) =~ /inet addr:(\d+\.\d+\.\d+\.\d+)/) {
$ip = $1;
} |
If you’d also like to get a list of all aliases the device has, you could use something like:
Continue reading ‘Getting IP address and aliases in Perl’ »