Home page http://www.lucasmanual.com

Contents

  1. Debian Services
    1. Installing and Configuring Postfix on Debian
    2. Debian Postfix and smtp.sbcglobal.yahoo.com
    3. Mailman with Postfix
    4. Ampache (Music Server) on Debian
    5. Mod Python and PSP
    6. MoinMoin Wiki with Apache2 and Mod Python
    7. Debian Anti-Spam Anti-Virus Gateway Email Server
    8. Mail Server
    9. Fax Server
    10. Network Time Synchronization
    11. FTP Server
    12. Photo Album Server
    13. Domain Controller, Samba
    14. VMware Server On Debian
    15. Bacula Enterprise Bacukup
  2. Debian Configuration
    1. Change from dhcp to static ip
    2. Multimedia player and codec on debian
    3. Multimedia player and codec on debian 64 bit
    4. Mount Windows Share
    5. Add a network card
    6. Raid 1 Setup
    7. Power Users
    8. AWStats on Debian
    9. unixODBC
    10. apt preferences
  3. Debian User Configuration
    1. Change default editor
    2. Flash player
    3. Java Runtime Enviroment (JRE)
  4. Debian Printing
  5. Remote Connection
  6. Laptop and Debian
    1. Intel ipw2200 wireless card
    2. Authenticate with wpa using PSK TKIP
    3. Broadcom 1390 Wireless Card
    4. Intel Graphic card - Higher reolution
  7. User Manuals
    1. DVD9 to DVD5
    2. DVD9 to AVI
    3. AVI to FLV
    4. Basic Unix Commands
    5. rsync
    6. MySQL
  8. Troubleshooting
    1. SSH terminal connection timeout
    2. Dynamic MMap ran out of room
    3. Seagate Free agent invalid mount option
  9. Python
    1. Python and VIM
    2. Python Manual
    3. Data Mining
    4. Using rpy
    5. Csv to Sql
    6. Create and add elements in XML
    7. PerlPython Phrasebook
    8. Python Manual
    9. Python and OpenOffice
    10. PyWeb
    11. Modwsgidelopy
  10. Building Software For Industry
    1. TurboGears
    2. Automotive
    3. Bazaar
    4. ReportLab
    5. Electronic Data Interchange
    6. Paperless
    7. Subversion
    8. GUI
  11. Regular Expression
  12. Documentation
  13. Useful Debian Programs
    1. Photo and Image
    2. CD and DVD
    3. Players and Viewers
    4. Circuit Designers
  14. Games
  15. Projects
    1. Domain name with dynamic ip
    2. Debian Documentation
    3. Network cable RJ45
    4. UICrawler
    5. DataMiner
  16. Free Databases and protocols
    1. isbn database

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

aptitude 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

aptitude 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

aptitude 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

aptitude install apache2
aptitude 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

aptitude 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

aptitude update
aptitude 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_.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

aptitude update
aptitude install apache2
aptitude install libapache2-mod-python

Now Install moinmoin wiki.

aptitude 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
 PythonOption Location /mywiki
 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']

docbook xml to pdf

aptitude install python-pdf
aptitude install dblatex

dblatex -T simple -o WikiSandBox.pdf WikiSandBox.xml

Debian Anti-Spam Anti-Virus Gateway Email Server

DebianAntiSpamGatewayEmailServer

Mail Server

Postfix

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

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

Bacula Enterprise Bacukup

Bacula

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

Multimedia player and codec on debian

/etc/apt/source.list

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

aptitude update
aptitude install xine-ui
aptitude install xmms

aptitude install w32codecs

aptitude update
aptitude install libdvdcss2

players

aptitude update
aptitude install amarok

Multimedia player and codec on debian 64 bit

/etc/apt/source.list

deb http://mirror.csclub.uwaterloo.ca/debian-multimedia/ testing --arch=amd64 main
deb-src http://mirror.csclub.uwaterloo.ca/debian-multimedia/ testing --arch=amd64 main

aptitude update
aptitude install xine-ui
aptitude install xmms

aptitude install w64codecs

aptitude update
aptitude install libdvdcss2

Mount Windows Share

aptitude update
aptitude 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

mount -t smbfs -o UID=lucas,username=administrator,password=password
//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

aptitude update
aptitude 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

aptitude update
aptitude 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

unixODBC

Unix ODBC

apt preferences

vi /etc/apt/preferances

Package: *
Pin: release a=stable
Pin-Priority: 600

Package: *
Pin: release a=testing
Pin-Priority: 450

Package: *
Pin: release a=unstable
Pin-Priority: 400

aptitude update

Debian User Configuration

Change default editor

aptitude update
aptitude install vim

update-alternatives --config editor

Flash player

aptitude update
aptitude install flashplugin-nonfree

If for some reason the flash player doesn't work you can always use manual setup.

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

Java Runtime Enviroment (JRE)

You will need to add 'non-free' to your /etc/apt/source.list then do:

aptitude update
aptitude install sun-java5-jre
aptitude install sun-java5-plugin

Debian Printing

DebianPrinting

Remote Connection

aptitude update
aptitude install rdesktop

rdesktop ip.add.re.ss
or
rdesktop remoteconnection.example.com

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/firmware/ipw2200-fw-3.0/* /lib/firmware

uname -a

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

iwconfig

Authenticate with wpa using PSK TKIP

* Install wpasupplicant

aptitude update
aptitude 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.

Broadcom 1390 Wireless Card

bcm43xx

Intel Graphic card - Higher reolution

aptitude install 915resolution

915resolution -l

sudo 915resolution 5c 1280 800 24

User Manuals

DVD9 to DVD5

DVD9toDVD5

DVD9 to AVI

DVD9toAVI

AVI to FLV

AVItoFLV

Basic Unix Commands

BasicUnixCommands

rsync

rsync

MySQL

MySQL

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

Seagate Free agent invalid mount option

If you get the following error:

invalid mount option when attempting to mount free agent seagate

Solution:

aptitude install ntfs-3g

Python

Python and VIM

aptitude update
aptitude install vim-python

Tab and 4 spaces

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

1,$retab!

set paste

set nopaste

Syntax coloring

filetype on
syntax on

Autocomplete

tar -xzvf /home/lucas/Desktop/pydiction-0.5.tar.gz -C /usr/local/bin/
chown -R root:root /usr/local/bin/pydiction-0.5
chmod 755 -R /usr/local/bin/pydiction-0.5

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

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

python /usr/local/bin/pydiction-0.5/pydiction.py csv

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

Python Manual

PythonManual

Data Mining

DataMining

Using rpy

RPy

Csv to Sql

csvtosql

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

Python Manual

Python Manual. Quick referance guide.

PythonManual

Python and OpenOffice

OpenOffice

OpenOffice: Replace blank cell with

=IF(ISBLANK(A1);0;A1) 

PyWeb

PyWeb

Modwsgidelopy

Deploy Turbogears2 and Pylons app via modwsgi modwsgideploy

Building Software For Industry

BuildingSoftwareForIndustry

TurboGears

TurboGears

Automotive

VIN

Bazaar

Bazaar revision control system and launchpad hosting

ReportLab

ReportLab

Electronic Data Interchange

ElectronicDataInterchange

Paperless

ImageManagement

Subversion

Install svn

apt-cache search svn
aptitude install subversion

Create svn Project

/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

Import svn project

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

Checkout svn project

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

/home/lucas/new_folder/my_best_project

Checkout svn project via ssh

*[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
or
svn co svn+ssh://username@your.remote-server.com/usr/local/src/my_best_project

Svn ignore files in repository

svn propset svn:ignore "*.pyc" myfolder/
svn propset svn:ignore "*.log" myfolder/

svn transfer- dump, load

svnadmin dump /path/to/repos > repos-dumpfile

svnadmin create calc; svnadmin load calc < calc-dumpfile

svn relocate

svn switch --relocate https://svn.sourceforge.net/svnroot/PROJECTNAME/trunk https://PROJECTNAME.svn.sourceforge.net/svnroot/PROJECTNAME/trunk

svn terminology

SVN Terminology

The following is a list of common terms used throughout the SourceForge.net SVN documentation:

GUI

Clarion

ClarionSoftVelocity

Dabo Application Framework

DaboDesktopApplicationFramework

XUL Runner

XULRunner Getting started

Regular Expression

RegularExpression

Documentation

DocumentationManual

Useful Debian Programs

Photo and Image

* Digikam, for all your digital camera needs

aptitude update
aptitude install digikam

CD and DVD

* K3B, for burning cd/dvd.

aptitude update
aptitude install k3b

Players and Viewers

Flash

aptitude update
aptitude install flashplugin-nonfree

Circuit Designers

Oregano, XCircuit, KTechLab, and Qucs

Games

LinuxGames

Projects

Domain name with dynamic ip

FlashDns

Debian Documentation

debdoc

Network cable RJ45

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

UICrawler

UICrawler

DataMiner

DataMiner

Free Databases and protocols

isbn database

Where can I get an ISBN database?

If you need an ISBN database, you have the choice of buying one or collecting free data. Because most book data is available for free, there's not a big market for ISBN databases. Nonetheless you can subscribe to books-in-print data services from Library of Congress (recommended), Muse (recommended, but expensive), Baker&Taylor and Ingram. Most people asking this question are interested in free data, which unfortunately means they need to know about "MARC records" and "Z39.50". MARC records are how libraries add book data to their catalogs, and Z39.50 is a protocol (like http) used to request and deliver MARC records. Luckily, you don't need to know much more than that. Endnote, from ISIResearchSoft is software that can connect to libraries using Z39.50 to download book data. You can also use it with MSWord to automate the production of reference lists. You should be able to get all the ISBN data that you need with EndNote. (There's also a version for Mac)

DigitalLibrary

MyWiki: FrontPage (last edited 2013-08-09 02:49:07 by LukaszSzybalski)