Posts

Showing posts from April, 2007

UW to Dovecot migration

Configuration primer for a Migration from UW IMAP with pine, Thunderbird and squirrelmail as client. For compatibility the mbox format is used. A description for pine with imap acces without entering any password is also discussed. Please use dovecot 1.0beta1 or later for correct handling with pine. Short overview of Mail folders: =============================== | Used | elm | pine | Thunderbird | squirrelmail | UW imapd | dovecot | Base directoy | ~/Mail | ~/Mail | ~/mail | as configured | mail | | | Sent Folder | ~/Mail/sent | ~/Mail/sent | ~/mail/sent-mail | Sent | Sent | | | Trash Folder | ~/Mail/Trash | | - | Trash | Trash | | | Drafts Folder | ~/Mail/Drafts |

Securing Apache through SSL

SSL Configuration The previous sections introduced the (not-so-basic) concepts behind SSL and you have learned how to generate keys and certificates. Now, finally, you can configure Apache to support SSL. mod_ssl must either be compiled statically or, if you have compiled as a loadable module, the appropriate LoadModule directive must be present in the file. If you compiled Apache yourself, a new Apache configuration file, named ssl.conf , should be present in the conf/ directory. That file contains a sample Apache SSL configuration and is referenced from the main httpd.conf file via an Include directive. If you want to start your configuration from scratch, you can add the following configuration snippet to your Apache configuration file: Listen 80 Listen 443 ServerName http://www.example.com SSLEngine on SSLCertificateFile \ /usr/local/ssl/install/openssl/certs/http://www.example.com.cert SSLCertificateKeyFile \ /usr/loca/ssl/install/openssl/certs/http://www.example.com.key

BBCP another High Bandwith File Transfer Utility

BBCP is a file transfer utility currently in alpha used mainly for transferring files (Huge Files) through high Bandwidth Links. Usage To transfer the local file /local/path/largefile.tar to the remote system remotesystem as /remote/path/largefile.tar: bbcp -P 2 -V -w 8m -s 16 /local/path/largefile.tar remotesystem:/remote/path/largefile.tar Where: “-P 2” , produces progress messages every 2 seconds. “-V” , produces verbose output, including detailed transfer speed statistics. “-w 8m” , sets the size of the disk I/O buffers. “-s 16” , sets the number of parallel network streams to 16. bbcp assumes the remote system’s non-interactive environment contains the path to the bbcp utility. This can be determined by with the following command: ssh remotesystem which bbcp If this is not the case the “-T” bbcp option can be used to specify how to start bbcp on the remote system. For example: bbcp -P 2 -V -w 8m -s 16 -T 'ssh -x -a -oFallBackToRsh=no %I -l %U %H /remote/path/to/bbcp'

CP with same privileges

How to copy with same privileges cp /path/to/location/. . -prv

Howto on AutoSetOwner in RT3

This custom action sets owner of the ticket to the current user if nobody yet owns the ticket. You can use this scrip action with any condition you want, for eg On Resolve. Description: AutoSetOwner Condition: On Resolve Action: User Defined Custom action preparation code: return 1; Custom action cleanup code: # get actor ID my $Actor = $self->TransactionObj->Creator; # if actor is RT_SystemUser then get out of here return 1 if $Actor == $RT::SystemUser->id; # get out unless ticket owner is nobody return 1 unless $self->TicketObj->Owner == $RT::Nobody->id; # ok, try to change owner $RT::Logger->info("Auto assign ticket #". $self->TicketObj->id ." to user #". $Actor ); my ($status, $msg) = $self->TicketObj->SetOwner( $Actor ); unless( $status ) { $RT::Logger->error( "Impossible to assign the ticket to $Actor: $msg" ); return undef; } return 1; Template: Global template: Blank AutoSetOwnerIfAdminCc

HowTo on repairing MySQL tables

How to Repair Tables The discussion in this section describes how to use myisamchk on MyISAM tables (extensions .MYI and .MYD). You can also (and should, if possible) use the CHECK TABLE and REPAIR TABLE statements to check and repair MyISAM tables. Symptoms of corrupted tables include queries that abort unexpectedly and observable errors such as these: * tbl_name.frm is locked against change * Can't find file tbl_name.MYI (Errcode: nnn) * Unexpected end of file * Record file is crashed * Got error nnn from table handler To get more information about the error, run perror nnn, where nnn is the error number. The following example shows how to use perror to find the meanings for the most common error numbers that indicate a problem with a table: shell> perror 126 127 132 134 135 136 141 144 145 126 = Index file is crashed / Wrong file format 127 = Record-file is crashed 132 = Old database file 134 = Record was already deleted (or record file crash

How to AutoGen Users and passwd in RT3

How to auto generate users and passwords while submitting tickets through email in Request Tracker 3. Add this code to AutoReply Template: { *RT::User::GenerateRandomNextChar = \&RT::User::_GenerateRandomNextChar; if (($Transaction->CreatorObj->id != $RT::Nobody->id) && (!$Transaction->CreatorObj->Privileged) && ($Transaction->CreatorObj->__Value('Password') eq '*NO-PASSWORD*') ) { my $user = RT::User->new($RT::SystemUser); $user->Load($Transaction->CreatorObj->Id); my ($stat, $pass) = $user->SetRandomPassword(); if (!$stat) { $OUT .= "An internal error has occurred. RT was not able to set a password for you. Please contact your local RT administrator for assistance."; } $OUT .= " You can check the current status and history of your requests at: ".$RT::WebURL." When prompted, enter the following username and password: Use

How to migrate MediaWiki?

MediaWiki Migration Old Server: mysqldump -u root -p wikidb > wikidb.sql tar -cvf wiki.tar wiki ;this is the wiki folder on document root New Server: create database wikidb; this is inside mysql, Note that both mysql versions should be same. grant create, select, insert, update, delete, lock tables on wikidb.* to wiki@localhost identified by 'YourPassword' ; MediaWiki Upgrade copy all the new files to wiki folder and then run php update.php from maintenance folder after updating AdminSettings.php

Qemu virtualization

Qemu Live CD Configurations: $qemu -cdrom /dev/cdrom -boot d $qemu -cdrom xxx.iso -boot d $dd if=/dev/zero of=my_hdd.img bs=1024 count=2048000 $qemu -cdrom /dev/cdrom -hda my_hdd.img -boot d

Simple NFS in Linux

At the server Side: vi /etc/exportfs path 192.168.0.0/16 (ro) exportfs -a service portmap start service nfs start

Horde another groupware

One of my experiments with Groupware and Webmail systems. Horde Installation Horde requires some prerequisite software before you can use it. In addition, there are other software packages which, while not required, are recommended as without them you will experience very limited functionality. The following helps you to install the required and recommended software packages on a Fedora Core 4 system. Apache packages Horde is a web application, and as such, you need to provide a web server to use it. If you do not already have the Apache web server installed, you should do so at this time: yum install httpd chkconfig httpd on /etc/init.d/httpd start PHP Packages As Horde is a PHP application, it requires that you have PHP installed. In addition to the base php package, Horde and its applications require several other PHP packages. The following installs the most commonly needed PHP packages. yum install php php-xml php-imap php-devel PEAR The Fedora Core PHP package con

How to configure proxy for common linux apps

pear to use a proxy with PEAR, you should use $ pear config-set http_proxy http://proxypc.localdomain yum For yum to work you have to add these settings to /etc/yum.conf export http_proxy= http://192.168.65.253:8080 export ftp_proxy= http://192.168.65.253:8080 wget For wget to work add this to ~./bash_profile export http_proxy= http://192.168.65.253:8080 export ftp_proxy= http://192.168.65.253:8080 then run command source ~./bash_profile

How to add a disk to LVM

LVM Quick Notes First: Formatting the new Disk Suppose the Disk is /dev/sdb, the second scsi disk, fdisk /dev/sdb create as many partitions as you need using command n Label them with command t as 8e for making it Linux LVM Write and Exit with the command w. Format the partitions you require using mkfs command mkfs -t ext3 -c /dev/sdb1 LVM commands pvcreate /dev/sdb1 vgextend VolGroup00 /dev/sdb1 lvextend -L 15G /dev/VolGroup00/LogVol01 ;for extending LogVol to 15GB lvextend -L+1G /dev/VolGroup00/LogVol01 ;for adding one more GB to Logical Volume LogVol01 ext2online /dev/VolGroup00/LogVol01 ;for resizing the Logical Volumes Thats it finished Extra Instructions Creating Physical Volumes for LVM Since LVM requires entire Physical Volumes to be assigned to Volume Groups, you must have a few empty partitions ready to be used by LVM. Install the OS on a few partitions and leave a bit of empty space. Use fdisk under Linux to create