a little reminder

If you ever need to download an entire Web site, perhaps for off-line viewing, wget can do the
job—for example:

$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--restrict-file-names=windows \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
This command downloads the Web site www.website.org/tutorials/html/.

The options are:

--recursive: download the entire Web site.

--domains website.org: don't follow links outside website.org.

--no-parent: don't follow links outside the directory tutorials/html/.

--page-requisites: get all the elements that compose the page (images, CSS and so on).

--html-extension: save files with the .html extension.

--convert-links: convert links so that they work locally, off-line.

--restrict-file-names=windows: modify filenames so that they will work in Windows as well.

--no-clobber: don't overwrite any existing files (used in case the download is interrupted and
resumed).

FreeBSD 8.0 dumps

kernel dumps? no worriez
disable them by
sysctl -w kern.coredump=0
sysctl -wkern.corefile=/dev/null

or enable with
sysctl -w kern.coredump=1
sysctl -w kern.corefile="/var/tmp/%U.%N.core"

FreeBSD and console logging

Most of FreeBSD's i have are servers without X11 or any desktop environment and as i know from previous Linux situations many informations are outputed on the console tty, so you kinda need to have a monitor turned on and mandatory have to be present there to read it... so FreeBSD has a very nice way to help us: /var/log/console.log!
It's not enabled by default but:

# touch /var/log/console.log
# chmod 600 /var/log/console.log
# vim /etc/syslog.conf

And uncomment the setting: console.info /var/log/console.log

# /etc/rc.d/syslogd restart

FreeBSD Lighttpd with both PHP 5.3.2 and 5.2.13

install PHP 5.3.2 normally using ports and get PHP 5.2.x fron php.net and configure it like so with CGI(for lighty):

./configure --enable-fastcgi --with-zlib --with-layout=GNU --with-config-file-path=/usr/local/bin/php5.2/etc/addini --with-config-file-scan-dir=/usr/local/bin/php5.2/etc --build=amd64-portbld-freebsd7.2 --with-mysql=/usr/local/bin/mysql --with-mysqli=/usr/local/bin/mysql_config --with-curl=/usr/local/include --prefix=/usr/local/bin/php5.2

so from this php will get it's php.ini config file from /usr/local/bin/php5.2/etc (/usr/local/bin/php5.2/etc/php.ini) and the additional ini will be phrased from /usr/local/bin/php5.2/etc/addini (so an extensions.ini: /usr/local/bin/php5.2/etc/addini/extensions.ini)

edit Lighttpd config file and change the php binary path as:
"bin-path" => "/usr/local/bin/php5.2/bin/php-cgi",


this post will be edites as i go along

vs. hackers

Well.. we all know how "hacking" basically occurs, bunch of ./ kids with some pretty interesting tools in their hands get the best of us... It's the case of big hosting providers also, nobody is safe these days... There's still hope! never give up to bad guys... In a weekly logs check i've discouvered several interesting hacking attempts on several domains hosted on my server. It seems like a automated scan&hack tool to check of miss configured servers or bugged software...
This time asking and getting a response regarding this issue was prompt after sending the ISP(hosting provider) a mail. The logs started like:

69.89.31.210 www.pgn.ro - [25/Nov/2009:23:47:59 +0200] "GET /index.php?c=../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../etc/resolv.conf HTTP/1.1" 200 3211 "-" "libwww-perl/5.831"
69.89.31.210 www.pgn.ro - [25/Nov/2009:23:48:00 +0200] "GET /index.php?c=../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../../etc/resolv.conf HTTP/1.1" 200 3211 "-" "libwww-perl/5.831"


they didn't get through that's for sure... but still why cant we stop this action form happening (at least from the host in question). Many network administrators, in my oppinion anyway, find it easyer to deal the threat by making sure the hackers didn't get in and that's it... well all have a common idea that even if contacting the ISP it won't be enough... but sometimes it really counts, making sure that the hackers have a real fight on their hands so that it may be a real war for them to continue on...

Hello,

Thank you for the report of this activity. This type of activity is not
allowed by our terms of service. We have been able to identify several
shared hosting accounts on this and other IP addresses that appear to have
been infected with badware designed to infect yet more sites. We have
initiated appropriate action according to our terms of service agreement
with our account holders.

Please do not hesitate to contact us again if you detect further intrusion
attempts from our network.

Thank you,

Jeff
Tech Support Engineer
BlueHost.com
888.401.4678


It really pays off to see that working together could and can make a difference

IE vs restu' lumii

IE6 sux big time, IE7 sux a lil' bit, and IE8 tryes to keep the smell away from the average user... So what's to do? I mean i'm a FF fan but what about those that don't ever use IE or just use it occasionally? Here's just a few ideas why there's a difference between browsers:
1. IE6 does not support .png images
2. IE6 alignment is a bitch (don't ask)
3. IE6 CSS and XHTML standards sux...
4. Basically IE SUX!

Solutions? Well there might be some ... like creating stylesheets to match each browser demands...
Example:


<html>
<head>
<title>Do you see this page right?</title>

<![if !IE]>
<link rel="stylesheet" href="/css/OTHERStemplate.css" type="text/css" />
<![endif]>

<!--[if IE]>
<link rel="stylesheet" href="/css/IEtemplate.css" type="text/css" />
<![endif]-->

</head>
<body>
.....



Microsoft actually gave us some adivces in using IF so here's a basic "Browser quiz" to determinate some conditions:

<!--[if IE]><p>You are using Internet Explorer.</p><![endif]-->
<![if !IE]><p>You are not using Internet Explorer.</p><![endif]>

<!--[if IE 7]><p>Welcome to Internet Explorer 7!</p><![endif]-->
<!--[if !(IE 7)]><p>You are not using version 7.</p><![endif]-->

<!--[if gte IE 7]><p>You are using IE 7 or greater.</p><![endif]-->
<!--[if (IE 5)]><p>You are using IE 5 (any version).</p><![endif]-->
<!--[if (gte IE 5.5)&(lt IE 7)]><p>You are using IE 5.5 or IE 6.</p><![endif]-->
<!--[if lt IE 5.5]><p>Please upgrade your version of Internet Explorer.</p><![endif]-->

<!--[if true]>You are using an <em>uplevel</em> browser.<![endif]-->
<![if false]>You are using a <em>downlevel</em> browser.<![endif]>

<!--[if true]><![if IE 7]><p>This nested comment is displayed in IE 7.</p><![endif]><![endif]-->

Change the location of mysql database

FreeBSD

You want to change the location of the mysql databases which is by default /var/db/mysql.

safe_mysqld
If you start the mysql deamon with '/usr/local/bin/safe_mysqld' than you can just edit
this script and change the variable (it's in the begining of the script) 'DATADIR'.

mysqld
If you start the mysql deamon with 'mysqld':



Make a 'my.cnf' file, put it in /usr/local/etc and make sure it looks like this:

[client]
port = 3306
socket = /tmp/mysql.sock

# The MySQL server
[mysqld]
port = 3306
socket = /tmp/mysql.sock
skip-locking
set-variable = key_buffer=16M
set-variable = max_allowed_packet=1M
set-variable = thread_stack=128K
datadir = [datadir]
# Start logging
log

[mysqldump]
quick
set-variable = max_allowed_packet=16M

[mysql]
no-auto-rehash

[isamchk]
set-variable = key_buffer=16M


MySQL reads default options from the following files on Unix:

Filename Purpose
--------------------------------------------
/etc/my.cnf Global options
DATADIR/my.cnf Server-specific options
~/.my.cnf User-specific options

The following programs support option files:

mysql,
mysqladmin,
mysqld,
mysqldump,
mysqlimport,
mysql.server,
myisamchk,
myisampack.

You can use option files to specify any long option that a program supports! Run the
program with --help to get a list of available options.

An option file can contain lines of the following forms:

#comment
Comment lines start with `#' or `;'. Empty lines are ignored.
[group]
group is the name of the program or group for which you want to set options. After a
group line, any option or set-variable lines apply to the named group until the end
of the option file or another group line is given.

option=value
This is equivalent to --option=value on the command line.

set-variable = variable=value
This is equivalent to --set-variable variable=value on the command line. This syntax
must be used to set a mysqld variable.

The client group allows you to specify options that apply to all MySQL clients (not
mysqld). This is the perfect group to use to specify the password you use to connect to
the server. (But make sure the option file is readable and writable only to yourself.)

Note that for options and values, all leading and trailing blanks are automatically deleted.
You may use the escape sequences `\b', `\t', `\n', `\r', `\\' and `\s' in your value
string (`\s' == blank).

If you have a source distribution, you will find sample configuration files named
`my-xxxx.cnf' in the `support-files' directory. If you have a binary distribution, look in
the `DIR/share/mysql' directory, where DIR is the pathname to the MySQL installation
directory (typically `/usr/local').

See mysqld --help for more options