Home page http://www.lucasmanual.com

TableOfContents(2) Keywords: Debian GNU Linux, Manual, How To, How-To, Installation, Configuration, Easy, From Windows XP to Debian, Wireless WPA2, anti-spam, fax, Documentation, MoinMoin Wiki.

Debian Services

Installing and Configuring Postfix on Debian

apt-get install postfix

cat /var/log/mail.log

postconf -e "myorgin = example.com"

postconf -e "myhostname=server1.example.com"

postconf -e "relay_domains = example.com, example2.com, example3.com"

postfix reload

telnet localhost 25

Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix (Debian/GNU)

mail from:<you@youremail.com>
rcpt to:<user@example.com>
data
To: user@example.com
From: you@youremail.com
Subject: Hey my first email
This is my first email on debian postfix after installing configuring it.
It was easy. See you

.

quit

qshape
mailq
qshape deferred
postsuper
postsuper -r ALL   (requeue all emails)

Debian Postfix and smtp.sbcglobal.yahoo.com

apt-get postfix-tls libsasl2-modules

postconf -e "relayhost = [smtp.sbcglobal.yahoo.com]"
postconf -e "smtp_sasl_auth_enable = yes"
postconf -e "smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd"
postconf -e "smtp_sasl_security_options = noanonymous"

[smtp.sbcglobal.yahoo.com] username@sbcglobal.net:mypassword

chmod 600 /etc/postfix/sasl_passwd

postmap /etc/postfix/sasl_passwd

postfix reload

Mailman with Postfix

apt-get install mailman

newlist mailman

/etc/init.d/mailman start

relay_domains = example.com, lists.example.com

alias_maps = hash:/etc/aliases,hash:/var/lib/mailman/data/aliases

postconf -e "transport_maps = hash:/etc/postfix/transport"
postconf -e "mailman_destination_recipient_limit = 1"

mailman unix  -       n       n       -       -       pipe
   flags=FR user=list
   argv=/var/lib/mailman/bin/postfix-to-mailman.py ${nexthop} ${user}

lists.example.com    mailman:

postmap /etc/postfix/transport

MTA = 'Postfix'
DEB_LISTMASTER = 'postmaster@example.com'
POSTFIX_STYLE_VIRTUAL_DOMAIN = ['lists.example.com']

/etc/init.d/postfix reload
/etc/init.d/mailman restart

newlist list_name

Alias /pipermail/ /var/lib/mailman/archives/public/
Alias /images/mailman/ /usr/share/images/mailman/

http://lists.yourwebsite.com/cgi-bin/mailman/listinfo/list_name/

[Optional] If you want to move your mailman to a new server here is how you do it. MailmanTransfer

Ampache (Music Server) on Debian

apt-get install apache2
apt-get install php5 php5-mysql php5-gd

wget http://www.ampache.org/downloads/current.tar.gz
tar -xzvf current.tar.gz

mv ampache-3.3-beta4 /usr/local/bin/ampache
cd /usr/local/bin/ampache

chown -R www-data:www-data /usr/local/bin/ampache

Alias /ampache "/usr/local/bin/ampache/"
<directory />
       DirectoryIndex index.php index.html
       Options Indexes MultiViews
       AllowOverride None
       Order allow,deny
       Allow from all
</directory>

* Optional, you could change Alias from /ampache "/usr/local/bin/ampache/" to something like

Alias /musiclover "/usr/local/bin/ampache/"

/etc/init.d/apache2 restart

apt-get install mysql-server

http://localhost/ampache/install.php

chgrp -R www-data /path/to/mymusic/*

addgroup users
chgrp -R users path/to/mymusic/*
adduser www-data users

Mod Python and PSP

apt-get update
apt-get install libapache2-mod-python

a2enmod mod_python

AddHandler mod_python .psp .psp_
PythonHandler mod_python.psp

<Directory "/var/www/pspwebsite/folder">
 AddHandler mod_python .psp .psp_
 PythonHandler mod_python.psp
 PythonDebug On
 Options Indexes MultiViews
 AllowOverride None
 Order allow,deny
 Allow from all
 DirectoryIndex index.psp
</Directory>

/etc/init.d/apache2 reload

MoinMoin Wiki with Apache2 and Mod Python

  1. Apache2 and mod_python should be installed by now. If not do

apt-get update
apt-get install apache2
apt-get install libapache2-mod-python

Now Install moinmoin wiki.

apt-get install python-moinmoin
mkdir /var/www/mywiki
cp -r /usr/share/moin/data /usr/share/moin/underlay /usr/share/moin/server/moin.cgi /var/www/mywiki
chown -R www-data:www-data /var/www/mywiki
  1. Configure apache2
  2. Add the following lines to /etc/apache2/conf.d/wiki:

 Alias /wiki/ "/usr/share/moin/htdocs/"

 <Location /mywiki>
 SetHandler python-program
 PythonPath "['/var/www/mywiki','/etc/moin/']+sys.path"
 PythonHandler MoinMoin.request::RequestModPy.run
 PythonDebug On
 </Location>
  1. Reload apache2

 /etc/init.d/apach2 reload
  1. Configure Moinmoin
  2. Edit /etc/moin/farmconfig.py. You have 2 options.

 wikis = [
           ("mywiki",    r"^yoursite.com/mywiki/.*$"),
       ]

or

wikis = [
    ("mywiki",  r".*"),   # this is ok for a single wiki
]
  1. Also, in /etc/moin/farmconfig.py comment out data_dir and data_underlay_dir (we need those defined separately for each wiki)
  2. [Check] See if /etc/moin/mywiki.py exists. If it does go ahead and edit it. If not copy this file to mywiki.py

 # cp /etc/moin/moinmaster.py /etc/moin/mywiki.py
  1. Then edit /etc/moin/mywiki.py

 sitename = u'MyWiki' # [Unicode]
 data_dir = '/var/www/mywiki/data'
 data_underlay_dir = '/var/www/mywiki/underlay'
  1. Comment out data_dir if it is somewhere else in a file 1.Reload apache

/etc/init.d/apache2 force-reload

#RedirectMatch ^/$ /apache2-default/
RedirectMatch ^/$ /mywiki/

allowed_actions = ['AttachFile']

Debian Anti-Spam Anti-Virus Gateway Email Server

DebianAntiSpamGatewayEmailServer

Fax Server

FaxServer

Network Time Synchronization

NetworkTime aka the NTP Date

FTP Server

FtpServer

Photo Album Server

PhotoAlbumServer

Domain Controller, Samba

SambaDomainController

VMware Server On Debian

http://www.howtoforge.com/debian_etch_vmware_server_howto

Kernel Upgrade

apt-get update
apt-get install linux-headers-$(uname -r) 
/usr/bin/vmware-config.pl

Debian Configuration

Change from dhcp to static ip

iface eth0 inet static
[tab]address 192.168.1.200
[tab]network 192.168.1.0
[tab]netmask 255.255.255.0
[tab]broadcast 192.168.1.255
[tab]gateway 192.168.1.1

#iface eth0 inet dhcp
iface eth0 inet static
    address 192.168.1.200
    network 192.168.1.0
    netmask 255.255.255.0
    broadcast 192.168.1.255
    gateway 192.168.1.1

iface eth0 inet static
    address 192.168.5.200
    network 192.168.5.0
    netmask 255.255.255.0
    broadcast 192.168.5.255
    gateway 192.168.5.254

Subversion

apt-cache search svn
apt-get install subversion

/home/lucas/my_best_project

/home/lucas/my_best_project/trunk/install.c
/home/lucas/my_best_project/trunk/readme.txt

/usr/local/src/

svnadmin create /usr/local/src/my_best_project

svn import /home/lucas/my_best_project file:///usr/local/src/my_best_project -m "initial import"

svn checkout file:///usr/local/src/my_best_project

/home/lucas/new_folder/my_best_project

* Optional, you could use subversion over ssh. You need to install subversion on your computer and then:

svn co svn+ssh://your.remote-server.com/usr/local/src/my_best_project

* Done. Now its time to make that tool great.

Multimedia player and codec on debian

/etc/apt/source.list

deb http://gulus.usherbrooke.ca/pub/distro/debian/debian-multimedia/ stable main

apt-get update
apt-get install xine-ui
apt-get install xmms

apt-get install w32codecs

apt-get update
apt-get install libdvdcss2

Mount Windows Share

apt-get update
apt-get install smbfs

mkdir somefolder

mount -t smbfs -o username=administrator,password=password 
//windowsservername/folder /home/lucas/somefolder

If you don' want the password to show up you could do

mount -t smbfs -o username=administrator //windowsservername/folder /home/lucas/somefolder

[Optional] You can replace administrator with your username. You can also replace windowsservername with ip address //192.168.1.10/folder ....

Add a network card

lspci -v 

ifconfig eth1 hw erher 00:00:..:00 uo

Raid 1 Setup

["DebianRAID"]

Power Users

Sudo

apt-get update
apt-get install sudo

visudo

yourusername    ALL=(ALL) ALL

Disable ssh root access

vi /etc/ssh/sshd_config

PermitRootLogin no

/etc/init.d/ssh force-reload

Security Events
=-=-=-=-=-=-=-=
Feb  5 07:21:15 localhost sshd[8586]: Failed password for root from xx.xx.xx.xx port 60618 ssh2
Feb  5 07:21:15 localhost sshd[8588]: Failed password for root from xx.xx.xx.xx port 60637 ssh2

AWStats on Debian

apt-get update
apt-get awstats

Configure the apache2 for awstats

cp /usr/share/doc/awstats/examples/apache.conf /etc/apache2/conf.d/awstats

LogFile="/var/log/apache2/access.log"
SiteDomain="mysite.org"
LogFormat=1

Permissions

chmod o+r /var/log/apache2/access.log

 create 644 root adm

prerotate
    /usr/lib/cgi-bin/awstats.pl -config=awstats.www.mysite.org.conf  -update
  endscript

/var/log/apache2/*.log {
        weekly
        missingok
        rotate 52
        compress
        delaycompress
        notifempty
        create 644 root adm
        sharedscripts
        prerotate
            /usr/lib/cgi-bin/awstats.pl -config=awstats.conf -update        endscript
        postrotate
                if [ -f /var/run/apache2.pid ]; then
                       /etc/init.d/apache2 restart > /dev/null
                fi
        endscript
}

/etc/init.d/apache2 reload

http://localhost/cgi-bin/awstats.pl?config=awstat.conf or http://www.mysite.com/cgi-bin/awstats.pl?config=awstat.conf [Optional]

RedirectMatch ^/logs /cgi-bin/awstats.pl?config=awstat.conf

http://www.mysite.com/logs

Debian User Configuration

Change default editor

apt-get update
apt-get install vim

update-alternatives --config editor

Flash player

cp /home/lucas/Desktop/libflashplayer.so /usr/lib/mozilla/plugins/
cd /usr/lib/iceweasel/plugins/
ln -s /usr/lib/mozilla/plugins/libflashplayer.so

Debian Printing

DebianPrinting

Laptop and Debian

Intel ipw2200 wireless card

http://ipw2200.sourceforge.net/firmware.php?fid=7

tar xzvf ipw2200-fw-3.0.tgz -C /lib/firmware
mv /lib/firware/ipw2200-fw-3.0/* /lib/firmware

uname -a

apt-get update
apt-get install ipw2200-modules-2.6.18-5-486
or
apt-get install ipw2200-modules-$(uname -r) 

iwconfig

Authenticate with wpa using PSK TKIP

* Install wpasupplicant

apt-get update
apt-get install wpasupplicant

* Open /etc/network/interfaces

vi /etc/network/interfaces

*If you see "iface eth2..." add the following lines, but change ssid and password:

iface eth2 inet dhcp
wpa-ssid thisismynetworkname
wpa-key_mgmt WPA-PSK
wpa-proto WPA
wpa-pairwise TKIP
wpa-group TKIP
wpa-psk thisismypassword
wpa-dribver wext

*Exit, and now type:

ifup eth2

*Done. If you want you your wireless card to connect each time you boot your computer add this above "iface eth2.."

auto eth2

*Done.

Intel Graphic card - Higher reolution

apt-get install 915resolution 

915resolution -l

sudo 915resolution 5c 1280 800 24

User Manuals

DVD9 to DVD5

["DVD9toDVD5"]

DVD9 to AVI

["DVD9toAVI"]

Troubleshooting

SSH terminal connection timeout

Read from remote host example.com: Connection reset by peer
Connection to example.com closed

ClientAliveInterval 150

Dynamic MMap ran out of room

{{{Reading package lists... Error! E: Dynamic MMap ran out of room E: Error occurred while processing vlc (NewVersion1) }}}

apt-get update -o APT::Cache-Limit=25165824

Python

Python and VIM

Tab and 4 spaces

set tabstop=4
set shiftwidth=4
set expandtab 
set smarttab

1,$retab!

Syntax coloring

filetype on
syntax on

Autocomplete

tar -xzvf /home/lucas/Desktop/pydiction-0.5.tar.gz -C /usr/share/vim-scripts/
chown -R root:root /usr/share/vim-scripts/pydiction-0.5
chmod 755 -R /usr/share/vim-scripts/pydiction-0.5

if has("autocmd")
       autocmd FileType python set complete+=k/usr/share/vim-scripts/pydiction-0.5/pydiction isk+=.,(
endif " has("autocmd")

import xml.  press CRTL+n and you should see the available modlules

http://lucasmanual.com/out/vim-python-autocomplete.jpg

Python Manual

PythonManual

Create and add elements in XML

from xml.dom.minidom import parseString

doc = parseString(u'<top/>'.encode('UTF-8'))

<?xml version="1.0" ?>
<top/>

top_element=doc.documentElement

element1=doc.createElementNS(None,u'section1')

top_element.appendChild(element1)

element1.appendChild(doc.createElementNS(None,u'subsection1'))

text1=doc.createTextNode(u'My first text')

element1.firstChild.appendChild(text1)

element1.appendChild(doc.createElementNS(None,u'subsection2'))

text2=doc.createTextNode(u'My second text')
element1.lastChild.appendChild(text2)

element1.firstChild.appendChild(text2)
element1.lastChild.appendChild(text1)

PerlPython Phrasebook

PerlPythonPhrasebook

PyWeb

PyWeb

Django Web Framework

DjangoWebFramework

Building Software For Industry

BuildingSoftwareForIndustry

TurboGears

TurboGears

Clarion

ClarionSoftVelocity

Dabo Application Framework

DaboDesktopApplicationFramework

Regular Expression

RegularExpression

Documentation

DocumentationManual

Useful Debian Programs

Photo and Image

* Digikam, for all your digital camera needs

apt-get update
apt-get install digikam

CD and DVD

* K3B, for burning cd/dvd.

apt-get update
apt-get install k3b

Players and Viewers

Flash

apt-get update
apt-get install flashplugin-nonfree 

Games

LinuxGames

Domain name with dynamic ip

FlashDns

Debian Documentation

["debdoc"]

Network cable RJ45

http://lucasmanual.com/pdf/network_cable_rj45.pdf

[http://floopityjoop.com/cat.html cat]