Mozekoze

Mozekoze

Wow, a blog..How original

Mozekoze RSS Feed
 
 
 
 

Archive for September, 2008

Make Firefox support telnet:// links in Linux

In Firefox 3.5 you have to add the following boolean
network.protocol-handler.expose.telnet
with the value False to your about:config, this will prompt you
for an application to use.
Thanks to goncheff for noticing the design-change since Firefox 3.0,
requiring different values added to about:config:
https://bugs.launchpad.net/ubuntu/+source/firefox-3.5/+bug/480502

Mounting samba-share on boot

You’ll need the “smbfs”-package for your distribution and rememer to create the mount-point first.
Add the following to your /etc/fstab, all on one line:
//127.0.0.1/folder  /media/smbshare      smbfs   username=yourusername,password=yourpassword    0 0
Of course, fill in the IP-adress, fold and username/password for your share. If you often boot without being near the samba share I would reccommend creating [...]

Converting SSL-certificates from CRT format to PEM

Dovecot, for example, seems to expect pem-files, while RapidSSL only issues crt-files. The solution? Use OpenSSL to convert (via the DER-format) to pem:
openssl x509 -in input.crt -out input.der -outform DER
then
openssl x509 -in input.der -inform DER -out output.pem -outform PEM

Adding custom signature to ClamAV

Can’t wait to get that signature accepted in the main ClamAV database? Do like this:
1) edit /var/lib/clamav/custom.ndb
2) sigtool –hex-dump a pretty unique text line from the email
3) stick Trojan.Custom.Whatever:0:*:hex output into custom.ndb
4) /etc/init.d/clamd reload
Thanks to Aeriana for the heads-up on this method!

Moving /var to a new partition

Moving /var (or whatever) on a server to another partition? Found this nifty way of using rsync to “clone” the /var directory. Afterwards just mount the new partition and pray it works:
rsync -aH /var/ /new_var

Monitor hardware-health on HP Proliant ML370 G3 with Nagios

On the server you’ll need hpasm – for RHEL4/Centos4 this is what you want.
For other distros/models, just search for HP System Health Application on hp.com.
You’ll also need hpacucli if you want checking of RAID-controllers.
For nagios you’ll need the check_hpasm plugin, found here.

Nagios and NRPE

Nice guide on installing check for remote services:
http://www.maxsworld.org/index.php/how-tos/nrpe
Only hurdle was that I had to manually add the check_nrpe command to my checkcommand.cfg file, check your nagios configuration first to make sure which file is used to define plugin-commands. For the curious, here is my command-definition:
define command{
command_name    check_nrpe
command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Also, in case you [...]

Rate-limit SMTP in iptables

Saw this in the Postfix mailing-list, I like it:
iptables -I OUTPUT -d \! “192.168.1.0/24” -p tcp –dport 25 -j DROP
iptables -I OUTPUT -d \! “192.168.1.0/24” -p tcp –dport 25 -m limit –limit 240/sec -j ACCEPT
iptables -I OUTPUT -d     “127.0.0.1/24” -p tcp –dport 25 -j ACCEPT
Explanation:
“(Rules are “in reverse order” since they are inserted.)
This [...]

DNS-blacklisting

This site covers information on blacklisting domains on your DNS-servers, used among other things to block childporn:
http://fnord.no/sysadmin/dns/dns-blacklisting/

Linux Software RAID-1 and GRUB – Installing RHEL4

The installation itself is simple, making sure you have two /boot partitions so disk-failure wont’ make it  impossible to boot, the only problem is that you’re not given the option to install GRUB to the MBR of both drives. In my case I had /dev/sda and /dev/sdb and rebooting after the install resulted in a [...]