I love Free Software!

Pages

Funny Quotes to Think

When you say "I wrote a program that crashed Windows", people just stare at You blankly and say "Hey, I got those with the system, for free"

-Torvalds, Linus(1995-03-08)-

Saturday, May 29, 2010

Sync your samba password using roundcube password plugin

Why I require this patch ?

Roundcube password plugin does not sync samba password. This patch can sync your samba password using roundcube password plugin

Apply this patch at your own risk . Dont forget to use --dry-run option before running this patch

How  to apply patch ?

  • Download patch file from download link listed below.
  • Copy patch file to directory /usr/share/roundcube/plugins/password/drivers.
  • For a safer side take a backup of your original ldap.php file.

        # cp ldap.php ldap.php.org
  • Now patch your ldap.php file.  


        #  patch -p0 < rcldappasswd.patch  
 
Where can I download this patch ?

I have uploaded the patch in below location.

Download RCLdapPatch

Saturday, May 8, 2010

Configure Modem Dial-in Debian

Install ppp and mgetty

aptitude install ppp pppconfig mgetty

Configure ppp using pppconfig

create users in /etc/ppp/pap-secrets

# client        server  secret                  IP addresses
dial-in              *       dial-in                       *


Configure /etc/mgetty/mgetty.config. if your modem is connected to /dev/ttyS0. Comment below lines

port ttyS0
  debug 3
  data-only y


Configure /etc/mgetty/dialin.config
add below lines at end of file
all

Check following lines are uncommented in /etc/mgetty/login.config
/AutoPPP/ -     a_ppp   /usr/sbin/pppd auth -chap +pap login debug

Add below lines to /etc/inittab
s0:23:respawn:/sbin/mgetty ttyS0

Now dial from your windows machine. For authentication you can use user dial-in

Tuesday, March 30, 2010

Sending HTML mails using RT web interface

Request Tracker uses templates to send mails. For replying mails RT is using Correspondence template.
Change your Correspondence templates in such a way that it use Content-Type as text/html 

Correspondence template:

Content-Type: text/html
     RT-Attach-Message: yes

     {$Transaction->Content()}

Saturday, February 6, 2010

Show or Hide html DIV based on dropdown menu selection

Java script in html will help you to show or hide div section in html based on selected value in drop down menu
You can add controls to each div section to show and hide controls based on drop down value. Below html file will explain you in deep

We have two javascripts. start() will start when you load html form and disp_div() will show and hide div section depending on your drop down value

<html>
<head>
<script language=JavaScript>
function start()
{
        var f=document.getElementById("first");
        var s=document.getElementById("second");
        var l=document.getElementById("last");
        f.style.display = 'none';
        s.style.display = 'none';
        l.style.display = 'none';
}
function disp_div() {
       var word = document.myform.distro.selectedIndex;
       var selected_text = document.myform.distro.options[word].text;
       var f=document.getElementById("first");
       var s=document.getElementById("second");
       var l=document.getElementById("last");
        if (selected_text == 'Debian'){
                 f.style.display = 'block';
                 s.style.display = 'none';
                 l.style.display = 'none';
        }else if (selected_text == 'Ubuntu'){
                f.style.display = 'none';
                s.style.display = 'block';
                l.style.display = 'none';
        }else if (selected_text == "Windows"){
                f.style.display = 'none';
                s.style.display = 'none';
                l.style.display = 'block';
        }
}     
</script>

<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>which distro you like</title>
</head>
<body bgcolor="#BDEDFF" onload="start()"><br>
<FORM NAME="myform" >
<br><font size="3" face="Times">
Select Your favourate Operating System   
<select name="distro" onchange="disp_div()">
<option value="debian">Debian</option>
<option value="ubuntu">Ubuntu</option>
<option value="win">Windows</option>
</select>
<br>
<div id="first">
<br>Avoid the Gates of Hell. Use Linux <br></div>
<div id="second">
<br>Ubuntu Linux IS user friendly... Linux for human beings <br></div>
<div id="last">
<br>Microsoft sells you Windows... Linux gives you the whole house <br></div>
</form>
</body>
</html>

Friday, January 29, 2010

Reset MySql Password

Follow below steps for reseting mysql password in Debian linux
  • Login to server as root
  • kill mysql server pid. In debain you can find pid file in /var/run/mysqld
kill `cat /var/run/mysqld/mysqld.pid`
  • Create a text file and add below sql statements to text file. Change 'password' to new password required
UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
FLUSH PRIVILEGES; 
  • Start mysql server with --init-file option 
mysqld_safe --init-file=/path/to/textfile &

Now login to mysql using new password

Friday, January 1, 2010

How to access any web application server running on different port with apache http (port 80)

Apache can handle any web server application which running on different port using its own http port
Apache uses mod_proxy to implement a proxy/cache for Apache. It implements proxying capability for FTP, CONNECT (for SSL), HTTP/0.9, HTTP/1.0, and (as of Apache 1.3.23) HTTP/1.1. The module can be configured to connect to other proxy modules for these and other protocols.

Imagine you have a webserver application running 5566. You need to access this application using apcache port 80. You can follow this steps
  • Install proxy modules for apache, if it is not installed  
# aptitude install libapache2-mod-proxy-html
  • Enable proxy modules for apache
Change to directory /etc/apache2/mods-available and enable module
 # a2enmod proxy

Reload apache service
# invoke-rc.d apache2 reload
  • Create a new apache virtual host to access web server application using mod_proxy
Here is I am including a virtualhost configuration to access a webserver  which running on port 5566 using apache port 80

<VirtualHost *:80>
         ServerName example.org
          ServerAlias www.example.org
          ProxyRequests Off
        <Proxy *>
          Order deny,allow
          Allow from all
        </Proxy>

          ProxyPass / http://localhost:5566/
          ProxyPassReverse / http://localhost:5566/
        <Location />
          Order allow,deny
          Allow from all
        </Location>
      </VirtualHost>

Wednesday, December 30, 2009

How to configure bridge in Debian

A bridge connects two or more different physical ethernets together to form one large (logical) ethernet.
The physical ethernets being connected together correspond to network interfaces in your linux box. The bigger (logical) ethernet corresponds to a virtual network interface in linux


Install package bridge-utils in your linux box
#     aptitude install bridge-utils

Here my physical ethernets are `eth0` and `eth1` to form a logical ethernet `br0`

create an instance of the bridge.
#     brctl addbr br0

Now enslave eth0 and eth1 to this bridge
#    brctl addif br0 eth0
#    brctl addif br0 eth1

We only need one IP address for the bridge. This address we assign to br0.
eth0 and eth1 should not have IP addresses allocated to them.
# ifconfig eth0 0.0.0.0
# ifconfig eth1 0.0.0.0
# ifconfig br0 my.ip.address.here

This will bridge `eth0` and `eth1` to form a logical ethernet `br0`