Debian Etch Archive Sources List

As we all know, Debian Etch has been no longer supported since Feb 2010. But still some machines might be running Debian Etch and upgradation might not be feasible. If you are searching for any source to install packages to your machine, you can add the archive repository as shown below

# vim /etc/apt/sources.list

deb http://archive.debian.org/debian/ etch main contrib non-free

# apt-get update

# apt-get install

Posted in Debian, Linux | Leave a comment

How to restrict postfix recipients in zimbra

This will show how you can modify postfix to restrict who can send to certain addresses in your domain such as distribution lists like all@mydomain.com

These changes will most likely not persist between upgrades!

zimbra/conf/postfix_recipient_restrictions.cf. Also, permissions on files created in /opt/zimbra/postfix/conf got changed.)

This method can be spoofed by forging the MAIL FROM: header (so mail appears to originate from within the domain), so it isn’t foolproof, but it works for basic needs.

  • Create a ‘permitted senders’ list (as user zimbra) – This is your list of domains and/or users who can email your protected email addresses:

# vim /opt/zimbra/postfix/conf/permitted_senders

[paste in contents below editing as required]

localhost               OK

mydomain.com            OK

zimbra-domain.com       OK
user@domainname.com     OK
  • Create a 'protected recipients' list (as user zimbra) - This is your list of email addresses that may only receive email from 'permitted senders'

# vim /opt/zimbra/postfix/conf/protected_recipients

[paste in contents below editing as required]

test-dist-list@mydomain.com permitted_senders_list

protected-user@mydomain.com permitted_senders_liste>

  • Add necessary settings to /opt/zimbra/postfix/conf/main.cf
# vim /opt/zimbra/postfix/conf/main.cf

permitted_senders_list = check_sender_access hash:/opt/zimbra/postfix/conf/permitted_senders, reject

smtpd_restriction_classes = permitted_senders_list

**Note this change to the main.cf won't survive upgrades. Be sure to save a copy of your main.cf file**
  • Now add your new restriction to the top of postfix_recipient_restrictions.cf
vim /opt/zimbra/conf/postfix_recipient_restrictions.cf

[paste this into the first line of the file, above any other settings]

check_recipient_access hash:/opt/zimbra/postfix/conf/protected_recipients

/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/permitted_senders
/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/protected_recipients

/opt/zimbra/postfix/sbin/postmap /opt/zimbra/postfix/conf/postfix_recipient_restrictions.cf

Reload postfix to activate settings:

/opt/zimbra/postfix/sbin/postfix reload

FYI :- This can also used in plain postfix configuration.

Posted in Debian, Linux, Postfix, Ubuntu, Zimbra | Leave a comment

Howto hint 3gp files for streaming with Darwin Streaming Server

Hinting media files:

To stream a file that has audio and video using a streaming server like the Darwin streaming server, you will need to hint the file. On Ubuntu/Debian Linux machines, you can install the package called mpeg4ip-utils.

shashi@ungulate:/tmp$ sudo apt-get install mpeg4ip-utils

After installation of the mpeg4ip-utils package, use the mp4creator’s hint option. With this option, you need to specify a track number. Use the mp4info utility to get this information.

shashi@ungulate:/tmp$ mp4info Video0000.3gp
mp4info version 1.6
Video0000.3gp:
Track Type Info
1 video H.263, 17.158 secs, 102 kbps, 176x144 @ 10.490733 fps
2 audio AMR, 17.200 secs, 13 kbps, 15750 Hz

We need to hint both tracks 1 and 2. Run the following:

shashi@ungulate:/tmp$ mp4creator --hint=1 Video0000.3gp
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[0].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[1].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[2].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId

shashi@ungulate:/tmp$ mp4creator --hint=2 Video0000.3gp
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[0].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[1].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[2].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId
MP4ERROR: MP4File::FindIntegerProperty: no such property -
moov.trak[3].mdia.minf.stbl.stsd.*.esds.decConfigDescr.objectTypeId

You can safely ignore the errors.

Now, verify whether the file has been hinted.

shashi@ungulate:/tmp$ mp4info Video0000.3gp
mp4info version 1.6
Video0000.3gp:
Track Type Info
1 video H.263, 17.158 secs, 102 kbps, 176x144 @ 10.490733 fps
2 audio AMR, 17.200 secs, 13 kbps, 15750 Hz
3 hint Payload H263-2000 for track 1
4 hint Payload AMR for track 2
Tool: mp4creator 1.6

Now, upload it to your streaming server and serve it hot!

Posted in Debian, General, Linux, Ubuntu | Leave a comment

How to install Nuxeo-DM on Debian GNU/Linux 5.0 (Lenny)

Nuxeo DM is an open source document management application and helps to manage and track flow of content.

Intallation instructions for Debian Lenny 

Install sun-java6-jdk apt source.

# apt-cache search sun-java6-jdk  (This may take some time...)

After the installation of sun-java6-jdk, Add this sources to /etc/apt/sources.list

# "deb http://apt.nuxeo.org/ lucid releases"

Run the following command in the terminal :-

# apt-get update

# apt-get search nuxeo

# apt-get install nuxeo-dm-tomcat (This may take some time…)

After the installation, use an editor to update the configuration:

# /etc/nuxeo-dm/nuxeo.conf

Uncomment this line

# JAVA_HOME=/usr/lib/jvm/java-6-sun

And invoke the service

# invoke-rc.d nuxeo-dm \[start\|stop\|status\|restart\]

When the Nuxeo-Dm started, Open this link in the browser

http://localhost:8080/

Login the Nuxeo using Administrator username and Administrator as password.

Posted in Debian, General, Ubuntu | Leave a comment

Making FTP work when both FTP client and server are behind NAT/Firewall

Making FTP  work when both FTP client and server are behind NAT/Firewall

In situations where both the FTP client and the FTP server are behind two different NATted networks, there could be problems for the client to connect or run ftp commands on the remote server. This document describes such a scenario in which the FTP server is hosted on an Amazon EC2 instance and the client is in a LAN with a linux gateway.

The server runs Debian GNU/Linux Lenny. The FTP server is Pure-FTPd.
The client used is FireFTP (a firefox addon).

The server IP address is 10.8.5.240 (Amazon EC2 instance which is behind a firewall). The Amazon Elastic IP for the server is
172.18.15.38 (changed to mask the original).  The client IP address is 192.168.5.18. The gateway for the client machine is 192.168.5.1 and also runs Debian GNU/Linux.

The Pure-FTPd Server is setup with  virtual simple user mechanism. FTP works correctly when tested locally. But when the same is tested over the network, the server authenticates the user with the password but after the authentication, it freezes and nothing happens.

To get the setup working properly, the following steps need to be followed:

1. In the desktop, the FireFTP client has to have “Passive mode” enabled.

2. In the gateway, the module ip_conntrack_ftp has to be loaded.

With the above setup the client should work when the server also has a publicly addressable IP. But in the above scenario, the FTP server is behind a NAT. The server when sending a connect string to the client sends the local non-public IP (10.8.5.240) to be bound in the passive mode. The fix for the issue is for the server to send the publicly addressable ip address to the passive client as the IP it has to connect to.

3. Add a directive – ForcePassiveIP in Pure-FTPd configuration.

HOW-TO


cd /etc/pure-ftpd/
echo "172.18.15.38" > conf/ForcePassiveIP
/etc/init.d/pure-ftpd restart

Posted in Linux | 1 Comment

DNS setup to catch all traffic

How do you setup a network in which you grab all the outgoing web requests and instead respond with your website or web application?

  • Install Linux on the network gateway machine. (Debian is recommended)
  • Setup a DHCP server. Ensure that the gateway IP address is configured correctly. [1]
  • Install apache/lighttpd and setup your website/webapplication.
  • Setup iptables to redirect outgoing http traffic to your webapp. [2]
  • Now install bind9 and configure the zone “.” as a master (instead of as hint) [3]
  • Test the setup – open any url (eg. http://www.informedia.co.in/) on any of the client machines.

[1] DHCP Configuration

subnet 10.8.5.0 netmask 255.255.255.0 {
range 10.8.5.10 10.8.5.200;
option routers 10.8.5.1;
option domain-name-servers 10.8.5.1;
}

[2] iptables command to redirect outgoing http traffic to local webserver.

iptables -t nat -A PREROUTING -p tcp --dport 80 -j REDIRECT --to 10.8.5.1:80

[3] Bind9 named.conf

zone "." {
type master;
file "/var/cache/bind/catchall.db";
};

[4] Bind9 zone configuration

$TTL 86400
@ IN SOA . root.. (
2 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
* IN A 10.8.5.1

Posted in General | Tagged , , , | Leave a comment

Howto: Transfer domains from Net4 to any other registrar

Several people are facing various types of issues with their domains registered with the India based Domain Name Registrar – Net4. Though arguably cheaper, provides a ton of payment options (through CCAvenue), and it basically works initially, things get stuck in the post registration period.

With their support  being almost clueless, even moving elsewhere becomes a nightmare for their customers. We being one such customer who have had to endure the experience of transferring domains away from Net4, present a brief howto do that.

  1. Login to your control panel at Net4; Use your CRN ID/Username and your Password.
  2. Click on the link called “Domains” under “My Services”.
  3. You should see your domain name(s) listed.
  4. Click on the domain name you want to transfer.
  5. Under “DNS Management” you will find a link called “Auth Code: Retrieve”
  6. Click on the link “Auth Code: Retrieve”. Here’s when things get interesting :-)
  7. As on Nov 2010, as a “feature” you are shown an error message “There were some errors while processing your request. Please try again.” which is hardly visible. That is fine.
  8. Just to confirm once again by clicking on the same link. “”Auth Code: Retrieve”.
  9. This time you should get a message saying “A request is already under process for auth code.”
  10. You should expect a mail in the admin contact’s email account in the next 24-48 hours. This email asks the admin to approve whether Auth Code was sought.
  11. Once you click on the Approve link, the Auth Code will be sent to the registrant’s email address.
  12. Now you can use a different registrar’s interface to transfer your domain.

The above instructions may go haywire if you are an old customer of Net4′s though! What happens is that your domain would have been registered elsewhere – Melbourne IT or Network Solutions under its own account. Hence, for such domains Net4′s support personnel manually retrieve the Auth code and mail it to you. This process can take anywhere from 8 hours and above based on your luck and the positions of all the moons of jupiter from the previous century …

This is a public service post. You are welcome to consult us about transfers away from Net4 for free (email: support@inf.in) anyday. You can also register and manage your domains without hassles at our exclusive website athttp://domains.w4websites.com/. Know more about our website offerings athttp://www.w4websites.com/

Posted in General | Tagged , , | Leave a comment

Fedena – open source school management system

Project Fedena is the open source school management system based on Ruby on Rails. It was initially developed by a team of developers at Foradian Technologies. The project was made open source by Foradian, and is now maintained by the open source community.

Installation instructions for Debian Lenny

Install Ruby, MySQL driver and OpenSSL libraries

# aptitude install ruby libmysql-ruby libopenssl-ruby

Install RubyGems from unstable

# aptitude -t unstable install rubygems

[Reason : Debian stable has version 1.2.0, but ver >= 1.3.1 is needed]

Install Rails and Prawn versions specifically needed for Fedena

# gem install rails -v=2.3.5

# gem install prawn -v=0.6.3

[Or manually download gems along with their dependencies from http://rubygems.org/gems]

Download the latest Fedena source code from github

Download Fedena source code from GitHub. Extract the downloaded .tar archive to a convenient location where you would be running fedena.

Setup your database details in the database.yml
Open the file database.yml in the config folder of the fedena soucre. Change the following details:
database: fedena – The name of the database you want to use for fedena
username: root – Mysql username for fedena
password: mypass – The password for the above mysql user

Install the rest of the gems
Open a terminal and navigate to the fedena source directory, install the rest of the gems by running

# /var/lib/gems/1.8/bin/rake gems:install

Set up Fedena databases

# /var/lib/gems/1.8/bin/rake db:create

# /var/lib/gems/1.8/bin/rake db:migrate

Change permissions for scripts

Grant executable permissions for the files in script directory by

# chmod +x script/*

Run the inbuilt server
If everything went fine till now, you are ready to run fedena server by running the following

# script/server

Have fun :)

Posted in General | Leave a comment

Project | Pier update admin / user password

In the table called pp_users, you will find the line corresponding to the admin account. Note the salt value from the table pp_user Or you can copy / paste the salt value directly into the mysql update command.

To modify the password of the admin / user account, use the below mysql statement.

Here in the below mysql statement,

sha1 (Function)

<salt value of the admin account from table> (Salt Value)

adminpassword (user password)

update pp_users SET token = sha1(“<saltvalue><adminpassword>”) where username = ‘admin’;


Posted in Linux | Leave a comment

iframe in Silverstripe HTML Editor

By Default, iframe element is not enabled in the TinyMCE Editor of Silverstripe. To enable this you have to just extend the valid elements in your mysite/_config.php by adding the following lines.

HtmlEditorConfig::get('cms')->setOption('extended_valid_elements', 'iframe[src|name|width|height|align|frameborder|marginwidth|marginheight|scrolling]');
Posted in CMS, Silverstripe | Tagged , , , | Leave a comment