Saturday, March 14, 2009

dbmail and database default character set

I migrated my mailserver to another server recently. I installed dbmail from scratch and restored my database into new mysql server. When I started dbmail to connect to the database server, I found out in syslog (see below) that the dbmail-imapd couldn't connect to the server because of the different character set. It's a FATAL error!. I found out that my old database used latin1 as the default character set and dbmail used utf8 as I defaulted in /etc/dbmail.conf. So I just change the default character set of my dbmail database in MySQL to utf8 (see below). This solved the problem.

In syslog before changing the character set:
Mar 14 13:01:54 webmail.fakedomain.com.my dbmail-imapd[13986]: Error:[sql] dbmysql.c,db_mysql_check_collations(+138): collation mismatch, your MySQL configuration specifies a different charset than the data currently in your DBMail database.
Mar 14 13:01:54 webmail.fakedomain.com.my dbmail-imapd[13986]: FATAL:[server] server.c,StartServer(+129): Unable to connect to database.

To change default character set of a dbmail database:
ALTER DATABASE dbmail DEFAULT CHARACTER SET utf8;

In syslog after changing database default character set:
Mar 15 13:20:29 webmail dbmail/imap4d[14107]: Message:[server] pool.c,child_register(+299): register child [14107]
Mar 15 13:20:29 webmail dbmail/imap4d[14109]: Message:[server] pool.c,child_register(+299): register child [14109]
Mar 15 13:20:29 webmail dbmail/imap4d[14111]: Message:[server] pool.c,child_register(+299): register child [14111]
Mar 15 13:20:29 webmail dbmail/imap4d[14113]: Message:[server] pool.c,child_register(+299): register child [14113]
Mar 15 13:20:29 webmail dbmail/imap4d[14101]: Message:[server] pool.c,scoreboard_state(+590): Scoreboard state:children [4/10], spares [4 (2 - 4)]

Thursday, February 26, 2009

packagekit and Mandriva Cooker

I use Mandriva Cooker. A bleeding edge distro. packagekit is the latest offering from Mandriva for package management. Coupled with KDE's kpackagekit, it integrates nicely with KDE 4. It's still not recommended for general though. The interface is confusing for first time user. Every button can be clicked while the other process running and it crashes often. Please use Mandriva Control Center for it.

Let's see some screenshots of it.







Thursday, February 5, 2009

Login with admin privilege can make matters worse

Many windows users don't know that they login with administrator privileges. When viruses or worms attack, they use the user's privileges and they can make a catastrophe.

A new analysis claims that over 90% of the Windows security vulnerabilities reported last year were made worse by users logged in with administrative privileges -- an issue Microsoft has been hotly debating recently.

BeyondTrust Corp. (BTC), a software development company specializing in enterprise rights management, has indicated that the act of giving users administrative rights may leave systems more open to risk.

The report issued by BTC was prepared by assessing security vulnerability bulletins released by Microsoft in 2008, and identifying specific "mitigating factors" (those that could reduce or negate the risk of an attack) within the bulletin. If Microsoft reported that having fewer security privileges would negate or eliminate risk, BTC concluded that the vulnerability was admin-privilege related.

The result of the analysis of the 154 critical Microsoft vulnerabilities indicated that a full 92% could have been prevented if users were not logged into their systems with administrator status. BTC believes that restricting the number of users who can log in with these privileges will "close the window of opportunity" for attackers. This is particularly true for users of Internet Explorer and Microsoft Office. (Source: computerworld.com)

Microsoft has been relatively transparent in their revelation of security vulnerabilities, and has worked with organizations such as Cert.org to identify and address security concerns to the online community. (Source: cert.org)

While Microsoft is not denying the vulnerabilities present in its various Windows operating systems, they have not been exactly forthright about how internal programming "holes" (such as increased vulnerability for users with admin privileges) may make users susceptible to threats or attacks.

I think Microsoft users should be told that using admin privilege accounts is a potential security risk. I found out that many of them don't want to use normal/limited account for their daily account.

Linux users always use ordinary account (non-root acount) to do tasks that do not require admin/root privileges. Ubuntu users for example used to sudo command to do admin tasks like installing packages, upgrade packages etc. Other Linux users are very familiar with su command to do the same tasks. Certain apps will warn you if you run them as admin (ie root). This way Linux users reduce the risks of being infected or attacked by viruses, worms and other types of malwares.

Source

Thursday, January 22, 2009

How to setup a https server with apache

Setting up an https server in Apache is easier by watching video. Don't you agree? :)

Saturday, January 10, 2009

Linux 2.6.28's five best features

Created Jan 9 2009 - 3:29pm

While you were likely to be opening up Christmas presents, Linus Torvalds was giving Linux users around the world a special present: the release of the next major Linux kernel: Linux 2.6.28 [1].

We had some time to tinker with this latest and greatest Linux, and it's my kind of Christmas present: solid improvements to my favorite operating system. Here are the five features that I think most of us will appreciate the most as we move into the New Year.


1) Ext4

The next step up in Linux file systems, has finally arrived. Ext4 [2] improves, well, everything about hard drive storage. It gives you larger file-system and file sizes, faster I/O, better journaling, and it can defragment your drive on the fly.

In particular, its delayed allocation functionality greatly improves hard disk write performance. This won't help your PC hard drive that much, but if you're running a database server, you'll see significant improvements. How fast is 'significant?' In my informal tests with MySQL 5.0, I saw write-speed boosts of approximately 30% on a 400GB database. Try it yourself on your servers, you'll be impressed. In addition, since Ext4 can handle up to 1024 petabytes per volume. I expect Ext4 and Sun's ZFS are going to be fighting it out for top server file-system for the next ten-years.


2) GEM Memory Manager for Graphics

Linux is finally getting decent support from the major graphic vendors, like ATI [3] and NVIDIA [4]. That's great, if you have a high-end graphics card with its own memory and processor. But, say you're like the rest of us without much money and you're using the graphics that are built into your motherboard? Linux will run fine on your PC, but your graphics won't be that fast. Until now.

With Linux 2.6.28, GEM (Graphics Execution Manager [5]) Linux finally includes a graphics memory manager. This will matter your graphics memory whether it's on a dedicated card or part of your main memory. By providing a central, common memory manager, GEM enables even ordinary graphics, like the popular and cheap Intel 915 chipset, to run 50% faster [6]. That's a performance boost that anyone can see.

GEM is still very much a work in progress. At this time, only the 915 is fully supported. Other graphic chip developers though are already hard at work getting their drivers to work with GEM. This graphics memory manager will not only make their lives easier, it will also deliver much faster performance for both low-end and top-of-the-line desktop users. In short, GEM may not be much now, but it's going to be a win-win for everyone by this summer.


3) Disk Shock Protection

Ever drop a laptop? I have. So far, I've been lucky and I have smacked a hard drive silly. Laptop vendors know they can't count on everyone being lucky so they've been incorporating drop protection into their notebooks and netbooks.

This works by moving the hard drive read/write heads away from the disk if the laptop detects that it's moving quickly and is likely to be slamming on the floor in a few milliseconds. Until now, though, Linux didn't know a thing about this kind of protection. So, you could end up with Linux trying to get the drive heads to write while the drive firmware was trying to move the out of the way before laptop and concrete had a sudden, violent meeting. Now, Linux will work with most of these fumble-finger proof hard drives. Speaking for klutzes everywhere, I'd like to say thank-you.


4) Staging Drivers

Did you ever want to use a device for Linux where there was 'some' support for it, but it wasn't good enough to be in the main kernel? If you use a lot of new hardware, you've probably been there. As Jake Edge reports [7], "There has been an ongoing struggle between those who want to see drivers get included as quickly as possible versus those who want to see them approach or attain normal kernel quality levels first." He's got that right.

Greg Kroah-Hartman, who has been leading Linux hackers' efforts to create drivers [8], created the -staging tree for these, not quite ready for prime-time drivers. You don't have to use them, but they're available there if you need them. For example, I wanted access to USB/IP. This driver enables you to USB devices over a TCP/IP network. I'm using it to access printers that are attached to a Belkin Network USB Hub [9]. Is it perfect? No. But it does let me get to those printers so that's a win in my book.


5) Network improvements

The 2.6.28 kernel includes new support for UWB (Ultra Wide Band), Wireless USB, UWB-IP, and Nokia's mobile phone Phonet Network Protocol. That's all well and good, but unless you're one of the few who work with UWB or Phonet, I'm not sure how important that will be. I do think Wireless USB will end up being a big deal. That said, what I think is easily the neatest improvement in 2.6.28's improved networking is that it now supports the minstrel Wi-Fi rate control [10].

Chances are you haven't heard about minstrel. Once you have it on your Wi-Fi equipped computer though you'll wonder how you ever lived without it. Minstrel keeps a constant watch on which Wi-Fi AP (access points) in your area are delivering the fastest possible performance and automatically hook you up with it. With minstrel, you're pretty much guaranteed to always get the best Wi-Fi connection that's available. I like this. I like this a lot. Frankly, based on what I've been seeing while using it with my Linux-powered ThinkPad R61, I'd upgrade to 2.6.28 for this feature alone.

So, my advice to you, is that it any of this sounds good, you can either upgrade your PC to Linux 2.6.28 manually, which is what I did, or you can start encouraging your favorite Linux distribution group to move to 2.6.28 sooner rather than later. You'll be pleased you did.



Source URL:
http://blogs.computerworld.com/linux_2_6_28s_five_best_features

Links:
[1] http://lkml.org/lkml/2008/12/24/105
[2] http://ext4.wiki.kernel.org/index.php/Main_Page
[3] http://practical-tech.com/infrastructure/amd-partners-with-novell-to-open-source-ati-graphic-drivers
[4] http://www.nvidia.com/object/unix.html
[5] http://lwn.net/Articles/283793
[6] http://lwn.net/Articles/283798
[7] http://lwn.net/Articles/301192
[8] http://practical-tech.com/infrastructure/linux-hackers-offer-to-create-device-drivers-for-free
[9] http://www.belkin.com/networkusbhub
[10] http://wireless.kernel.org/en/developers/Documentation/mac80211/RateControl/minstrel

Sunday, December 21, 2008

How to connect to the internet using Celcom Broadband Modem

Luckily, I got my hand on my friend's Celcom Broadband USB HSDPA Modem. The model is E220. Fortunately on Mandriva, you don't need to type a command. It's all in the comfort of GUI.

below is the step-by-step process:

1. Open MCC (Mandriva Control Center) and then select Network & Internet (left frame) and then open Setup a new network interface.


2. Select GPRS/Edge/3G and click Next button.


3. The device should be shown and selected here. If not, you have to check whether Linux detected it using lsusb command. In many cases, this shouldn't be a problem for Linux detecting a USB device. Then click the Next button.


4. It will ask you for PIN number. One problem here. You have to enable PIN Protection for your card by going into MS Windows and use the software provided by TM to enable the PIN Protection. It is disabled by default. If it is disabled, you will get error after this even the PIN number is correct. After enable the PIN Protection, you can boot back into Linux and enter the PIN number as in the pic below. Then click Next.


5. This dialog opens and you can just click Next.


6. Select the option as below and then click Next.


7. For dialog as below, just leave all fields blank. Click Next.


8. Finish. A window will appear telling you that the settings has been configured successfully. Click Finish button to close it.

9. You can see the /var/log/messages on what's been going on and important info like IP address, APN, netmask, gateway and handshakes during the connection process.

Example log:
Dec 21 23:50:42 localhost ifup-ppp: pppd started for ppp0 on /dev/ttyUSB0 at 115200
Dec 21 23:50:42 localhost pppd[2605]: pppd 2.4.4 started by root, uid 0
Dec 21 23:50:49 localhost pppd[2605]: Serial connection established.
Dec 21 23:50:49 localhost pppd[2605]: Using interface ppp0
Dec 21 23:50:49 localhost pppd[2605]: Connect: ppp0 <--> /dev/ttyUSB0
Dec 21 23:50:53 localhost pppd[2605]: Could not determine remote IP address: defaulting to 10.64.64.64
Dec 21 23:50:53 localhost pppd[2605]: local IP address 10.58.182.246
Dec 21 23:50:53 localhost pppd[2605]: remote IP address 10.64.64.64
Dec 21 23:50:53 localhost pppd[2605]: primary DNS address 202. 188.0.133
Dec 21 23:50:53 localhost pppd[2605]: secondary DNS address 202.188.1.5

That's all there is to it. Good luck guys!

Friday, December 12, 2008

Queuegraph - a RRDtool frontend for Postfix queue-statistics

queuegraph is a very simple mail statistics RRDtool frontend for Postfix that produces daily, weekly, monthly and yearly graphs of Postfix's active, deferred, incoming and bounce queues.The postfix's queue is usually in /var/spool/postfix. queuegraph is created by Ralf Hildebrandt and based on mailgraph by David Schweikert. Below is the dirs in my system:

# ls /var/spool/postfix/
active/ corrupt/ deferred/ etc/ flush/ incoming/ maildrop/ postgrey/ public/ tmp/ var/
bounce/ defer/ dev/ extern/ hold/ lib64/ pid/ private/ saved/ trace/
#

In connection with qshape it can be used to find out if your server is having performance issues:
  • a large deferred queue indicates delivery problems
  • a large active queue points to slow destinations (e.g. a content_filter)
You can download queuegraph here.

Before you download it, pls check the requirements:
  • rrdtools (Mandriva users: urpmi rrdtool)
  • librrds-perl (Mandriva users: urpmi perl-rrdtool)
After finish downloading it, extract it: tar xzvf queuegraph.tar.gz
List down the extracted files: ls -l (see below)

# ls
queuegraph.cgi* queuegraph-rrd.sh* README
#

Create a cronjob that runs queuegraph-rrd.sh every minute -- this populates the *.rrd database:

* * * * * /usr/local/bin/queuegraph-rrd.sh

Note: On Mandriva, i created a dir under /etc named cron.minutes and copied file queuegraph-rrd.sh into it: cp queuegraph-rrd.sh /etc/cron/minutes

And then I edited crontab by adding this line:
* * * * * root nice -19 run-parts --report /etc/cron.minutes

Then I copied queuegraph.cgi into the cgi-bin directory of my webserver: cp queuegraph.cgi /var/www/cgi-bin/ or where your webserver's cgi directory is (consult your distro manual.) Then chmoded it to 755 so that my webserver can run it: chmod 755 queuegraph.cgi

To see the statistics created by queuegraph, point your web browser to http://yourwebseraddress/cgi-bin/queuegraph.cgi

This is the graph for my postfix queue (without the Month and Year graph):


That's all there is to it.

Nvidia new hotplug feature on Linux

 If you use nvidia driver for your GPU, you probably wonder why in some config, you can't hotplug your second monitor. You need to reboo...