Friday, June 09, 2006

Remove subversion directories from project, directory tree or ...

find ./ -name ".svn" -type d -exec rm -rf \{} \;

Apache 2.0.x with PHP 4.4.x

*PHP

./configure --prefix=/usr/local/php/ --with-gd --with-mysql=/usr --with-openssl --with-zlib --with-jpeg-dir --with-inifile --with-png-dir --disable-cgi
--with-apxs2=/usr/local/apache2/bin/apxs --with-mysql-sock --with-iconv=/usr/local
make
make install
cp -p .libs/libphp4.so /usr/local/apache/modules

*Apache2
httpd.conf
include /usr/local/apache2/conf/modules/*.conf

php.conf
# PHP Configuration for Apache
#
# Load the apache module
#
LoadModule php4_module modules/libphp4.so
#
# Cause the PHP interpreter handle files with a .php extension.
#
Files *.php
SetOutputFilter PHP
SetInputFilter PHP
LimitRequestBody 9524288
/Files
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

Sqlite - Trac - Subversion - Slackware 10.2

Install Trac with sqllite and subversion under slackware 10.2

*Swig
tar -xzvf swig-1.3.27.tar.gz
cd swig-1.3.25
./configure --with-python=/usr/bin/python
make && make install

*subversion
tar -xzvf subversion-1.3.0.tar.gz
cd subversion-1.3.0
./configure --with-apxs=/usr/local/apache2/bin/apxs --with-swig=/usr/local/
make && make install
make swig-py && make install-swig-py
ldconfig

*clearsilver
tar -xzvf clearsilver-0.10.1.tar.gz
cd clearsilver-0.10.1
./configure
make && make install
cd python
python setup.py install

*mod_python
tar -xzvf mod_python-3.1.4.tgz.gz
./configure --with-apxs=/usr/local/apache2/bin/apxs
make && make install
make install_dso
make install_py_lib

LoadModule python_module /usr/local/apache2/modules/mod_python.so
AddModule mod_python.c

/usr/local/apache2/bin/apachectl stop
/usr/local/apache2/bin/apachectl start

*Sqlite

tar -xzvf sqlite-3.2.8.tar.gz
cd sqlite-3.2.8
./configure
make
make install

*pysqlite
tar -xzvf pysqlite-2.0.5.tar.gz
cd pysqlite-2.0.5
python setup.py build
python setup.py install

*Trac
tar -xzvf trac-0.9.2.tar.gz
python ./setup.py install


ln -s /usr/local/lib/svn-python/svn/ /usr/lib/python2.4/site-packages/svn

ln -s /usr/local/lib/svn-python/libsvn/ /usr/lib/python2.4/site-packages/libsvn

ln -s /usr/local/lib/svn-python /usr/lib/python2.4/site-packages/svn-python

trac-admin /somedir/trac/project_name initenv
tracd --port 8000 /somedir/trac/project_name

http://localhost:8000/project_name

*Apache conf

ScriptAlias /trac /usr/share/trac/cgi-bin/trac.cgi

SetEnv TRAC_ENV "/somedir/trac/project_name"


http://localhost/trac/

Software links:

wget -r -L -c -nd http://initd.org/pub/software/pysqlite/releases/2.0/2.0.5/pysqlite-2.0.5.tar.gz
wget -r -L -c -nd http://kent.dl.sourceforge.net/sourceforge/swig/swig-1.3.27.tar.gz
wget -r -L -c -nd http://www.clearsilver.net/downloads/clearsilver-0.9.14.tar.gz
wget -r -L -c -nd http://pysvn.tigris.org/files/documents/1233/26687/pysvn-1.3.1.tar.gz
wget -r -L -c -nd http://ftp.edgewall.com/pub/trac/trac-0.9.2.tar.gz
wget -r -L -c -nd http://www.sqlite.org/sqlite-3.2.8.tar.gz
wget -r -L -c -nd http://apache.online.bg/httpd/modpython/mod_python-3.1.4.tgz


Have Fun !
:)

Apache 2.0.x - FastCGI, Subversion

*Apache-2.0.x
./configure --prefix=/usr/local/apache2 --enable-so --enable-rewrite --enable-cgi --enable-vhost-alias --enable-suexec --enable-dav
make
make install

*mod_fastcgi-2.4.2

cp Makefile.AP2 Makefile
make
make install

*Subversion 1.3.0

./configure --with-apxs=/usr/local/apache2/bin/apxs
rm /usr/local/lib/libsvn* -v
make clean && make && make install
ldconfig

svnadmin create /somedir/svn/repos/test

Apache config adds:


DAV svn
#SVNPath /somedir/svn/repos
SVNParentPath /somedir/svn/repos
Satisfy Any

Mysql replace content of field

update dbtable set field = replace(field,'search_string','replace_with ');

Cool settings for linksys wrt54g wireless router

RTS Threshold: 2304
Beacon Interval: 200
MTU Size: 1400

Install Postfix with mysql, sasl on slackware (todo: postfix conf files, clamav, pop-before-smtp)

Cyrus-sasl -> ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/
Couirier(Imap. Maildrop, Auth)-> http://www.courier-mta.org/
http://kent.dl.sourceforge.net/sourceforge/courier/courier-imap-4.0.6.tar.bz2
AuthLib-> http://kent.dl.sourceforge.net/sourceforge/courier/courier-authlib-0.57.tar.bz2

Clamav -> http://www.clamav.net/
PopBeforeSmtp -> http://popbsmtp.sourceforge.net/
Postfix -> http://www.postfix.org/


#######################################################################
###Postfix

tar -xzvf postfix-*.tar.gz
cd postfix-*
make makefiles CCARGS=-DHAS_MYSQL -I/usr/include/mysql -DUSE_SASL_AUTH -I/usr/local/include/sasl AUXLIBS=-L/usr/lib/mysql -lmysqlclient -lz -lm -L/usr/local
/lib -lsasl
make

mv /usr/sbin/sendmail /usr/sbin/sendmail.OFF
mv /usr/bin/newaliases /usr/bin/newaliases.OFF
mv /usr/bin/mailq /usr/bin/mailq.OFF
chmod 755 /usr/sbin/sendmail.OFF /usr/bin/newaliases.OFF /usr/bin/mailq.OFF
#Adding postfix, postdrop user and groups
groupadd postfix
useradd -g postfix -s /dev/null postfix
groupadd postdrop
#Install Postfix
make install

#######################################################################
###Courier AuthLib ver 0.57

./configure --with-mysql-libs=/usr/lib/mysql/ --with-mysql-includes=/usr/include/mysql/ --with-authmysql --with-authmysql=yes
make
make install
make install-configure

#######################################################################
###Courier Imap
#Options foc courier-imap
#--enable-unicode
#--with-trashquota
#--disable-root-check

./configure --enable-workarounds-for-imap-client-bugs --with-authchangepwdir --enable-unicode --with-trashquota --disable-root-check
make
make install
make install-configure
#######################################################################
###postfix.sh
#!/bin/sh

case "$1" in
start)
echo "Starting POSTFIX..."
/usr/sbin/postfix start
;;
stop)
echo "Stopping POSTFIX..."
/usr/sbin/postfix stop
;;
restart)
echo "Restarting POSTFIX..."
/usr/sbin/postfix stop
sleep 1;
/usr/sbin/postfix start
;;
reload)
echo "Restarting POSTFIX..."
/usr/sbin/postfix reload
;;
*)
echo "usage [start] [stop] [restart] [reload]"
;;
esac
exit 0
#######################################################################

###Pop Before Smtmp
#Install requiered Perl modules
perl -MCPAN -e 'install Time::HiRes'
perl -MCPAN -e 'install File::Tail'
perl -MCPAN -e 'install Date::Parse'
perl -MCPAN -e 'install Net::Netmask'
perl -MCPAN -e 'install DB_File'

XLiquid GTK theme manual install ot Slackware

1.Download Xliquid_GTK-x.x.x.tar.gz ( http://themes.freshmeat.net/projects/xliquid_gtk/ )
2.Extract
3.Make directory "$HOME/.gtk_themes/"
4.Move extracted Xliquid_GTK-x.x.x dir to "$HOME/.gtk_themes/"
5.make in your $HOME directory file .gtkrc-2.0
6. Put in .gtkrc-2.0
include "$HOME/.gtk_themes/XLiquid_GTK-1.0.3/gtk-2.0/gtkrc"
7.From KDE->Control Center->Appearance & Themes->Colors - uncheck "Apply colors too non-KDE applications"
8. Restart your GTK Application and check the result :)

I think this work with manual instalation of other GTK themes too.

Other Links:
http://baghira.sourceforge.net/download.shtml

Baghira src install:
./configure --prefix=`kde-config --prefix` --disable-debug --enable-final
make
make install

Use rsync with inetd in slackware linux

rsyncd configuration:
/etc/rsyncd.conf - For configuration details see http://rsync.samba.org/

rsync and inetd - add to /etc/inetd.conf
#rsync
rsync stream tcp nowait root /usr/bin/rsync rsyncd --daemon
killall -HUP inetd - restart inetd

Migrate from mysql 4.0.x to mysql 4.1.x - use utf8

my.cnf
[client]
port = 3306
character-sets-dir=/usr/share/mysql/charsets/
default-character-set=utf8


# Here follows entries for some specific programs

# The MySQL server
[mysqld]
port = 3306

#init_connect='SET collation_connection = utf8_general_ci'
#init_connect='SET NAMES utf8'
default-character-set=utf8
character-set-server=latin1
#collation-server = utf8_general_ci

[mysql]
default-character-set=utf8


mysqldump --user=username --password=password --default_character-set=latin1 --skip-set-charset dbname > dump.sql
chgrep latin1 utf8 dump.sql
mysql --user=username --password=password --execute="DROP DATABASE dbname; CREATE DATABASE dbname CHARACTER SET utf8 COLLATE utf8_general_ci;"
mysql --user=username --password=password --default-character-set=utf8 dbname < dump.sql

Firefox JRE Manual

In Firefox plugin directory make link:
ln -s /usr/java/jre1.5.0_03/plugin/i386/ns7/libjavaplugin_oji.so ./libjavaplugin_oji.so

RubyonRails install on Slackware linux

wget -r -L -c -nd ftp://ftp.ruby-lang.org/pub/ruby/ruby-1.8.2.tar.gz
tar -xzf ruby-1.8.2.tar.gz

# install ruby
cd ruby-1.8.2
./configure
make
make install

# fix path
# get fastcgi
cd ..
wget -r -L -c -nd http://fastcgi.com/dist/fcgi-2.4.0.tar.gz
tar -xzf fcgi-2.4.0.tar.gz
cd fcgi-2.4.0
./configure
make
make install

# get rubygems and extract
cd ..
wget -r -L -c -nd http://rubyforge.org/frs/download.php/3700/rubygems-0.8.10.tgz
tar -xzf rubygems-0.8.10.tgz
cd rubygems-0.8.10
ruby setup.rb

# install gems & rails
cd ..

gem update --system
gem install fcgi
gem install mysql -- --with-mysql-config
gem install rails --include-dependencies
gem install redcloth bluecloth rubypants syntax

Clamav & Sendmail Beta ver inst scripts

Clamav:
groupadd clamav
useradd -g clamav -s /dev/null clamav
cd clamav*
./configure --enable-milter
make
make install

Sendmail:
cd sendmail*
cd devtools/Site
echo "APPENDDEF(\`conf_sendmail_ENVDEF', \`-DMILTER')" >> site.config.m4
cd ../../
./Build -c
./Build install
cd cf/cf/
cp generic-linux.mc sendmail.mc
sh Build sendmail.cf
sh Build install-cf
cd ../..
sh Build install

Post install:
chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue
chmod 0640 /etc/mail/aliases /etc/mail/aliases.{db,pag,dir}
chmod 0640 /etc/mail/*.{db,pag,dir}
chmod 0640 /etc/mail/statistics /var/log/sendmail.st
chmod 0600 /var/run/sendmail.pid /etc/mail/sendmail.pid

dummy Install script for apache, mod_ssl, libiconv, php

MOD_SSL:
./configure --with-apache=../apache_1.3.33 --prefix=/usr/local/apache

APACHE:
cd apache*
./configure --prefix=/usr/local/apache --enable-module=so --enable-module=rewrite --enable-module=ssl
make
make certificate
make install

LIBICONV:
cd libiconv-1.9.1
./configure
make
make install

PHP:
./configure --prefix=/usr/local/php/ --with-gd --with-mysql --with-openssl --with-zlib --with-jpeg-dir --with-inifile --with-png-dir --disable-cgi --with-apxs=/usr/local/apache/bin/apxs --with-mysql-sock --with-iconv=/usr/local
make
make install

Pine - POP3

{pop3server/pop3/user=popuserid}INBOX

Iptables example

#!/bin/bash
echo 0 > /proc/sys/net/ipv4/ip_forward

# load some modules (if needed)
modprobe ip_nat_ftp
modprobe ip_conntrack_ftp

# Flush
iptables -t nat -F POSTROUTING
iptables -t nat -F PREROUTING
iptables -t nat -F OUTPUT
iptables -F
iptables -X

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

# Open ports on router for server/services
#ping
iptables -A INPUT -j ACCEPT -p icmp
#web
iptables -A INPUT -j ACCEPT -p tcp --dport 80
#webs
iptables -A INPUT -j ACCEPT -p tcp --dport 443
#ftp
iptables -A INPUT -j ACCEPT -p tcp --dport 21
#pop3
iptables -A INPUT -j ACCEPT -p tcp --dport 110
#sendmail
iptables -A INPUT -j ACCEPT -p tcp --dport 25
#ssh
iptables -A INPUT -j ACCEPT -p tcp --dport 22
#bind dns
iptables -A INPUT -j ACCEPT -p tcp --dport 53
iptables -A INPUT -j ACCEPT -p udp --dport 53
#jboss
iptables -A INPUT -j ACCEPT -p tcp --dport 8080
#squid
iptables -A INPUT -j ACCEPT -p tcp --dport 5555
iptables -A INPUT -j ACCEPT -p udp --dport 5555
#usermin
iptables -A INPUT -j ACCEPT -p tcp --dport 20000
iptables -A INPUT -j ACCEPT -p udp --dport 20000
#webmin
iptables -A INPUT -j ACCEPT -p tcp --dport 10000
iptables -A INPUT -j ACCEPT -p udp --dport 10000
#bind
iptables -A INPUT -j ACCEPT -p udp --dport 32820

# STATE RELATED for router
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT


# Enable forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward

DNAT with iptables

#!/bin/sh

#Params for dnat
DNAT_SERVER=x.x.x.x
WEB_SERVER=y.y.y.y
DNAT_PORT=p1
WEB_PORT=p2

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -F
iptables -t nat -X
iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -P FORWARD ACCEPT
iptables -t nat -A PREROUTING -p tcp -d $DNAT_SERVER --dport $DNAT_PORT -j DNAT --to-destination $WEB_SERVER:$WEB_PORT

OnLinux Blog

Linux snipperts, confs, tips and tricks blog !