1] Create a .htpasswd file in the directory you want to be protected. The following example will make an user "fred" with the password you will supply.

htpasswd -c .htpasswd fred

2] Don't forget to have this in the Apache configuration file. It should be for the host you want protected.

Options FollowSymLinks
AllowOverride All

3] The following is an example .htaccess file. Something similar should be in the directory you want password protected.

AuthUserFile /full/path/to/.htpasswd
AuthType Basic
AuthName "My Secret Folder"
Require valid-user

This is an easy guide to install multilib support for Slackware64 13.37.

1] wget http://blog.malaya-digital.org/slack64-13.37-multilib.tar.bz2
2] tar xjf slack64-13.37-multilib.tar.bz2
3] su -c "upgradepkg --reinstall --install-new ./slackmultilib/*.t?z"
4] su -c "upgradepkg --install-new ./slackmultilib/slackware64-compat32/*.t?z"
5] su -c "shutdown -r now"

I've not been able to post articles recently to this blog. My free time was invested in writing code for HOPE, the CMS of Malaya Digital. Also, I made some content for the Malaya Digital website. Please visit http://www.malaya-digital.org to see what I've done. :)

Here's a Perl script that will loop to run fping, and then generate mtr and traceroute output files when an user specified packet loss threshold in the script is surpassed. Take note that this script requires fping . Here's a link to the script: icmp_check

#!/usr/bin/perl
# To stop this script, do a "touch /tmp/stopFping"
$hostToPing='www.google.com';
$packetLossThreshold=10; # Value is in percent.
$command='touch /tmp/fping.tmp';
system($command);
$command='chmod 666 /tmp/fping.tmp';
system($command);
while(!(-e '/tmp/stopFping')){
$command='fping -c 20 -q '.$hostToPing.' > /tmp/fping.tmp 2>&1';
system($command);
open(INPUTFILE, '/tmp/fping.tmp');
$packetLoss = ;
close(INPUTFILE);
chomp($packetLoss);
$packetLoss=~s/^.*\ \=\ [0-9]+\/[0-9]+\/([0-9]+)\%\,\ min.*$/$1/;
if($packetLoss ge $packetLossThreshold){
@timeStampTmp=localtime();
$timeStampFinal=sprintf("%04d-%02d-%02d-%02d%02d", $timeStampTmp[5]+1900,$timeStampTmp[4],$timeStampTmp[3],$timeStampTmp[2],$timeStampTmp[1]);
chomp $timeStampFinal;
print "We have excessive packet loss as of the moment. mtr and traceroute outputs are being generated\n";
$command='mtr -c 1 -r '.$hostToPing.' > /tmp/mtr-'.$timeStampFinal.'.txt';
system($command);
$command='traceroute '.$hostToPing.' > /tmp/traceroute-'.$timeStampFinal.'.txt';
system($command);
}
}
$command='rm /tmp/stopFping';
system($command);

1] Setup CentOS 6 64-bit as in guide (http://blog.malaya-digital.org/setup-a-minimal-centos-6-0-64-bit-setup-with-networking/). eth1 will be for the WAN while eth0 will be for the LAN. eth1 is to be set via DHCP, while eth0 should be given the IP 192.168.1.1, with netmask 255.255.255.0 and no GATEWAY and DNS settings in /etc/sysconfig/network-scripts/ifcfg-eth0. Also, I've made an /etc/sysconfig/iptables example for this setup(see it below), so you may not need to make your own firewall rules.
2] "vi /etc/sysconfig/selinux" and set "SELINUX=disabled".
3] "setenforce 0"

BIND
1] All following steps are to be done as root.
2] "yum install bind bind-chroot"
› Continue reading...

1] Make a "Desktop" install. Then setup networking using Network Manager.
2] "yum install centos-release-cr"
3] "yum update"
4] "wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-5.noarch.rpm"
5] "rpm -Uvh epel-release-6-5.noarch.rpm"
› Continue reading...

Ok, I think I got Slackware64 Linux 13.37 working fine in the basic Lenovo V460.

NOTE: This guide assumes that the notebook / laptop is connected to a wired network with a properly configured router that has a working DHCP daemon.
› Continue reading...

« Newer posts Older posts » Back to top