Aug/100
sendmail[2525]: My unqualified host name (servername) unknown
If you see these messages in your syslog, your sendmail is not configured correctly with the domain name. If you are sending from a fully qualified domain, add it to the local-host-names file. In Ubuntu, it would be /etc/mail/local-host-names. Make sure it reads something like this.
localhost
[domain.com]
[server name]
Now in the /etc/hosts, make sure it reads the following.
127.0.0.1 [domain.com] [server name] localhost
…
Then
sudo /etc/init.d/sendmail restart
and the error should not continue filling the syslog.
Jul/100
A beautiful plugin that creates eye pleasing social media links. This is a great example of using javascript and css to achieve aesthetics.
Apr/100
Fail2ban does not start after reboot
This problem was identified with the following configuration:
Ubuntu 8.04
fail2ban
Problem: After fail2ban install, everything works fine, but after reboot fail2ban does not start. Manual /etc/init.d/fail2ban restart fails also.
Cause: Fail2ban looks for fail2ban.sock in
/var/run/fail2ban/
During reboot, that directory is removed. Fail2ban assumes it is there and fails on restart.
Solution: Make sure the directory exists during start of fail2ban. Edit the init.d for fail2ban to fix this.
sudo vi /etc/init.d/fail2ban
Find the do_start option.
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
do_status && return 1
if [ -e "$SOCKFILE" ]; then
log_failure_msg "Socket file $SOCKFILE is present"
[ "$1" = "force-start" ] \
&& log_success_msg "Starting anyway as requested" \
|| return 2
DAEMON_ARGS="$DAEMON_ARGS -x"
fi
start-stop-daemon --start --quiet --chuid root --exec $DAEMON -- \
$DAEMON_ARGS start > /dev/null\
|| return 2
return 0
}
Add the following after the if statement.
# Assure that /var/run/fail2ban exists
[ -d /var/run/fail2ban ] || mkdir -p /var/run/fail2ban
Finally, it should look like this
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
do_status && return 1
if [ -e "$SOCKFILE" ]; then
log_failure_msg "Socket file $SOCKFILE is present"
[ "$1" = "force-start" ] \
&& log_success_msg "Starting anyway as requested" \
|| return 2
DAEMON_ARGS="$DAEMON_ARGS -x"
fi
# Assure that /var/run/fail2ban exists
[ -d /var/run/fail2ban ] || mkdir -p /var/run/fail2ban
start-stop-daemon --start --quiet --chuid root --exec $DAEMON -- \
$DAEMON_ARGS start > /dev/null\
|| return 2
return 0
}
Now restart and it should work.
sudo /etc/init.d/fail2ban restart
Just for kicks, see how /var/run has the newly created fail2ban directory.
sudo ls /var/run
Apr/100
Changing Mysql data directory require change to AppArmor
After a bit of googling and hair-pulling, I realized that if I just changed the datadir directive in my.cnf will cause mysql start to fail on Ubuntu. The other thing is to add permissions to apparmor for mysql to access the new data directories.
Steps
1. sudo vi /etc/apparmor.d/usr.sbin.mysqld
2. Add
/newdir/ r,
/newdir/** rwk,
3. sudo /etc/init.d/apparmor restart
4. sudo /etc/init.d/mysql restart
If that still does not work, check the nix permissions to be sure mysql is owner and group for the new directory recursively.
Jan/100
Selenium IDE Firefox extension for testing web applications
just came across this tool while researching testing frameworks. Selenium IDE for Firefox is essential for testing a website or web application on an actual browser. It records your actions on the browser and stores them as a test. Then the test can be run everything you want to verify the site still works correctly.
Dec/090
Ubuntu 9.10 Karmic slow Firefox
There is a bug in the IPv6 lookup in Karmic that is making any application requesting IPv6 while a NAT is not configured to respond to IPv6 respond very slowly. It is still a bug not solved at this time. Buta solution for Firefox is given here as a work around for now.
Oct/090
Setup mod rewrite on apache
Three places need to change to do this.
sudo a2enmod rewrite
Add AllowOverride All to virtual host file
Add RewriteEngine On to .htaccess
Oct/090
Sphinx Search default limit is 20
When using the sphinx api, you must use SetLimts if you want more than 20 records. Currently, it is not documented on the sphinx api doc.
Oct/090
Fatal error: Call to undefined function: curl_init in php
For some reason, my workstation with Ubuntu 9.04, php5, apache2 and php5-curl install was giving me the curl package not installed message. Well, it turns out that for some reason, my default /etc/php5/apache2/php.ini had the extension directory pointing to /usr/lib/php5/ext/ while all the extensions were in /usr/lib/php5/20060613/
I was trying to figure out why I am not seeing curl.so in the ext directory after I have apt-get installed and removed php5-curl many times. Solution is usually very simple.
Aug/090
VMware Server must be reconfigured when there is a kernel upgrade
If the linux kernel is upgraded, vmware will not load http://localhost:8222. It requires a reconfigure when this happens. Do the following.
sudo /usr/bin/vmware-config.pl
