By far the worst ever year for me ended yeaterday at midnight.
Now a new year, let’s hope it’s a good one.
Lover of life, father, geek, sportsman, businessman, traveller, DIYer, optimistic, freethinker. We are one.
By far the worst ever year for me ended yeaterday at midnight.
Now a new year, let’s hope it’s a good one.
Mount a FTP share in your local filesystem is really easy. And it just makes a FTP client feel like dark age software, with a local mount you can freely use your commands over the files and folders in the share.
First install curlftpfs
cd /usr/ports/sysutils/fusefs-curlftpfs/
make install clean
edit /etc/rc.conf and add
fusefs_enable="YES"
and fire it up (actually no daemon here, just a kernel module load), you can see it with kldstat command.
/usr/local/etc/rc.d/fusefs start
Now we can happily mount FTP shares to local filesystem with the curlftpfs command.
curlftpfs ftp://user:pass@ftp.myserver.com /my/local/mount/
If you don’t want the user/pass typed in the command, and probably you don’t because it can be a bad thing ™ (out in the wild waiting for a ps done by other users…), just setup a .netrc file in your home dir with
machine ftp.myserver.com
login myuser
password mypass
then connect without the user/pass like:
curlftpfs ftp://ftp.myserver.com /my/local/mount/
UPDATE
I had some problems with this with a server that was running flawlessly for over a year and it stalled, so i don’t recommend it for production environments, must also test the asynchronous option
A fresh Qmail installation on FreeBSD is something that i have to deal once a couple of years. It´s just one of those things that i could well live without, but the time will come again and usually i can’t remember of half of my previous installation…. this is my personal installation guide to do it faster and with less effort.
Why Qmail? Why FreeBSD? Well, if you come all the way into this dark corner of the Internet, you should know the answer to both… so moving on, this is a massive, uber-geek, fully comprehensive and detailed installation guide, so it takes time and some brain damage.
CAUTION: proceed at your own risk
My PHP email validation function nowadays is:
function isEmail($value, $network_validation = true) {
// Create the syntactical validation regular expression
// (broken in 2 lines for better readability)
$regexp = "/^([_a-z0-9-]+)(\.[_a-z0-9-]+)*@".
"([a-z0-9-]+)(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/i";
// Validate the syntax
if(preg_match($regexp, $value)) {
if (! $network_validation)
return true;
$tmp = explode('@', $value);
$username = $tmp[0];
$domaintld = $tmp[1];
// Validate the domain
if (getmxrr($domaintld, $mxrecords) || checkdnsrr($domaintld, 'A'))
return true;
}
return false;
}
This is for my own reference, maybe this is all messed up, so use it at your own risk.
To generate a self signed certificate without a password just need to issue 3 commands:
openssl genrsa -out server.key 1024
openssl req -new -key server.key -out server.csr
openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
server.key -> key
server.csr => certificate signing request
server.crt => certificate
If you want to have a password protected key file just add in the first command the des3 switch:
openssl genrsa -des3 -out server.key 1024
But remember that to use it, you will be prompted with the password challenge (not a very good ideia on an Apache restart…).