Linux Notes Dump (From 100 Years Ago)

1) Linux

Fix Flash Firefox Freezing
sudo mkdir /etc/adobe
echo "OverridePGUValidation=true" >~/mms.cfg
sudo mv ~/mms.cfg /etc/adobe/

sudo apt-get install flashplugin-nonfree

Install Wii Dolphin Emulator in Ubuntu
sudo add-apt-repository ppa:glennric/dolphin-emu
gpg --keyserver keyserver.ubuntu.com --recv 8505D44B
gpg --export --armor 8505D44B | sudo apt-key add - && sudo apt-get update
sudo apt-get update --fix-missing
sudo apt-get install dolphin-emu

default.keyring
[keyring]
display-name=Default
ctime=0
mtime=0
lock-on-idle=false
lock-after=false

[1]
item-type=0
display-name=void@data
secret=void
mtime=1305773268
ctime=0

[1:attribute0]
name=domain
type=string
value=WORKGROUP

[1:attribute1]
name=protocol
type=string
value=smb

[1:attribute2]
name=server
type=string
value=data

[1:attribute3]
name=user
type=string
value=void

Install Wiithon

LubuntuPreferences - software - sources - Other Software tab - check all except cdrom - Updates - check all - click close

tightVNC:
sudo apt-get install tightvncserver xtightvncviewer tightvnc-java
create a blank file on desktop | rightclick properties then enter this command:
xtightvncviewer 75.23.181.231
check "no display", a file shall appear under:
/home/ocgold/.local/share/applications
copy that file onto the desktop, then remove the original blank file

Install VirtualBox
Manually add this to software sources for Lubuntu 11.04:
deb http://download.virtualbox.org/virtualbox/debian natty contrib
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get -y --force-yes install gcc dkms
sudo apt-get -y --force-yes install virtualbox-4.1
Optional: manually add username into vboxusers group

Install Java
sudo add-apt-repository ppa:sun-java-community-team/sun-java6
sudo apt-get update
sudo apt-get install sun-java6
-- Short-cut use Synaptic Package Manager to search for "sun java" and install sun-java6-bin, sun-java6-jre, sun-java6-fonts, and
Install flash:
sudo apt-get -y --force-yes install flashplugin-installer flashplugin-nonfree flashplugin-nonfree-extrasound ubuntu-restricted-extras

Install shit:
sudo apt-get update
sudo apt-get -y --force-yes install firefox numlockx unrar gimp cheese vlc seamonkey arora kompozer

Skype
sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 0xd66b746e
echo "deb http://download.skype.com/linux/repos/debian/ stable non-free" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt-get install skype

Opera
Manually add this repo: deb http://deb.opera.com/opera/ stable non-free
OR run this command
echo "deb http://download.skype.com/linux/repos/debian/ stable non-free" | sudo tee -a /etc/apt/sources.list > /dev/null
echo "deb http://deb.opera.com/opera/ stable non-free" | sudo tee -a /etc/apt/sources.list > /dev/null
wget -qO - http://deb.opera.com/archive.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install debian-archive-keyring opera

sudo apt-get -y --force-yes install gcc virtualbox-3.2 foo2zjs
sudo apt-get -y --force-yes update
sudo apt-get -y --force-yes upgrade
sudo apt-get -y --force-yes dist-upgrade

Install missing packages:
sudo apt-get -f install

Shutdown button
sudo apt-get install vim
sudo vim /usr/share/applications/lubuntu-logout.desktop
NoDisplay=false
add
Categories=System;

Change clock display%D %r

sudo vi /etc/xdg/lubuntu/lxdm/lxdm.conf
autologin=ocgold
numlock=1

Lubuntu Auto Login:
sudo vim /etc/lxdm/default.conf

Uncomment this line to make it active
#autologin=ocgold

Tar and Untar
To Tar:
tar –cvzf tarfilename foldername

Untar:
tar –xvzf tarfilename

Move file:
mv sexcenter.com.tar.gz website.com/website.com.tar.gz

Download from another server via http:
wget http://website.com/website.com.tar.gz

Tools:
FLV Encoder: http://www.erightsoft.com/Superdc.html

Creating Live CD / USB for Linux Fedora
How to create a Fedora Flash Drive from Windows:
Download the Fedora liveusb-creator-x.x.zip
Extract the liveusb-creator-zip to your PC
Navigate to the liveusb-creator folder and click liveusb-creator.exe to launch the tool
Even though the USB Fedora creation process is straight forward, here is a quick rundown of all the steps involved:
Select either to Use existing Live CD or Download Fedora
Set the Target Device to point to your USB flash drive
Move the Persistent Overlay slider to set the capacity to use for the persistent image
Click Create Live USB to begin the creation process

A nice progress bar will indicate the progress of your USB Fedora creation. Once the process has finished, simply restart your PC and set your System BIOS or Boot Menu to boot from the USB flash drive
If all goes well, you should now be booting into your own portable Live USB Fedora 9, 10 or 11.

WICD asking for password - error
sudo gedit /etc/wicd/wired-settings.conf
# delete the empty [] bracket

Fedora Setup GuideRemoving Junk
su
yum remove abrt

# Install XCFE
yum groupinstall XFCE

Set Selinux to disabled mode
vi /etc/selinux/config
# edit the mode to "disabled"

Adding Repositories:
su
# enter root password
# add rpmfusion
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm
# add adobe repo
rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
# add skype repo (optional)
vim /etc/yum.repos.d/skype.repo
# enter the following
[skype]
name=Skype Repository
baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc
enabled=1
gpgcheck=0

Install VirtualBox
su -
wget http://download.virtualbox.org/virtualbox/rpm/fedora/virtualbox.repo && cp virtualbox.repo /etc/yum.repos.d/
yum install -y VirtualBox dkms gcc

# Then install the following
yum install f-spot flash-plugin filezilla thunderbird gimp amule azureus skype xchat-gnome AdobeReader_enu gnucash scribus amarok audacity banshee mplayer mplayer-gui gtkpod xmms DVDRipOMatic dvdrip kino vlc mozilla-vlc xine k3b k3b-extras-freeworld k3b-common k3b-libs bluefish kdewebdev java compat-libstdc++-33 ffmpeg lame libXp mjpegtools wget VirtualBox-OSE gstreamer-* wget

================================================ Netbooks and Laptops with Wireless ====================================
# Install better network manager WICD
su
cd /etc/yum.repos.d/
wget http://download.opensuse.org/repositories/system:/wicd/Fedora_12/system:wicd.repo
sudo yum install wicd* -y
# Set selinux to enable wicd
restorecon -v '/etc/wicd/manager-settings.conf'

restorecon -v '/etc/wicd/wireless-settings.conf'

restorecon -v '/etc/wicd/wired-settings.conf'
# Set wicd to start automatically, this may not be necessary in Fedora 12
chkconfig -l 2345 wicd on

# Network Manager is no longer required
yum remove networkmanager

==============================================================================================================

# Install Windows true-type fonts
su
# password here
cd /tmp/
wget http://corefonts.sourceforge.net/msttcorefonts-2.0-1.spec
yum -y install rpm-build cabextract ttmkfdir
rpmbuild -bb msttcorefonts-2.0-1.spec
rpm -ivh /root/rpmbuild/RPMS/noarch/msttcorefonts-2.0-1.noarch.rpm --nodeps

# install libdvdcss
rpm -ivh http://dl.atrpms.net/all/libdvdcss2-1.2.10-5.fc12.i686.rpm

# install win32 codecs
cd /tmp/
wget http://www.mplayerhq.hu/MPlayer/releases/codecs/all-20071007.tar.bz2
tar xfvj all-20071007.tar.bz2
mkdir /usr/lib/codecs/
cp all-20071007/* /usr/lib/codecs/
ln -s /usr/lib/codecs/ /usr/lib/win32

# install real player
cd /tmp/
wget http://www.real.com/realcom/R?href=http://forms.real.com/real/player/download.html?f=unix/RealPlayer11GOLD.rpm

# Change the name of the file with the command mv
# Then...
rpm -ivh RealPlayer11GOLD.rpm

# install Opera Browser
Check http://www.opera.com/download/?custom=yes
http://www.opera.com/download/get.pl?id=32621&location=215&nothanks=yes&sub=marine

To install chromium:
vim /etc/yum.repos.d/chromium.repo
Then fill it up with this:-
[chromium]
name=Chromium Test Packages
baseurl=http://spot.fedorapeople.org/chromium/F$releasever/
enabled=1
gpgcheck=0
After that, just yum install chromium

==========================================================
# Installing VirtualBox USB support
Dont install the Community OSE version, download straight from the website
Configure USB
Now it’s time to configure the system to allow USB support. You have to get the user ID of the vboxusers group. To do this issue the following command:
grep vboxusers /etc/group
which will report something like:
vboxusers:x:501:
su
vim /etc/fstab
none /proc/bus/usb usbfs devgid=501,devmode=664 0 0
With that file saved you are ready to reboot and start up VirtualBox with USB support.
=============================================================

Automatic login
su
vim /etc/gdm/custom.conf
## add this ##
[daemon]
AutomaticLoginEnable=true
AutomaticLogin=Kim
TimedLoginDelay=1


ISO UIF in linux Ubuntu
Convert uif files to ISO
sudo apt-get install uif2iso
# run the conversion command
uif2iso filename.uif filename.iso

Mount ISO as virtual CD Rom
sudo mount filename.iso /media/cdrom0 -o loop

Get a graphic ISO mounting tool
sudo apt-get install gmountiso
gmount-iso will show up in System Tools in your menu. Before mounting you will need to create a mount point. I would suggest in your /media directory:

sudo mkdir /media/virtualcd

-----------------------------

On Ubuntu, there is a tool for converting .nrg files to .iso. To install it, just type:
sudo apt-get install nrg2iso

Tool to make USB bootable
http://unetbootin.sourceforge.net/

Ubuntu: https://launchpad.net/~gezakovacs/+archive/ppa
Add this software source: ppa:gezakovacs/ppa
sudo apt-get install unetbootin
# an incon will then appears under System Tools

Better Network manager on Ubuntu
http://wicd.sourceforge.net/download.php
Installing Wicd in Ubuntu
If you are using Ubuntu 9.04 (Jaunty), Wicd 1.5.9 is in the universe repository, so a simple sudo apt-get install wicd will do it. If you want the latest version of Wicd when it comes out, though, you'll need to add the Wicd repository. Jaunty users who need to download the Wicd deb package can grab it from Ubuntu's Universe repository.
Non-Jaunty versions of Ubuntu (Intrepid, Hardy, etc) or Jaunty users who want the latest updates will have to add the Wicd repository to the Ubuntu package manager. To open the package manager in Gnome, go to Administration > Synaptic Package Manager. When it appears, go to Settings > Repositories > Third Party Software > Add..., and enter the following line:
deb http://apt.wicd.net jaunty extraswhere "jaunty" is your version of Ubuntu in lowercase (dapper, edgy, feisty, gutsy, hardy, intrepid, jaunty). You'll also need to add the key used for signing Wicd by running the following command in a terminal:wget -q http://apt.wicd.net/wicd.gpg -O- | sudo apt-key add -Now, click Reload, and wait while the package lists are downloaded. Now, search for "Wicd", and right click on it. Select Install, then press Apply, and Wicd will automatically be downloaded and installed for you. This will also keep you automatically up to date with the latest and greatest version of Wicd. Please note that this will remove network-manager, which is the default GNOME network manager and may cause loss of network connection temporarily.

sudo apt-get install wicd
# Then reset the automatic startups to disable Network Manager

Install Freemind on Linux
Make sure that Java 6 is installed, then select the default:
sudo /usr/sbin/update-alternatives --config java
Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-4.3
+ 2 /usr/lib/jvm/java-gcj/jre/bin/java
* 3 /usr/bin/jamvm
4 /usr/lib/jvm/java-6-sun/jre/bin/java

Press enter to keep the default[*], or type selection number: 4

Reading: https://help.ubuntu.com/community/Freemind
Add the repository for Freemind:
gksudo gedit /etc/apt/sources.list
Add the following lines:
# freemind source
deb http://eric.lavar.de/comp/linux/debian/ experimental/
deb http://eric.lavar.de/comp/linux/debian/ ubuntu/
Install from the repository:
sudo apt-get update
sudo apt-get install freemind

Manual Install:
First, download the linux version from here: http://sourceforge.net/projects/freemind/files/freemind-unstable/
# mkdir -p /usr/local/share/freemind
# unzip freemind*.zip -d /usr/local/share/freemind
# chmod +x /usr/local/share/freemind/freemind.sh
# ln -s /usr/local/share/freemind/freemind.sh /usr/local/bin/freemind

Ubuntu 9.10 Setup Guide
Install Software Repos:

# Edit software sources manually
sudo apt-get update
sudo gedit /etc/apt/sources.list
# Xubuntu
sudo mousepad /etc/apt/sources.list
# uncomment out universe and multiverse and add these lines at the end:
=======================================

# Google software repository
deb http://dl.google.com/linux/deb/ stable non-free
deb http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main
deb-src http://ppa.launchpad.net/chromium-daily/ppa/ubuntu karmic main

## Medibuntu - Ubuntu 9.10 "karmic koala"
deb http://packages.medibuntu.org/ karmic free non-free
deb-src http://packages.medibuntu.org/ karmic free non-free

## Extra games
deb http://archive.getdeb.net/ubuntu karmic-getdeb games

## Virtual box
deb http://download.virtualbox.org/virtualbox/debian karmic non-free

## Skype
deb http://download.skype.com/linux/repos/debian/ stable non-free

## Below is optional #####################

## IEs4Linux optional
deb http://wine.budgetdedicated.com/apt edgy main

# Mac-On-Linux drivers
deb http://people.debian.org/~jensen woody/

# WICD network manager
deb http://apt.wicd.net jaunty extras
=============================================================================

# keys
Medibuntu:
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xfbef0d696de1c72ba5a835fe5a9bf3bb4e5e17b5
sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring
wget -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
wget -q http://packages.medibuntu.org/medibuntu-key.gpg -O- | sudo apt-key add -
wget -q -O- http://archive.getdeb.net/getdeb-archive.key | sudo apt-key add -
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com DCF9F87B6DFBCBAE
wget -q http://wine.budgetdedicated.com/apt/387EE263.gpg -O- | sudo apt-key add -

sudo apt-get --quiet update

Karmic 9.10 or later: Add ppa:mozillateam/firefox-stable
to your system's Software Sources.

## Fix some expired key errors
sudo rm -f /var/lib/apt/lists/partial/*

===================================
# Install a better wireless network manager (for netbooks), requires deb http://apt.wicd.net jaunty extras:
wget -q http://apt.wicd.net/wicd.gpg -O- | sudo apt-key add -
sudo apt-get install wicd
# Then reset the automatic startups to disable Network Manager

# Medibuntu - Skip this if edit sources manually
sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list http://www.medibuntu.org/sources.list.d/$(lsb_release
-cs).list && sudo apt-get --quiet update && sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring

===================================
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

=================================================

# Install everything desktop, 2 hours!
sudo apt-get -y --force-yes install realplayer mozilla-plugin-vlc gecko-mediaplayer moonlight-plugin-mozilla seamonkey empathy pidgin kopete konversation amsn filezilla transmission azureus gtk-recordmydesktop istanbul xvidcap camorama avidemux kino mjpegtools kdenlive openmovieeditor blender winff xterm dvdauthor ripperx easytag audacity libdvdcss2 k9copy dvdrip rar unrar audacious vlc vlc-plugin-pulse vlc-plugin-ggi vlc-plugin-jack vlc-plugin-pulse vlc-plugin-sdl vlc-plugin-svgalib mozilla-plugin-vlc miro lastfm abiword basket planner gnucash kmymoney2 f-spot filezilla thunderbird gimp amule azureus gnucash scribus amarok audacity banshee mplayer gtkpod kino vlc bluefish kdewebdev ffmpeg lame mjpegtools wget padevchooser vim samba samba-tools system-config-samba sun-java6-jre sun-java6-plugin sun-java6-fonts acroread acroread-fonts chromium-browser wine cabextract playonlinux ttf-mscorefonts-installer ttf-liberation sun-java6-jdk sysv-rc-conf alarm-clock virtualbox-3.0 flashplugin-nonfree xubuntu-restricted-extras w64codecs

# 32bit slow Xubuntu
sudo apt-get -y --force-yes install realplayer mozilla-plugin-vlc gecko-mediaplayer moonlight-plugin-mozilla empathy pidgin kopete konversation amsn filezilla transmission azureus gtk-recordmydesktop istanbul xvidcap camorama avidemux kino mjpegtools kdenlive openmovieeditor blender winff xterm dvdauthor ripperx easytag audacity libdvdcss2 k9copy dvdrip rar unrar audacious vlc vlc-plugin-pulse vlc-plugin-ggi vlc-plugin-jack vlc-plugin-pulse vlc-plugin-sdl vlc-plugin-svgalib mozilla-plugin-vlc miro lastfm abiword basket planner gnucash kmymoney2 f-spot filezilla thunderbird gimp amule azureus gnucash scribus amarok audacity banshee mplayer gtkpod kino vlc bluefish kdewebdev ffmpeg lame mjpegtools wget padevchooser vim sun-java6-jre sun-java6-plugin sun-java6-fonts acroread acroread-fonts wine cabextract playonlinux ttf-mscorefonts-installer ttf-liberation sun-java6-jdk sysv-rc-conf alarm-clock flashplugin-nonfree w32codecs xubuntu-restricted-extras

Minimal:
sudo apt-get -y --force-yes install mozilla-plugin-vlc gecko-mediaplayer moonlight-plugin-mozilla sun-java6-jre sun-java6-plugin sun-java6-fonts sun-java6-jdk flashplugin-nonfree w32codecs

# Skype:
http://www.skype.com/intl/en/download/skype/linux/choose/

# Set better graphics driver, press ALT - F2
compiz --replace

# Better network manager
sudo apt-get -y --force-yes install wicd

# Optional
xchat-gnome compiz compiz-gnome compizconfig-settings-manager compiz-fusion-plugins-extra mythtv googleearth gnomescan xtightvncviewer k3b libk3b6-extracodecs libk3b2-mp3 bridge-utils mono-gmcs mono-gac mono-utils monodevelop monodoc-browser monodevelop-nunit monodevelop-versioncontrol mono-xsp2 mono-xsp2-base asp.net2-examples
# 32bit
w32codecs

# install opera
http://www.opera.com/download/

# IE4Linux - skip this if install playonlinux
wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
tar zxvf ies4linux-latest.tar.gz
cd ies4linux-*
./ies4linux

Administration | Synaptic Package Manager |

sudo update-alternatives --config java
select the proper "sun" java implementation

Optimize boot time: http://www.extremetech.com/article2/0,2845,2114124,00.asp
sudo sysv-rc-conf

Fix TCP/IP Window Scaling, needed to access certain legacy https websites
sudo vim /etc/sysctl.conf
# add these lines
net.ipv4.tcp_wmem = 4096 16384 131072
net.ipv4.tcp_rmem = 4096 87380 174760
# activate the change
sudo sysctl -p

sudo apt-get -y install firestarter
sudo iptables -t mangle -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS -clamp-mss-to-pmtu

Read about ethernet bridging http://ubuntuforums.org/showthread.php?t=91370

==== 64 bit Ubuntu ONLY ==============

sudo apt-get install ia32-libs lib32asound2 libqt4-core libqt4-gui
# wget -O skype_ubuntu-2.0.0.72-1_amd64.deb http://www.skype.com/go/getskype-linux-ubuntu-amd64
wget http://www.skype.com/go/getskype-linux-beta-ubuntu-64
# sudo dpkg -i skype_ubuntu-2.0.0.72-1_amd64.deb
sudo dpkg -i skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb
rm -f skype-ubuntu-intrepid_2.1.0.81-1_amd64.deb

# optional: clean up legacy flash
sudo rm -f /usr/lib/mozilla/plugins/*flash*
sudo rm -f ~/.mozilla/plugins/*flash*
sudo rm -f /usr/lib/firefox/plugins/*flash*
sudo rm -rfd /usr/lib/nspluginwrapper
sudo apt-get install ia32-libs nspluginwrapper
cd /tmp/

# Skype 64 bit
sudo apt-get remove skype
sudo apt-get install ia32-libs lib32asound2 libqt4-core libqt4-gui
wget -O skype_ubuntu-2.0.0.72-1_amd64.deb http://www.skype.com/go/getskype-linux-ubuntu-amd64
sudo dpkg -i skype_ubuntu-2.0.0.72-1_amd64.deb

# download adobe Flash: http://get.adobe.com/flashplayer. Get the tar.gz version
tar zxvf install_flash_player_10_linux.tar.gz
sudo cp libflashplayer.so /usr/lib/mozilla/plugins/
sudo nspluginwrapper -i /usr/lib/mozilla/plugins/libflashplayer.so
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/mozilla/plugins/
sudo ln -sf /usr/lib/nspluginwrapper/plugins/npwrapper.libflashplayer.so /usr/lib/firefox-addons/plugins/
# optimize adobe
sudo mkdir /etc/adobe
echo "OverrideGPUValidation=true" > /tmp/mms.cfg
sudo mv /tmp/mms.cfg /etc/adobe/

# Real-player manual install (may not be necessary)
cd /tmp/
wget http://www.real.com/realcom/R?href=http://forms.real.com/real/player/download.html?f=unix/RealPlayer11GOLD.bin
# then do "dir" | mv "filename1" "filename2"
chmod +x RealPlayer11GOLD.bin
sudo ./RealPlayer11GOLD.bin
rm -f RealPlayer11GOLD.bin

========== End 64 bit Ubuntu =============================

Example command to add ppa:
sudo add-apt-repository ppa:[example|freenx-team]

===========================================
Disable sound:
System | Preferences | Sound

Automatic Logon:
System | Administration | Login Screen

# Install crossover professional:
sudo su
# click and drag the install file into terminal, such as: '/media/kimconnect/linux/Crossover.Linux.Pro.8-DJM/install-crossover-pro-8.0.0.sh'
# restore the bottle for a quicker install recovery

===================================================

# Java Install in Firefox 3.6

wget http://javadl.sun.com/webapps/download/AutoDL?BundleId=37391
cd /opt
sudo mkdir java
cd java
sudo mkdir 32
sudo mv ~/jre-6u18-linux-i586.bin /opt/java/32
sudo chmod 755 /opt/java/32/jre-6u18-linux-i586.bin
cd /opt/java/32
sudo ./jre-6u18-linux-i586.bin
sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/32/jre1.6.0_18/bin/java" 1
sudo update-alternatives --set java /opt/java/32/jre1.6.0_18/bin/java

mkdir ~/.mozilla/plugins
rm ~/.mozilla/plugins/libjavaplugin_oji.so
rm ~/.mozilla/plugins/libnpjp2.so
ln -s /opt/java/32/jre1.6.0_18/lib/i386/libnpjp2.so ~/.mozilla/plugins/
========================================================
Driver problems with Netgear wireless
lspci | grep Marvell
sudo apt-get install ndiswrapper-common ndiswrapper-utils-1.9
# cd to your desktop or home folder where the driver is downloaded
cd "WG311v3 V1.0/Driver/Windows 2000"
sudo ndiswrapper -i WG311v3.INF
sudo modprobe ndiswrapper
sudo ndiswrapper -m

=====================================
Driver problem with resolution stuck at 800 x 600
Solution:
lspci | grep VGA
# figure out what graphics card driver should be used, then
sudo vim /etc/X11/xorg.conf
### Add this to the blank file, after discovering the Horizontal/Vertical Sync rates ##
Section "Monitor"
Identifier "Unknown Monitor"
HorizSync 31.5-79.97
VertRefresh 60.0-75.02
EndSection

Section "Screen"
Identifier "Default Screen"
Monitor "Unknown Monitor"
Device "Configured Video Device"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768" "800x600" "640x480"
EndSubSection
EndSection

########
then copy the contents from here: http://ubuntuforums.org/showpost.php?p=5039883&postcount=12
Save the file and reboot

Slow computer Xubuntu
sudo aptitude update && sudo aptitude install xubuntu-desktop

Set auto login
Press Alt-F2: gksudo gdmsetup
sudu apt-get remove kdm

Simple commands
rm -f directory
rmdir mydir - removes the directory mydir
rm -r directory - would remove a directory, even if files existed in that directory.

Linux and SMB

Run this command to discover available shares:
smbclient -L [servername or IP]

The following shows a typical use of smbmount to mount an SMB share called "customers" from a machine called "samba1":

[root@postel]# smbmount "\\\\samba1\\customers" -U void -c 'mount /customers -u 500 -g 100'
Added interface ip=192.168.35.84 bcast=192.168.255.255 nmask=255.255.0.0
Got a positive name query response from 192.168.168.158 ( 192.168.168.158 )
Server time is Tue Oct 5 10:27:36 1999
Timezone is UTC-4.0
Password:
Domain=[IPM] OS=[Unix] Server=[Samba 2.0.3]
security=user
Issuing a mount command will now show the share mounted, just as if it were an NFS export:

[root@postel]# mount
/dev/hda2 on / type ext2 (rw)
none on /proc type proc (rw)
none on /dev/pts type devpts (rw,mode=622)
//SAMBA1/CUSTOMERS on /customers type smbfs (0)
Please see the manual pages for smbmount and smbumount for details on the above operation.

Install Office 2003 / 2007 in LinuxIt's best to use CrossOver: http://www.codeweavers.com/support/docs/crossover-pro/install

Here's the open source:

Office 2003 http://www.wine-reviews.net/microsoft/running-ms-office-2003-under-linux-with-wine-0952.html
Office 2007: only Word / Excel works

Linux Windows Active Directory Integration
http://technet.microsoft.com/en-us/magazine/2008.12.linux.aspx

How to install OpenVPN on Centos 5
1. Register for an account at http://www.openvpn.net
2. Log into Centos 5 server as root
cd /home
wget http://www.openvpn.net/images/download/openvpn-as-1.3.4-CentOS5.x86_64.rpm
rpm -i openvpn-as-1.3.4-CentOS5.x86_64.rpm
# run initialization script
/usr/local/openvpn_as/bin/ovpn-init

Type "yes" to agree with the TOS
Type "1" to enable Admin Web UI on all interfaces
Press Enter to accept default Admin UI port 943
Press Enter again to accept TCP port number default 1194 for OpenVPN Daemon
Press Enter 4 more times to accept the defaults

# Create two new users in the Linux machine
adduser vpnuser1
adduser vpnuser2
passwd vpnuser1
# password = void
passwd vpnuser2
# password = void

Gateway firewall to forward ports 943, 443, 1194 to the VPN server

On the remote machine, go to https://[server IP address]:943/admin
-------------
Configuration
-------------
Enter the license key: LAMU-F3A9-T87U-F8AX
VPN Mode: routing
VPN Settings: route (to mask your internet traffic)
Client Settings: Make Generic client visible to all users on the Client Web Server
User permission: add vpnuser1 (admin) and vpnuser2 (user)
-------------
Authentication
-------------
General: pick PAM. RADIUS and LDAP (Windows AD integration)
Example: LDAP
Primary server: si-nt1.si_hq.com
Credentials for initial bind: anonymous
Base DN: CN=Users, DC=si_hq, DC=com
Additional LDAP Requirement: memberOf=CN=VPN Users, CN=Users, DC=si_hq, DC=com

Best proxy server is Linux / SQUID & openVPN

Ubuntu Repo
Add this using the Software Center
deb http://packages.medibuntu.org/ karmic free non-free

--------------------------- Add Many Repos http://repogen.simplylinux.ch/ -----------------------------------------------------
Replace your /etc/apt/sources.list with the following one. For adding GPG keys of new repos, see instruction (if available) in the sources.list below itself.
For more information see here

############################################################# ################### OFFICIAL UBUNTU REPOS ################### ############################################################# ###### Ubuntu Main Repos deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse ###### Ubuntu Update Repos deb http://us.archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb http://us.archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse ###### Ubuntu Partner Repo deb http://archive.canonical.com/ubuntu karmic partner deb-src http://archive.canonical.com/ubuntu karmic partner ############################################################## ##################### UNOFFICIAL REPOS ###################### ############################################################## ###### 3rd Party Binary Repos #### Skype - http://www.skype.com ## Run this command: gpg --keyserver pgp.mit.edu --recv-keys 0xd66b746e && gpg --export --armor 0xd66b746e | sudo apt-key add - deb http://download.skype.com/linux/repos/debian/ stable non-free #### VLC Media Player - http://www.videolan.org/vlc/ ## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40130828 deb http://ppa.launchpad.net/c-korn/ppa/ubuntu karmic main #### Wine - http://www.winehq.org/ ## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0 deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu karmic main
Getting the GPG keys:
gpg --keyserver pgp.mit.edu --recv-keys 0xd66b746e && gpg --export --armor 0xd66b746e | sudo apt-key add - sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40130828 sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0
Alternate layout for synaptic:
############################################################# ################### OFFICIAL UBUNTU REPOS ################### ############################################################# ###### Ubuntu Main Repos deb http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic main restricted universe multiverse ###### Ubuntu Update Repos deb http://us.archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse deb http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb http://us.archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-security main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-updates main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ karmic-proposed main restricted universe multiverse ###### Ubuntu Partner Repo deb http://archive.canonical.com/ubuntu karmic partner deb-src http://archive.canonical.com/ubuntu karmic partner ############################################################## ##################### UNOFFICIAL REPOS ###################### ############################################################## ###### 3rd Party Binary Repos ## Run this command: gpg --keyserver pgp.mit.edu --recv-keys 0xd66b746e && gpg --export --armor 0xd66b746e | sudo apt-key add - deb http://download.skype.com/linux/repos/debian/ stable non-free # Skype - http://www.skype.com ## Run this command: sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 40130828 deb http://ppa.launchpad.net/c-korn/ppa/ubuntu karmic main # VLC Media Player - http://www.videolan.org/vlc/ ## Run this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F9CB8DB0 deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu karmic main # Wine - http://www.winehq.org/

Windows Emulator inside Ubuntu 9.10
# Add the Wine repository
sudo add-apt-repository ppa:ubuntu-wine/ppa
sudo apt-get install wine1.2
cd /home/[username]
# this installs winetricks and fixes the "unable to find a volume for file extraction" error
wget http://winezeug.googlecode.com/svn/trunk/winetricks && sh winetricks volnum
# this installs dotnet2.0 sp2,, set wine to XP emulation and a few other things
sh winetricks d3dx9 ie7 mdac28 jet40 mono24 vb6runsp6 wsh56 wsh56vb fakeie6 winxp volnum dotnet20sp2

Now, install PlayOnLinux:
----
sudo wget http://deb.playonlinux.com/playonlinux_karmic.list -O /etc/apt/sources.list.d/playonlinux.list
sudo apt-get update
sudo apt-get install playonlinux

---------------------------------

How to remove Wine:
sudo apt-get remove wine
rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/wine*
rm -rf $HOME/.local/share/applications/wine
rm -f $HOME/.local/share/desktop-directories/wine*
rm -f $HOME/.local/share/icons/????_*.xpm

Ubuntu 9.10 Java Install
sudo apt-get install sun-java6-jre sun-java6-plugin sun-java6-fonts

How to install openVPN on Centos 5
Configure VPN

I. Setting up DMZ to forward all ports from Gateway to Router (Linux box with VPN/Squid)
1. Set up QoS settings on router
2. Ensure that Gateway is on a different subnet from the Router
3. Connet gateway LAN port into the WAN port of router
4. Set the WAN port of router to pull an IP address via DHCP
5. Configure the router IP address to DMZplus mode in the Gateway's firewall
6. Restart the router
7. Test Internet access from an internal PC

II. Install VPN/Squid on a Linux box
1. Install OpenVPN (http://www.webhostingtalk.com/showthread.php?t=595436)
yum install openssl openssl-devel
yum install openvpn -y

find / -name "easy-rsa"

#you should get an output like this…

/usr/share/doc/openvpn-2.0.9/easy-rsa

#Now, make a copy of the easy-rsa directory, to /etc/openvpn/ ( make sure you #have put the right version number in i.e. mine was -2.0.7, change if needed)

cp -R /usr/share/doc/openvpn-2.0.9/easy-rsa /etc/openvpn/
cd /etc/openvpn/easy-rsa
chmod 777 *
mkdir /etc/openvpn/keys
vim vars

Find: export KEY_DIR=$D/keys
Change: export KEY_DIR=/etc/openvpn/keys
Change:
export KEY_COUNTRY=US
export KEY_PROVINCE=CA
export KEY_CITY="Santa Ana"
export KEY_ORG="kimconnect.com"
export KEY_EMAIL=kim@kimconnect.com

# Now its time to make the certificates, enter these commands
. ./vars
./clean-all
./build-ca
# press enter repeatedly to accept defaults, excetp Common Name, this must be unique
# call it something like kimconnect.com
./build-key-server server
# Common name = server1
# Challenge password = void
# 'y' to accept signing certificate

./build-key client1
# common name = kimconnect.com-client1
# challenge password = void

./build-key client2
# common name = kimconnect.com-client2
# challenge password = void

./build-dh
# will take a long time

create a few config files, you can download a template from:
cd /etc/openvpn
wget www.designpc.co.uk/downloads/server.conf

# We are almost done now… right we need to create a few config files, you can download from here:
cd /etc/openvpn
wget http://svn.openvpn.net/projects/openvpn/trunk/openvpn/sample-config-files/server.conf
vim server.conf
# change: server 10.8.0.0 255.255.255.0 # to: server 192.168.1.5 255.255.255.0
# if everyone will be using the same key, then uncomment this line: ;duplicate-cn
# uncomment: ;log openvpn.log
# change DNS server IP address

# make log file
touch openvpn.log
# make the IP reservation list
touch ipp.txt

# You need to make a few changes to OpenVPN itself. Go to..

cd /etc/init.d/
vim openvpn
# uncomment this line: echo 1 > /proc/sys/net/ipv4/ip_forward
# add these below
iptables -t nat -A POSTROUTING -s 192.168.1.3 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.4 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.5 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.6 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.7 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.8 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.9 -j SNAT --to 99.74.247.163
iptables -t nat -A POSTROUTING -s 192.168.1.10 -j SNAT --to 99.74.247.163


iptables -A INPUT -j ACCEPT -s 192.168.1.0/24 -i tun0
iptables -A OUTPUT -j ACCEPT -s 192.168.1.0/24 -o tun0
iptables -A FORWARD -j ACCEPT -p all -s 0/0 -i tun0
iptables -A FORWARD -j ACCEPT -p all -s 0/0 -o tun0
iptables -t nat --flush
iptables -t nat -A POSTROUTING -o eth1 -s 192.168.1.0/24 -j SNAT --to 99.74.247.163

Gateway Firewall: Forward port 1194 to server1 192.1.1.5
On the client machine, install openVPN client for Windows: http://openvpn.se/files/install_packages/openvpn-2.0.9-gui-1.0.3-install.exe

You need to copy a few files from the server to your client machine, here is the list, located in /etc/openvpn/keys/
cd /etc/openvpn/keys
cp ca.crt /home/share
cp client1.csr /home/share
cp client1.key /home/share
cp client1.crt /home/share
# Note /home/share is accessible via SMB so that you can download it to USB Drive
# Put these files in this directory C:\Program Files\OpenVPN\config\ of the Windows Client Machine

Make a client config file, client1.opvn and put it in C:\Program Files\OpenVPN\config\
--------
client
dev tun
proto udp

#Change my.publicdomain.com to your public domain or IP address
remote kimconnect.com 1194

resolv-retry infinite
nobind
persist-key
persist-tun

ca ca.crt
cert client1.crt
key client1.key

ns-cert-type server

#DNS Options here, CHANGE THESE !!
push "dhcp-option DNS 192.168.1.254"
push "dhcp-option DNS 99.74.247.163"

comp-lzo

verb 3
----------------------------------------------
To connect right click
on OpenVPN in the taskbar >> Connect

To test ping 192.168.1.254

Enable Mod_rewrite url rewrite
vim /etc/httpd/conf/httpd.conf

Line 306, change the directory name to:
<Directory "/home/www">

line 237, set:
AllowOverride All

Line 564, if you're using cgi-bin:
ScriptAlias /cgi-bin/ "/home/www/cgi-bin/"

Line 570, change to "/home/www/cgi-bin" and AllowOverride all

Linux set processes programs to automatically start
on a fedora core box, use chkconfig like this:

Code:
chkconfig --level 345 httpd on
chkconfig --level 2345 mysqld on

you might also find this useful so you can get visual gratification after turning on services...

Code:
chkconfig --list

0 — Halt
1 — Single-user mode
2 — Not used (user-definable)
3 — Full multi-user mode
4 — Not used (user-definable)
5 — Full multi-user mode (with an X-based login screen)
6 — Reboot

Install IonCube
http://www.webhostgear.com/77.html
ionCube produces leading tools for PHP source code protection to secure your PHP software from prying eyes and to combat software piracy. Featuring an advanced compiled-code encoding engine that translates source to highly efficient bytecodes, ionCube encoding tools deliver the ideal combination of maximum source code protection without sacrificing performance, reliability or language compatibility.

In order to view encoded ionCube files on your server you need the ionCube loader. This is a free plugin for Apache web server that only takes a few minutes to install and is well worth it.
http://www.ioncube.com/
Requirements:
- Root Shell access to your server
- phpinfo page: create a new document and call it phpinfo.php. Inside place phpinfo();
Place this document in your www directory so you can view it and see all your PHP settings.
Installing ionCube Loader:
1. Download the program and store it on your server using wget or FTP.
http://www.ioncube.com/loader_download.php
wget http://downloads2.ioncube.com/loader_downloads/ioncube_loaders_lin_x86-64.tar.gz

Article provided by WebHostGear.com

2. Unpack the program
tar -zxvf ioncube_loaders_lin_x86-64.tar.gz
3. cd ioncube
4. copy ioncube-install-assistant.php to a web directory such as your hosting directory and open it in your browser window.
cp ioncube-install-assistant.php /home/userdirectoryhere/www
Then open it http://www.yourdomain.com/ioncube-install-assistant.php
The output should be something similar to:
Analysis of your system configuration shows:
PHP Version 4.3.3
Operating System Linux
Threaded PHP No
php.ini file /usr/local/lib/php.ini
Required Loader ioncube_loader_lin_4.3.so
5. Now lets move the iconcube directory to a permanent location:
cd ..
mv ioncube /usr/local

6. Now that you know the location of php.ini you need to edit it.
pico /usr/local/lib/php.ini
Now find where other zend extentions are in the file.
ctrl + w: zend_extension
Paste in your new line for ioncube loader
zend_extension = /usr/local/ioncube/ioncube_loader_lin_4.3.so
7. Save the changes
ctrl + X then Y and enter
8. Restart the web server to take effect.
/etc/init.d/httpd restart
Success! You should now see a section in your PHP Info page that says:
Additional Modules
Module Name ionCube Loader

Bandwidth calculator
Convert Kbps to GB/month Formula =A2*60*60*24*30/8/1000/1000 (use Excel)
------------------------------------------------
20000 Kbps = 6480 Gb/month
950 Kbps = 307.8 Gb/month
1450 Kbps = 469.8 Gb/month or 15 Gb/day = 0.6525 Gb/hr = 0.0108Gb/min = 111.36 Mb/m = 1.856 Mb/s
1900 Kbps = 615.6 Gb/month

Crontab -e Maintainance
Source: http://www.cyberciti.biz/tips/shell-script-to-watch-the-disk-space.html
vim /home/diskAlert
----
#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs|cdrom' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 50 ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" |
mail -s "Alert: Server1 disk space usage is now passing $usep%" admin@cafecenter.com
fi
done
----
crontab -e
----
10 0 * * * /home/diskAlert

Backup and Restore
Follow instructions here: http://httpremix.com/automating-server-backups-using-rsync-ssh-cron-on-a-windows-machine

1. Remote machine is Centos and Local machine is Windows, install Cygwin (including "Admin," "Base," "Devel," and "Net")
2. Create SSH key
#local machine$ ssh-keygen -t dsa
#remote machine$ ssh-keygen -t dsa
#remote machine$ vim ~/.ssh/authorized_keys
run as root, and enter the copied key from C:\cygwin\home\[username]\.ssh\id_rsa.pub
Edit /etc/ssh/sshd_config and uncomment:
RSAAuthentication yes
PubkeyAuthentication yes3.

Install FFMEG - The Lastest Version & all the other audio video codecs
The laziest way:
yum install httpd gnome-user-share mod_perl mod_python mod_ssl php php-devel phpmyadmin system-config-httpd webalizer php-cli php-common php-eaccelerator php-gd php-ldap php-mbstring php-mcrypt php-mysql php-odbc php-pdo
yum install ffmpeg ffmpeg-devel

Auto Installer way:
cd /home/ffmpeg-sources
wget ovh.dl.sourceforge.net/sourceforge/ffmpeginstall/ffmpeginstall.3.2.1.tar.gz
tar -xzvf ffmpeginstall.3.2.1.tar.gz
cd ffmpeginstall.3.2.1
./install.sh
follow instructions and enter path to php.ini (/etc/php.ini)

Install prerequisites:
yum -y install gcc gcc-cpp gcc-c++ zlib-devel git-svn ruby libcurses-ruby php-gd php-devel autoconf automake libtool git subversion ruby freetype ncurses-devel freetype-devel
------- The below line is if you're lazy ---------
yum -y install a52 faad2 faac lame yasm gpac x264 x265 xvid libdraw1394 libdc1394-2 LIBVORBIS libogg LIBTHEORA gsm

Untested command - may not be necessary:
yum install zlib-devel libmad-devel libvorbis-devel libtheora-devel lame-devel faac-devel a52dec-devel xvidcore-devel

Note: the following are already installed in the system by having Centos 5.2 and DAG/RPMForge updated
libraw1394 1.3.0-1.el5 (not updated yet)
libtheora 1.0alpha7-1.x86_64
libvorbis 1:1.1.2-3.el5_1.2.x86_64

Create a container for FFMPEG sources:
mkdir /var/ffmpeg-sources
cd /var/ffmpeg-sources

Install a52 (http://liba52.sourceforge.net/)
----
cd /home/ffmpeg-sources
wget http://liba52.sourceforge.net/files/a52dec-0.7.4.tar.gz
tar -zxf a52dec-0.7.4.tar.gz
cd a52dec-0.7.4
./configure --enable-shared=PKGS
make && make install

Installing FAAD2 (Check updates http://www.audiocoding.com/)
----
cd /home/ffmpeg-sources
wget http://downloads.sourceforge.net/project/faac/faad2-src/faad2-2.7/faad2-2.7.tar.gz?use_mirror=softlayer
tar -zxf faad2-2.7.tar.gz
cd faad2-2.7
autoreconf -vif
./configure
make && make install

Installing FAAC Audio Encoder (http://www.audiocoding.com/)
----
cd /home/ffmpeg-sources
wget http://superb-east.dl.sourceforge.net/sourceforge/faac/faac-1.28.tar.gz
tar zxfv faac-1.28.tar.gz
cd faac-1.28
./bootstrap
./configure
make && make install

LAME MP3 Encoder (check updates here)
----
cd /home/ffmpeg-sources
wget http://internap.dl.sourceforge.net/sourceforge/lame/lame-398-2.tar.gz
tar zxfv lame-398-2.tar.gz
cd lame-398-2
./configure
make
make install

Installing yasm - An Assembly language (update here: http://www.tortall.net/projects/yasm/wiki/Download)
---- Had to use "yum install yasm" because below has errors -----
cd /home/ffmpeg-sources
wget http://www.tortall.net/projects/yasm/releases/yasm-0.8.0.tar.gz
tar zfvx yasm-0.8.0.tar.gz
cd yasm-0.8.0
./configure
make && make install

Install GPAC
cd /home/ffmpeg-sources
wget http://downloads.sourceforge.net/project/gpac/GPAC/GPAC%200.4.5/gpac-0.4.5.tar.gz?use_mirror=softlayer
tar -xzvf gpac-0.4.5.tar.gz
cd gpac
chmod +x configure
./configure
make
make install
make install-lib
GLUT component causing "-lglut" errors
yum install freeglut
Source: http://forums.nvidia.com/lofiversion/index.php?t46575.html
Typically this is because the SDK makefiles look for libglut.so and not for
variants of it (like libglut.so.3). To confirm this is the problem, simply
run the following command.

ldconfig -p | grep glut

You should see the following (or similar) output.

lrwxrwxrwx 1 root root 16 Jan 9 14:06 libglut.so.3 -> libglut.so.3.8.0
-rwxr-xr-x 1 root root 164584 Aug 14 2004 libglut.so.3.8.0

If you have libglut.so.3 in /usr/lib, simply run the following command
as root.

ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so
---------------- x264 -------------
x264 & LIBx264
cd /home/ffmpeg-sources
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-pthread --enable-mp4-output --enable-shared
make
make install

Update the links to the shared libraries
# ldconfig

------------------------ Untested ------------------------------------------------------
For solving the problem with x264
----
cd /var/ffmpeg-sources
wget http://kernel.org/pub/software/scm/git/git-1.6.1.tar.gz
tar xvfz git-1.6.1.tar.gz
cd git-1.6.1
git clone git://git.videolan.org/x264.git
cd x264
./configure --enable-shared && make && sudo make install

-- unsure ---
./configure --enable-shared --prefix=/usr && make && sudo make install

---------------------------------------------------------------------------------------

Installing Xvid (Check updates: http://www.xvid.org/)
----
cd /home/ffmpeg-sources
wget http://downloads.xvid.org/downloads/xvidcore-1.2.2.tar.gz
tar zxfv xvidcore-1.2.2.tar.gz
cd xvidcore/build/generic
./configure
make
make install

Installing libraw1394 (http://sourceforge.net/projects/libraw1394/files/)
----
cd /home/ffmpeg-sources
wget http://sourceforge.net/projects/libraw1394/files/libraw1394/libraw1394-2.0.4.tar.gz/download
tar zxfv libraw1394-2.0.4.tar.gz
cd libraw1394-2.0.4
./configure
make && make install

Installing libdc1394-2 (http://sourceforge.net/project/showfiles.php?group_id=8157)
----
cd /home/ffmpeg-sources
wget http://downloads.sourceforge.net/project/libdc1394/libdc1394-2/2.1.2/libdc1394-2.1.2.tar.gz?use_mirror=softlayer
tar zxfv libdc1394-2.1.2.tar.gz
cd libdc1394-2.1.2
./configure
make && make install

libvorbis & libogg Vorbis is a fully open, non-proprietary, patent-and royalty-free, general-purpose compressed audio format for audio and music at fixed and variable bitrates from 16 to 128 kbps/channel. The libvorbis package contains runtime libraries for use in programs that support Ogg Vorbis. Ogg must be installed prior to Libvorbis
Check update: http://www.xiph.org/downloads/
---- Libogg ---
cd /home/ffmpeg-sources
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.4.tar.gz
tar -xzvf libogg-1.1.4.tar.gz
cd libogg-1.1.4
./configure
make && make install
---- Libvorbis ---
cd /home/ffmpeg-sources
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.2.3.tar.gz
tar -xzvf libvorbis-1.2.3.tar.gz
cd libvorbis-1.2.3
./configure
make && make install

libtheora Theora is a free and open video compression format from the Xiph.org Foundation. Requires Libogg!!!
Check update: http://www.xiph.org/downloads/
----
cd /home/ffmpeg-sources
wget http://downloads.xiph.org/releases/theora/libtheora-1.1.1.tar.bz2
tar -xjvf libtheora-1.1.1.tar.bz2
cd libtheora-1.1.1
./configure
make && make install

Update the links to the shared libs
# ldconfig

GSM Lossy Speech Compression - Check for updates here
Author's website: http://user.cs.tu-berlin.de/~jutta/toast.html
---- Errors with install this, so just use yum install gsm gsm-devel ---
cd /home/ffmpeg-sources
wget http://user.cs.tu-berlin.de/%7Ejutta/gsm/gsm-1.0.13.tar.gz
tar -xvzf gsm-1.0.13.tar.gz
cd gsm-1.0-pl13
make && make install

Older version install instructions:
----
Install libgsm1-dev (aka: libgsm) - check for updates here
----
cd /var/ffmpeg-sources
wget http://user.cs.tu-berlin.de/~jutta/gsm/gsm-1.0.12.tar.gz
tar xzvf gsm-1.0.12.tar.gz
cd gsm-1.0-pl12
vim Makefile
----
INSTALL_ROOT = /usr <====== type "/usr/local"
GSM_INSTALL_INC = $(GSM_INSTALL_ROOT)/include <===== type "include"
----
make
make install
Note: there will be some errors, just ignore them - ./configure FFMPEG and you'll see that GSM is installed

AMR (http://www.penguin.cz/~utx/amr)
3G cellphones use the AMR wideband and narrowband codecs for audio streams in .3gp video files.
Only install this if you are including these in FFMPEG ./configure
=== AMRWB Codecs ===
cd /home/ffmpeg-sources
wget http://ftp.penguin.cz/pub/users/utx/amr/amrwb-7.0.0.3.tar.bz2
tar -xjf amrwb-7.0.0.3.tar.bz2
cd amrwb-7.0.0.3
./configure
make && make install
=== AMRNB Codecs ===
cd /home/ffmpeg-sources
wget http://ftp.penguin.cz/pub/users/utx/amr/amrnb-7.0.0.2.tar.bz2
tar -xjf amrnb-7.0.0.2.tar.bz2
cd amrnb-7.0.0.2
./configure
make && make install
----

Make sure that that your /etc/ld.so.conf includes the directory where these 3 libraries just got installed (usually its /usr/local/lib). Mine didn’t so I had to add it:
create the file /etc/ld.so.conf.d/ffmpeg.conf
add the line /usr/local/lib
then run ldconfig

FLAC / LIBFLAC - Free Lossless Audio Codec
Check updates: http://flac.sourceforge.net/download.html
----
cd /home/ffmpeg-sources
wget http://downloads.xiph.org/releases/flac/flac-1.2.1.tar.gz
tar -xzvf flac-1.2.1.tar.gz
cd flac-1.2.1
./configure
make && make install

SWSCALE Video scaler, part of FFMPEG coding
Codecs included in the FFMPEG Subversion

PTHREADS multi-threading, part of FFMPEG coding
Codecs included in the FFMPEG Subversion

x11GRAB
Codecs included in the FFMPEG Subversion

POSTPROC
Codecs included in the FFMPEG Subversion

FFMPEG (http://ffmpeg.mplayerhq.hu/download.html)
----
cd /home/ffmpeg-sources
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
cd ffmpeg
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/share/man --shlibdir=/usr/lib64 --enable-shared --extra-cflags=-fPIC --enable-libmp3lame --enable-libvorbis --enable-postproc --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libtheora --enable-libx264 --enable-libxvid --disable-stripping --enable-gpl --enable-small --enable-bzlib --enable-zlib --enable-nonfree --enable-libgsm

NOT WORKING --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
--- OR ---
./configure --enable-shared --extra-cflags=-fPIC --enable-libmp3lame --enable-libvorbis --enable-postproc --enable-pthreads --enable-x11grab --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libtheora --enable-libx264 --enable-libxvid --disable-stripping --enable-gpl --enable-small --enable-bzlib --enable-zlib --enable-nonfree --enable-libgsm --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-version3
make
make install

---- Non-free codecs ----
--enable-nonfree --enable-libamr_wb --enable-libamr_nb
---- ------------------------------ ----

Post-Installation Actions
----------------------------------------------------------
After the install in complete, you may need to add the /usr/local/lib directory to your ld.so.config file. Make a new file called ffmpeg.conf:
# cd /etc/ld.so.conf.d
# vim ffmpeg.conf
---- insert this line into the new file ---
/usr/local/lib
----
# sudo ldconfig -v
----------------------------------------------------------
set selinux to allow libavcodec.so.52:
# chcon -t textrel_shlib_t /usr/local/lib/libavcodec.so.52

===============================================================================================
How to remove FFMPEG:
yum -y remove faad2 faac lame yasm x264 x264-devel libdc1394 libvorbis libogg libtheora gsm amrwb amrnb flac ffmpeg ffmpeg-devel arts firstboot lame-devel gsm-devel amrnb-devel amrwb-devel faac-devel faad2-devel libsndfile sox speex twolame vorbis-tools system-config-keyboard system-config-soundcard flvtool2 mencoder mplayer ffmpeg-libpostproc


Reinstall so that all libraries are compatible:
yum -y update libtool-ltdl libtool-ltdl-devel libstdc gcc gcc-c++ libgcc gd gd-devel gettext freetype freetype-devel ImageMagick ImageMagick-devel libpng libpng-devel libstdc++44 libstdc++ libtiff libtiff-devel libungif libungif-devel libxml2 libxml2-python zlib-devel automake

yum -y install ffmpeg ffmpeg-devel faad2 faac lame yasm x264 x264-devel libdc1394 libvorbis libogg libtheora gsm amrwb amrnb flac ffmpeg ffmpeg-devel arts firstboot lame-devel gsm-devel amrnb-devel amrwb-devel faac-devel faad2-devel libsndfile sox speex twolame vorbis-tools system-config-keyboard system-config-soundcard flvtool2 mencoder mplayer

Install ffmpeg-php
Dont forget to configure uploading size and everything
Verify ffmpeg installation:

php -i | grep -i ffmpeg
==============================================================================================

Install Mencoder

Get latest version of mencoder (mplayer) from svn:
----
cd /home/ffmpeg-sources
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd mplayer
./configure
make
make install

get codecs (check for latest release and download the correct version x86 or AMD64):
----
cd /home/ffmpeg-sources
wget http://www3.mplayerhq.hu/MPlayer/releases/codecs/essential-amd64-20071007.tar.bz2
tar xvjf essential-amd64-20071007.tar.bz2

Create and import the Codecs directory:
----
mkdir /usr/local/lib/codecs/
mv essential-amd64-20071007/* /usr/local/lib/codecs/
chmod -Rf 755 /usr/local/lib/codecs/

============================================================================================================
Install flvtool2 (check for latest release):
cd /home/ffmpeg-sources
wget http://rubyforge.org/frs/download.php/17497/flvtool2-1.0.6.tgz
tar -zxvf flvtool2-1.0.6.tgz
cd flvtool2-1.0.6
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

========================================================================================================
Install FFMPEG-PHP(check for latest release):

cd /home/ffmpeg-sources
wget http://downloads.sourceforge.net/ffmpeg-php/ffmpeg-php-0.6.0.tbz2?use_mirror=voxel
tar -xjf ffmpeg-php-0.6.0.tbz2
cd ffmpeg-php-0.6.0
vim ffmpeg_frame.c
Now run this command:
:%s/PIX_FMT_RGBA32/PIX_FMT_RGB32
phpize
./configure
make
make install

Source: http://panchathan.wordpress.com/2009/05/03/make-ffmpeg_framelo-error-1/
If you get the following error while compiling ffmpeg-php module,
make: *** [ffmpeg_frame.lo] Error 1

then use the command to fix it “cp ffmpeg_frame.loT ffmpeg_frame.lo” and compile ffmpeg-php once again.

------ Edit PHP.INI Add at the end of file -------
vim /etc/php.ini
---- Add at the end ----
[ffmpeg]
extension=ffmpeg.so

service httpd restart

Centos 5.3 Server preparation for web hosting
These are compatible Repositories I think: FreshRPMS, Dries, NewRPMS and PlanetCCRMA

Note: to update PHP and MySQL, you must use the "Remi" repository. Repos protection must be disabled prior to that install.

yum install yum-priorities
vim /etc/yum/pluginconf.d/priorities.conf
----
[main]
enabled=1
----

Install RPMForge:
cd /home
wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt //install DAG's GPG key
rpm -K rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm //verify package
rpm -i rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm //install

Epel (conflict with RPMForge!)
su -c 'rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm'
...
su -c 'yum install foo'
---
vim /etc/yum.repos.d/epel.repo
enabled=1
Add priority=3

How to remove Epel:
rpm -e epel-release-5-3.noarch
rm -y /etc/yum.repos.d/epel.repo
rm -y /etc/yum.repos.d/epel-testing.repo

------------------------------------------
Les RPMS de Remi (to update PHP)
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
vim -y /etc/yum.repos.d/remi.repo
---
enable=1
priority=3
----------------------------
//Create DAG repository definition (optional)
vim /etc/yum.repos.d/dag.repo
----
[dag]
name=Dag
baseurl=http://apt.sw.be/fedora/$releasever/en/$basearch/dag/
enabled=1
gpgcheck=1
priority=3
----
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt

Setting priorities:
----
cd /etc/yum.repos.d
dir //to find .repo files
vim rpmforge.repo //set priority to 3 or higher
vim /etc/yum.repos.d/CentOS-Base.repo
----
priority=N //where N=1 to 99
----
---- Recommended settings ----
[base], [addons], [updates], [extras] ... priority=1
[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N (where N is > 10 and based on your preference)
----

yum check-update

============================== How to upgrade PHP and mySQL to the latest versions ======================
cd /home
wget http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
wget http://rpms.famillecollet.com/enterprise/remi-release-5.rpm
rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
yum remove mysql.i386
yum --enablerepo=remi update mysql*
yum --enablerepo=remi update php*
yum --enablerepo=remi update
yum update

Note as of 10/07/09, the PHP version with this method is 5.3.0, which is not compatible with current release of IONCUBE

============================== How to update PHP to version 5.2.11 ======================
http://www.jasonlitka.com/yum-repository/

yum remove php php-devel php-common php-cli
rpm --import http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
vim /etc/yum.repos.d/utterramblings.repo
--- Add this ---
[utterramblings]
name=Jason's Utter Ramblings Repo
baseurl=http://www.jasonlitka.com/media/EL$releasever/$basearch/
enabled=1
gpgcheck=1
gpgkey=http://www.jasonlitka.com/media/RPM-GPG-KEY-jlitka
-------------------

yum install php php-devel php-gd php-ldap php-mbstring php-mcrypt php-mysql php-odbc php-pdo php-common php-cli phpmyadmin

============================== How to install FFMPEG ==============================
yum install ffmpeg ffmpeg-devel flvtool2 mplayer mencoder gd gd-devel php-gd php-devel ImageMagick phpmyadmin
//after having Dag/rpmforge installed

Install ffmpeg-php (check for latest)
# wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=iweb
Extract the archive:
# tar -xjf ffmpeg-php-0.6.0.tbz2
# cd ffmpeg-php-0.6.0/
# phpize
# ./configure && make
# sudo make install
# vim /etc/php.ini
---- add this line at the end of file----
[ffmpeg]
extension=ffmpeg.so
----
# service httpd restart

check ffmpeg-php status
# php -m | grep ffmpeg

Create a hard link to enable ffmpeg-php working
ln /usr/lib64/php/modules/ffmpeg.so /usr/lib/php/modules/ffmpeg.so
ln -s /usr/lib64/php/modules/ /usr/lib/php/modules/

============================== FFMPEG Install problems =====================================
yum install httpd gnome-user-share mod_perl mod_python mod_ssl php php-devel phpmyadmin system-config-httpd webalizer php-cli php-common php-eaccelerator php-gd php-ldap php-mbstring php-mcrypt php-mysql php-odbc php-pdo

yum remove ffmpeg ffmpeg-devel

yum remove x264 ffmpeg ffmpeg-devel mencoder mplayer x264-devel ffmpeg-libpostproc

ln /usr/lib64/php/modules/ffmpeg.so /usr/lib/php/modules/ffmpeg.so
============================== How to install eaccelerator ==============================

# yum install php-eaccelerator


How to create samba shares for Windows
Install Samba:
yum install samba

SELinux:
setsebool -P samba_enable_home_dirs 1

Run the utility for GUI:
#system-config-samba
set up server setting as "share" if you want universal access without authentication

Or go through commands:
#mv /etc/samba/smb.conf /etc/samba/smb.conf.backup
#vi /ect/samba/smb.conf
[global]
workgroup = workgroup
netbios name = smbserver
security = SHARE
load printers = No
default service = global
path = /home
available = No
encrypt passwords = yes
[share]
writeable = yes
admin users = smbuser
path = /home/share
force user = root
valid users = smbuser
public = yes
available = yes

save and exit

adduser smbuser #add unix account
passwd smbuser #set unix account password
smbpasswd -a smbuser #lets create same user account on samba
<put same password as your unix account password>
/etc/init.d/smb restart


How to install VNC on Centos 5.3
Install VNC server package upon server setup, then run in include GNOME desktop environment:
# yum -y groupinstall "GNOME Desktop Environment"
# yum remove esc
remove smart card module (not needed)
Add a user(s)
# vi /etc/sysconfig/vncservers
---
VNCSERVERS="0:root"
VNCSERVERARGS[0]="-geometry 1024x768 -depth 16"
---
In this case we need to use port 5900+0 so port 5900.

Setting a password
# vncpasswd
Password: void
Verify: void

# service vncserver start
# chkconfig vncserver on //set VNCserver to start at bootup

Open firewall ports to allow VNC services:
# vi /etc/sysconfig/iptables
# Open VNC for USER1
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5800 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5900 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6000 -j ACCEPT
# Open VNC for USER2
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5801 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 5901 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 6001 -j ACCEPT
# service iptables restart

How to reconnect to VNC
# ps -ef | grep vnc
---
Look for process ID next to the username, then
# kill [process ID]
---
# vncserver :1

Connect at port 5901

--------------------------------

I find a method could reuse the lowest number via "vncserver"
cd /tmp

ll -al you will find some files like these: .X0-lock .... .X7-lock

rm -r .X*

vncserver

reuse :1 not :8

-------------------

To disable gnome-panel and background
# killall gnome-panel
To enable gnome-panel
# service start gnome-panel


Setup FTP on CentOS 5.3
Install VSFTPD
yum -y install vsftpd

Configure:
vim /etc/vsftpd/vsftpd.conf
Follow instructions at this link
-------------------
anonymous_enable=NO // line 12: NO is no anonymous YES, you must set home folder for anonymous access
anonymous_enable=YES
anon_root=/home/share/PublicFTP

ascii_upload_enable=YES // line 79: make valid
ascii_download_enable=YES (permit ascii mode transfer)

ls_recurse_enable=YES // line 102: make valid

use_localtime=YES // use local time
-----------------------
/etc/rc.d/init.d/vsftpd start
chkconfig vsftpd on //set ftp to autostart

Create a user group:
# groupadd ftp-users
Add users, and make their default directory /home/www/[account]. Make sure that each directory exist prior to sending these commands:
mkdir /home/www
mkdir /home/www/sexcenter
mkdir /home/www/cafecenter
mkdir /home/www/ocgold

Create users / group on local system + permission:
useradd -g apache -d /home/www/sexcenter sexcenter
useradd -g apache -d /home/www/cafecenter cafecenter
useradd -g apache -d /home/www/ocgold ocgold
passwd sexcenter # P4ssword
passwd ocgold # P4ssword
passwd cafecenter # P4ssword

-------- Optional, In the event that users belong to other groups ----
usermod -g apache sexcenter
usermod -g apache cafecenter
usermod -g apache ocgold

Set ownership for each account:
chmod 750 /home/www
chown root:apache /home/www
chown -R sexcenter:apache /home/www/sexcenter
chown -R cafecenter:apache /home/www/cafecenter
chown -R ocgold:apache /home/www/ocgold

Root folders for each user upon FTP logon:
usermod -d /home/www/sexcenter sexcenter
usermod -d /home/www/cafecenter cafecenter
usermod -d /home/www/ocgold ocgold

Optional: Create a link from the anon_ftpuser's home folder to /var/www/public
ln -s /var/www/public /home/share/PublicFTP
----------------
Check Home Directory
Does the user’s home directory even exist? Check /etc/passwd for the current home directory for the user and see what’s set:
# grep someuser /etc/passwd
someuser:x:10001:2524::/var/www/someuser:/bin/bash
In this case, does /var/www/someuser exist? If it doesn’t, fix that and then move onto the next solution if you’re still having problems
File/Directory Permissions
Be sure that the user that you are logging in as actually has permissions to be in the directory. This affects users that have home directories of /var/www/html because the execute bit normally isn’t set for the world on /var/www or /var/www/html. Make sure that the appropriate permissions and ownerships are set, and this should help eliminate the issue.
SELINUX
If SELINUX is rearing its ugly head on the server, this can be a problem. Check your current SELINUX status and disable it if necessary:
# setenforce
Enforcing
# setenforce 0
Try to login over FTP again and you should have a success. If you want to turn off SELINUX entirely, adjust /etc/sysconfig/selinux (RHEL4) or /etc/selinux/config (RHEL5).
Here is another fix for the ftp issue with home directories, in case you cant turn selinux off:
setsebool -P ftp_home_dir 1
service vsftpd restart


How to use Google SMTP relay with sendmail
Check to see if TLS is enabled:
# sendmail -d0.1 -bv root

Make a certs directory:
# mkdir /ect/mail/certs
# cd /ect/mail/certs

Create SSL certificates:
# openssl req -new -x509 -keyout cakey.pem -out cacert.pem -days 3650
// password, all left default
# openssl req -nodes -new -x509 -keyout sendmail.pem -out sendmail.pem -days 3650

copy certificates from system to mail directory:
# cp /etc/pki/tls/certs/ca-bundle.crt /etc/mail/certs

Stop sendmail services prior to making changes:
# service sendmail stop

Create authentication table:
# vim /etc/mail/authinfo
----
AuthInfo:smtp.gmail.com "U:root" "I:admin@cafecenter.com" "P:void" "M:PLAIN"
AuthInfo:smtp.gmail.com:587 "U:root" "I:admin@cafecenter.com" "P:void" "M:PLAIN"
----
makemap hash /etc/mail/authinfo < /etc/mail/authinfo

Defined "SMART_HOST" information:
# vim /etc/mail/sendmail.mc
---
FEATURE(`authinfo',`hash /etc/mail/authinfo.db')dnl
define(`SMART_HOST', `smtp.gmail.com')dnl
define(`RELAY_MAILER_ARGS', `TCP $h 587')
define(`ESMTP_MAILER_ARGS', `TCP $h 587')
define(`CERT_DIR', `/etc/mail/certs')
define(`confCACERT_PATH', `CERT_DIR')
define(`confCACERT', `CERT_DIR/ca-bundle.crt')
define(`confCRL', `CERT_DIR/ca-bundle.crt')
define(`confSERVER_CERT', `CERT_DIR/sendmail.pem')
define(`confSERVER_KEY', `CERT_DIR/sendmail.pem')
define(`confCLIENT_CERT', `CERT_DIR/sendmail.pem')
define(`confCLIENT_KEY', `CERT_DIR/sendmail.pem')
---
# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Start the email service:
# service sendmail start

DONE!

php /home/www/sexcenter/testmail.php


Apache hosting multiple websites
Must have a FQDN for localhost:
vim /etc/hosts
---- add this line ----
192.168.1.5 server1.cafecenter.com server1
----------------------

Install GD most likely needed by some websites:
yum install gd gd-devel php-gd

Enable mod_rewrite:
# vim /etc/httpd/conf/httpd.conf

FIND SECTION BEGINNING
<Directory "/home/www/html">
Options Indexes FollowSymLinks
AND
DocumentRoot "/home/www/html/"
---
Set:
AllowOverride All //do this 2 times
----

Create home folders for each website:
mkdir -p /home/www
mkdir -p /home/www/sexcenter
mkdir -p /home/www/sexcenter/htdocs
mkdir -p /home/www/sexcenter/logs
mkdir -p /home/www/sexcenter/cgi-bin

mkdir -p /home/www/kimconnect
mkdir -p /home/www/kimconnect/htdocs
mkdir -p /home/www/kimconnect/logs
mkdir -p /home/www/kimconnect/cgi-bin

mkdir -p /home/www/cafecenter
mkdir -p /home/www/cafecenter/htdocs
mkdir -p /home/www/cafecenter/logs
mkdir -p /home/www/cafecenter/cgi-bin

mkdir -p /home/www/ocgold
mkdir -p /home/www/ocgold/htdocs
mkdir -p /home/www/ocgold/logs
mkdir -p /home/www/ocgold/cgi-bin

Change the policy to let SELinux have access to new DocumentRoot
chcon -R system_u:object_r:httpd_sys_content_t /home/www

# vim /etc/httpd/conf/httpd.conf
NameVirtualHost *:80

<VirtualHost *:80>
# Basic setup
ServerAdmin admin@sexcenter.com
ServerName www.sexcenter.com
ServerAlias sexcenter.com

DocumentRoot /home/www/sexcenter/

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>

# CGI Handling
ScriptAlias /cgi-bin/ /home/www/sexcenter/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /home/www/sexcenter/logs/error.log
CustomLog /home/www/sexcenter/logs/access.log combined
</VirtualHost>

<VirtualHost *:80>
# Basic setup
ServerAdmin admin@cafecenter.com
ServerName www.cafecenter.com
ServerAlias cafecenter.com

DocumentRoot /home/www/cafecenter/

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>

# CGI Handling
ScriptAlias /cgi-bin/ /home/www/cafecenter/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /home/www/cafecenter/logs/error.log
CustomLog /home/www/cafecenter/logs/access.log combined
</VirtualHost>

<VirtualHost *:80>
# Basic setup
ServerAdmin admin@ocgold.com
ServerName www.ocgold.com
ServerAlias ocgold.com

DocumentRoot /home/www/ocgold/

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>

# CGI Handling
ScriptAlias /cgi-bin/ /home/www/ocgold/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /home/www/ocgold/logs/error.log
CustomLog /home/www/ocgold/logs/access.log combined
</VirtualHost>

<VirtualHost *:80>
# Basic setup
ServerAdmin kim@kimconnect.com
ServerName www.kimconnect.com
ServerAlias kimconnect.com

DocumentRoot /home/www/kimconnect/

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>

# CGI Handling
ScriptAlias /cgi-bin/ /home/www/kimconnect/cgi-bin/
<Location /cgi-bin>
Options +ExecCGI
</Location>

# Logfiles
ErrorLog /home/www/kimconnect/logs/error.log
CustomLog /home/www/kimconnect/logs/access.log combined
</VirtualHost>


# phpMyAdmin setup
<VirtualHost *:50000>
# Basic setup
ServerAdmin xkdoan@gmail.com
ServerName localhost
ServerAlias 192.168.1.80

DocumentRoot /usr/share/phpmyadmin

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>
</VirtualHost>
--------------------------
# apachectl configtest //test to see if syntax is ok
# service httpd reload

Set selinux to allow httpd access:
setsebool -P httpd_disable_trans=1

----------------------------------------------


Adding Repositories in Centos 5.3
yum install yum-priorities
vim /etc/yum/pluginconf.d/priorities.conf
----
[main]
enabled=1
----

Install RPMForge:
cd /home
wget http://apt.sw.be/redhat/el5/en/x86_64/RPMS.dag/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
rpm --import http://dag.wieers.com/rpm/packages/RPM-GPG-KEY.dag.txt //install DAG's GPG key
rpm -K rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm //verify package
rpm -i rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm //install

yum check-update

Setting priorities:
----
cd /etc/yum.repos.d
dir //to find .repo files
vim rpmforge.repo //set priority to 3 or higher
vim /etc/yum.repos.d/CentOS-Base.repo
----
priority=N //where N=1 to 99
----
---- Recommended settings ----
[base], [addons], [updates], [extras] ... priority=1
[centosplus],[contrib] ... priority=2
Third Party Repos such as rpmforge ... priority=N (where N is > 10 and based on your preference)
----


Install phpMyAdmin in Centos 5.3
# Prerequisite: must install RPMForge Repo prior

yum install httpd php php-mysql php-gd php-mbstring php-mcrypt mysql mysql-server phpmyadmin
chkconfig httpd on
chkconfig mysqld on
service httpd start
service mysqld start
----
vim /usr/share/phpmyadmin/config.inc.php
----
$cfg['blowfish_secret'] = '[whatever]'; /* YOU MUST FILL IN THIS FOR COOKIE AUTH! */
----

---- configure port 50000 open on firewall ---
vim /etc/httpd/conf/httpd.conf
---- Add virtual website ----
Add:
Listen 50000

<VirtualHost *:50000>
# Basic setup
ServerAdmin xkdoan@gmail.com
ServerName localhost
ServerAlias 192.168.1.80

DocumentRoot /usr/share/phpmyadmin

# HTML documents, with indexing.
<Directory />
Options +Includes
</Directory>
</VirtualHost>

vim /etc/httpd/conf.d/phpmyadmin.conf
---- To allow overrides ----
AllowOverride All //inside the brackets
Alias /phpmyadmin /usr/share/phpmyadmin
Alias /phpMyAdmin /usr/share/phpmyadmin
Alias /mysqladmin /usr/share/phpmyadmin

Create user root:
mysqladmin -u root password void (mySQL 'root' is not the same as system root)


AT&T Tier 2 800.983-2811 no voice recognition
800-228-2020, and ask for UVerse Technical Support. Once you get someone and tell them your problem they should transfer you to Tier 2.


Nintendo Wii Hacking
http://docs.google.com/View?id=dfwvk5sg_0gksqfcdj&hl=en

1. install Hackmii
2. install cIOS38_rev14 (requires IOS36-64-v1042.wad or connection to the Internet)
3. install usb loader_gx
4. run WAD Manager to install USB Loader "USB Loader GX-ULNR-r649.wad" (Channel - can run without SD)
5. Install Pre-loader to boot Wii directly to USB: place preloader.dol (or different name) into root of SD

run firmware updater 4.1
downgrade your wii to 4.0 prior to install

In the preloader menu, choose install file and choose the dol to install. When its done, go to the main menu of preloader (B) and then choose 'settings'. You have to change 2 options here: Autoboot=file and Return to=preloader. Save the settings, then launch the Wii menu in the main menu. It will boot into the USB loader GX!

6. Install Mplayer CE
7. Install emulators http://wiibrew.org/wiki/Emulators
SNES
Visual Boy Advance GX
Sega
MAME
Nintendo64

Some items to research:
MPlayer CE: DVD player, radio, mp3 player
BootMii: Brick protection
Gecko OS: cheat manager
Homebrew Browser: get games, emulators, and more
StartPatch/Starfall: make changes to Wii regions
cIOSCorp: play backup discs
Wii DVD Dumper: make backups of games
Wii Earth: just like Google earth
VBA GX: play game boy advance
DOP IOS:


8. Set up forwarders: http://wadder.net/wiki/index.php/Forwarder_Repository

13 essential apps:
http://www.mikeandheth.com/games/106-13-best-wii-homebrew-applications.html


Useful Commands - Linux Server AdministrationSource: http://www.unixguide.net/linux/linuxshortcuts.shtml
List all running processes:
# ps axu |more
List ssh processes, hung sessions:
# ps aux | grep ssh
list active processes:
# top
Check to see who else is logged on:
# who
Find an application:
# which [appname]
Shutdown immediately:
# shutdown -h now
# shutdown -r now (reboot)
Find out who owns a file or folder:
# stat [path-to-file-or-folder]
Change access permissions:
chown [user]:[group] [path-to-file-or-folder]
chmod [666/755/775/777] [path-to-file-or-folder]
check disk space:
# df
# hostname: to display name of server
# domainname: to display the domain name where server resides
Clear sendmail dir:
# cd /var/spool/mqueue
# rm -rf *

How to compile software
Install From RPM:
rpm -ivh PACKAGENAME

Install from TAR.GZ
tar -xzvf PACKAGENAME
cd PACKAGENAME
./configure
make
make install

How to discover if a package is already installed
rpm -qa | grep glut

How to set static IP address using command line
Set Static IP Address
----
vim /etc/sysconfig/networking/profiles/default/ifcfg-eth0
vim /etc/sysconfig/network-scripts/ifcfg-eth0
----
DEVICE=eth0
BOOTPROTO=none
HWADDR=00:0C:29:d7:5b:d3
ONBOOT=yes
TYPE=Ethernet
USERCTL=no
IPV6INIT=no
PEERDNS=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.150
GATEWAY=192.168.1.1

Change Nameserver (DNS)
----
vim /etc/resolv.conf
----
The file format should be like this:
search your-dns-search-path
nameserver dns1-ip-address
nameserver dns2-ip-address
nameserver dns3-ip-address


VMware Virtual Disk Manager Does Not Expand Partitions

Products


VMware ACE

VMware GSX Server

VMware Server

VMware Workstation

Details

I am using the VMware Virtual Disk Manager utility to expand the size of a virtual disk. The virtual disk is partitioned and the partitions do not get expanded. How can I expand the partitions?

Solution

If you are using the VMware Virtual Disk Manager included in GSX Server, VMware Server, Workstation, or ACE to expand the size of a virtual disk, and the virtual disk is partitioned, you will need to use a third-party utility to resize the expanded partitions. This utility would be run from inside the guest operating system.

Examples of third-party utilities include:

Partition Magic http://www.symantec.com/norton/products/overview.jsp?pcid=sp&pvid=pm80
System Rescue CD http://www.sysresccd.org/Main_Page
GParted LiveCD http://gparted.sourceforge.net/livecd.php
Partition Logic http://partitionlogic.org.uk
EASEUS Partition Manager http://www.partition-tool.com
Paragon Partition Manager http://www.partition-manager.com
Ranish Partition Manager http://www.ranish.com/part
7tools Partition Manager http://www.7tools.com/pm/index.htm
DFSee http://www.dfsee.com/dfsee/index.php
Windows DiskPart utility.

Note: If you are using the Windows DiskPart utility, it can only extend (expand) data volumes; if you use the DiskPart utility to extend a system or boot volume, you may get an error. For more information about extending partitions with the DiskPart utility, see http://support.microsoft.com/kb/325590.

Note: VMware does not endorse or recommend any particular third party utility, nor is the list above meant to be exhaustive.

THE CONTENT OF THIS ARTICLE IS PROVIDED "AS-IS," AND TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, VMWARE DISCLAIMS ALL OTHER REPRESENTATIONS AND WARRANTIES, EXPRESS OR IMPLIED, REGARDING THIS CONTENT, INCLUDING THEIR FITNESS FOR A PARTICULAR PURPOSE, THEIR MERCHANTABILITY, OR THEIR NONINFRINGEMENT. VMWARE SHALL NOT BE LIABLE FOR ANY DAMAGES ARISING OUT OF OR IN CONNECTION WITH THE USE OF THIS CONTENT, INCLUDING DIRECT, INDIRECT, CONSEQUENTIAL DAMAGES, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF VMWARE HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

Product Versions


VMware ACE 1.0.x

VMware ACE 2.0.x

VMware GSX Server 2.5.x (Linux hosts)

VMware GSX Server 2.5.x (Windows hosts)

VMware GSX Server 3.x (Linux hosts)

VMware GSX Server 3.x (Windows hosts)

VMware Server 1.0.x (Linux Hosts)

VMware Server 1.0.x (Windows Hosts)

VMware Workstation 4.x (Linux hosts)

VMware Workstation 4.x (Windows hosts)

VMware Workstation 5.0.x (Linux hosts)

VMware Workstation 5.0.x (Windows hosts)

VMware Workstation 5.5.x (Linux hosts)

VMware Workstation 5.5.x (Windows hosts)

VMware Workstation 6.0.x (Linux Hosts)

VMware Workstation 6.0.x (Windows Hosts)

FFMPEG Versions March 2009 with Repositories (Repo) as Default
ATRpms:
FFmpeg version SVN-r16671, Copyright (c) 2000-2009 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --enable-gpl --enable-postproc --enable-swscale --enable-pthreads --enable-x11grab --disable-avisynth --disable-libamr-nb --disable-libamr-wb --enable-libdc1394 --enable-libfaac --enable-libfaad --enable-libfaadbin --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC --disable-stripping

DAG / RPMForge:
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
configuration: --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/share/man --incdir=/usr/include/ffmpeg --extra-cflags=-fPIC --enable-libmp3lame --enable-libogg --enable-libvorbis --enable-libogg --enable-libtheora --enable-libfaad --enable-libfaac --enable-libgsm --enable-xvid --enable-x264 --enable-liba52 --enable-liba52bin --enable-pp --enable-shared --enable-pthreads --enable-gpl --disable-strip
libavutil version: 49.4.0
libavcodec version: 51.40.4
libavformat version: 51.12.1
built on Jun 4 2007 10:46:34, gcc: 4.1.1 20070105 (Red Hat 4.1.1-52)
ffmpeg SVN-rUNKNOWN
libavutil 3212288
libavcodec 3352580
libavformat 3345409

EPEL/RPMFusion:
FFMPEG not configured as share=enabled

VmWare Workstation 6, Linux disk expansion
1. Run the disk expansion command:
"C:\Program Files\VMware\VMware Workstation\vmware-vdiskmanager" -x 60Gb "D:\My Virtual Machines\Centos 5.2 Test3\Red Hat Enterprise Linux 5 64-bit-cl1.vmdk"

2.


How to configure CentOS 5.2 to use RPMForge and YUMrpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum update

Yum install [package name]
Yup info [package name]
Yum remove [package name]

The following thing will list all the packages installed in the system and that can (they must) be updated:

Code:

yum list updates|less


To search in package names only, use yum list. This differs from search in that it's much faster, as it will search package names only, while yum search will search all the package info, including package description.

Code:


yum list something

Example

Code:


yum list mozilla


To get the name of the package containing a given file:

Code:


yum provides filename

example:

Code:


yum provides /usr/bin/mozilla


Here's some new goodies in yum 2.2 (Fedora Core 3 and beyond)

To get a list of packages updated/added to any of your repositories recently:

Code:


yum list recent


To enable a repository which is disabled in the configuration:

Code:


yum --enablerepo=reponame install packagename


example

Code:


yum --enablerepo=dag install j2re


To list available software groups, such as GNOME desktop environment or X window system. This is also available in the Core 2 yum, but servers doesn't use this wonderful feature much.

Code:


yum grouplist


To install such a group:

Code:


yum groupinstall "groupname"

Example:

Code:


yum groupinstall "GNOME Desktop Environment"

And to update a group

Code:


yum groupupdate "GNOME Desktop Environment"


And remember folks, you can always use -y to say yes to everything, and -C to use the cache only.

One tip, you can use also joker-signs as * or ? e.g.

Code:


yum install gkrellm*

FFMPEG installation for CentOS 5
Google these:
"How to install ffmpeg" "how to install ffmpeg-php"

First Install FFMPEG:
--------------------------------------------------------------
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
yum update
yum install ffmpeg ffmpeg-devel

And in you can use "yum search "softwarename" to find software you are looking for. When you find the software just "yum install softwareyoufound"
----------------------------------------------------------------

Then, install FFMPEG-PHP
----------------------------------------------------------------
Requirements
ffmpeg-0.4.9_pre1 or higher.
php-4.3.0 or higher
gd-2.0 or higher (yum install gd gd-devel)
Installation
These instructions are for Linux. I don't know the first thing about Windows or Mac.
Building the ffmpeg-php Extension
Build and install PHP if it is not already installed
Unpack the ffmpeg-php sources
tar -xjf ffmpeg-php-X.x.x.tbz2
Change to the ffmpeg-php extension directory and run phpize (included with your PHP installation) to build configuration files. NOTE: if your php installation does not include phpize, you may have to install a php-dev package for your distro (usually named: php-dev, php-devel or similar)
cd ffmpeg-php-X.x.x/
phpize
Configure and build the extension.
./configure && make
Install the shared extension.
sudo make install
If everything went as planned, ffmpeg-php is now installed as a shared extension.
Configuration
If you've built ffmpeg-php as a shared extension but want to make it available to all scripts by default, add extension=ffmpeg.so to your php.ini file to load ffmpeg-php at PHP startup. Make sure to restart apache when you are done to reload php.ini.
Testing the Installation
Put the directory test_media and test_ffmpeg.php script under your web root somewhere (put both in the same directory).
Load test_ffmpeg.php into your browser.
RESULTS: You should get a listing of the methods provided by the ffmpeg-php module as well as some test output from the methods.
Usage
If you've the installed ffmpeg-php extension as a shared library but haven't set it to auto-load in your php.ini file, you'll need to use the PHP dl() function to make ffmpeg-php available to your scripts. Add the following PHP code to the beginning of scripts you want to call ffmpeg-php methods in.
<?php
$extension = "ffmpeg";
$extension_soname = $extension . "." . PHP_SHLIB_SUFFIX;
$extension_fullname = PHP_EXTENSION_DIR . "/" . $extension_soname;

// load extension
if(!extension_loaded($extension)) {
dl($extension_soname) or die("Can't load extension $extension_fullname\n");
}
?>
--------------------------------------------------------------------------

Scripted installation of FFMPEG and FFMPEG-PHP
Also check this scripted install instructions:
This one is clearer: Here

How to install ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encoder, and Libog from source

This article shows how to install ffmpeg, ffmpeg-PHP, Mplayer, Mencoder, flv2tool, LAME MP3 Encoder, and Libog from source. It should work on most systems, however may need some tweaking from system to sytem.

Update server and include sourceforge:
rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm.
http://www.tuxmachines.org/node/17063
yum update

Gogo /usr/local/src:
cd /usr/local/src

Download source tarballs:

wget http://rubyforge.org/frs/download.php/9225/flvtool2_1.0.5_rc6.tgz
wget http://easynews.dl.sourceforge.net/sourceforge/lame/lame-3.97.tar.gz
wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.0.tbz2
wget http://downloads.xiph.org/releases/ogg/libogg-1.1.3.tar.gz
wget http://downloads.xiph.org/releases/vorbis/libvorbis-1.1.2.tar.gz
wget http://www4.mplayerhq.hu/MPlayer/releases/codecs/essential-20061022.tar.bz2
----- Test 2 -----------
New: wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.3.1.tbz2
-------------------------

Extract the tarballs:

tar zxvf lame-3.97.tar.gz
tar zxvf libogg-1.1.3.tar.gz
tar zxvf libvorbis-1.1.2.tar.gz
tar zxvf flvtool2_1.0.5_rc6.tgz
tar jxvf essential-20061022.tar.bz2
tar jxvf ffmpeg-php-0.5.0.tbz2
tar zxvf flvtool2_1.0.5_rc6.tgz

----- test 2 ------
tar jxvf ffmpeg-php-0.5.3.1.tbz2
--------------------


Make a directory to store all the codecs:

mkdir /usr/local/lib/codecs/


Install all necessary packages:

Install "phpize":
yum -y install php-devel

Install gcc, gcc-cpp, and gcc-c++:
yum install gcc gcc-cpp gcc-c++
yum install gcc gmake make libcpp libgcc libstdc++ gcc4 gcc4-c++ gcc4-gfortran
yum install subversion ruby ncurses-devel
yum list gstreamer* <=== not available
yum install gstreamer-ffmpeg <=== not available
yum install gstreamer-plugins-bad
yum install gstreamer-plugins-bad-extras <=== not available
yum install gstreamer-plugins-base
yum install gstreamer-plugins-good
yum install gstreamer-plugins-pulse <=== not availab
yum install gstreamer-plugins-ugly
yum install gstreamer-python
yum install gstreamer-tools
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg
svn checkout svn://svn.mplayerhq.hu/mplayer/trunk mplayer
cd /usr/local/src/mplayer
svn update
cd /usr/local/src


Copy codecs for mplayer:

mv /usr/local/src/essential-20061022/* /usr/local/lib/codecs/
chmod -R 755 /usr/local/lib/codecs/


If you are using secure tmp:

mkdir /usr/local/src/tmp
chmod 777 /usr/local/src/tmp
export TMPDIR=/usr/local/src/tmp


Installing Lame:

cd /usr/local/src/lame-3.97
./configure
make && make install


Installing Libogg:

cd /usr/local/src/libogg-1.1.3
./configure && make && make install

Installing libvorbis:

cd /usr/local/src/libvorbis-1.1.2
./configure && make && make install


Installing flvtool2:
# alternative: yum install flvtool2
cd /usr/local/src/flvtool2_1.0.5_rc6/
ruby setup.rb config
ruby setup.rb setup
ruby setup.rb install

Install MPlayer:
# alternative: yum install mplayer
cd /usr/local/src/mplayer
./configure && make && make install


Installing ffmpeg:

# removed --enable-libogg option

cd /usr/local/src/ffmpeg/
./configure --enable-libmp3lame --enable-libvorbis --disable-mmx --enable-shared
make && make install

ln -s /usr/local/lib/libavformat.so.50 /usr/lib/libavformat.so.50
ln -s /usr/local/lib/libavcodec.so.51 /usr/lib/libavcodec.so.51
ln -s /usr/local/lib/libavutil.so.49 /usr/lib/libavutil.so.49
ln -s /usr/local/lib/libmp3lame.so.0 /usr/lib/libmp3lame.so.0
ln -s /usr/local/lib/libavformat.so.51 /usr/lib/libavformat.so.51

--- Test -------------
cp -p /usr/local/src/ffmpeg/libavformat/avio.h /usr/local/include/ffmpeg
cp -p /usr/local/src/ffmpeg/libavformat/avformat.h /usr/local/include/ffmpeg
cp -p /usr/local/src/ffmpeg/libavcodec/avcodec.h /usr/local/include/ffmpeg
----------------------

Installing ffmpeg-php:

--------- test 1 not works --------------
vim /usr/local/src/ffmpeg-php-0.5.0/ffmpeg-php.c
comment out "//" this line:
av_free_static();
---------test 2 WORKS!! ---------------
cd /usr/local/src/ffmpeg-php-0.5.3.1/
phpize
./configure
make && make install
---------------------------

cd /usr/local/src/ffmpeg-php-0.5.0/
phpize
./configure
make && make install


Note: Make sure this is the correct php.ini for this server.
# Read this article for the proper way of setting these

echo 'extension=ffmpeg.so' >> /etc/php.ini


Restart apache:

service httpd restart


Test:
php -r 'phpinfo();' | grep ffmpeg

Note: up2date can be used if you don't have yum installed.


Install MySQL on CentOS 5.2
To install MySQL, we do this:
yum install mysql mysql-devel mysql-server
Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
Now check that networking is enabled. Run
netstat -tap | grep mysql
It should show a line like this:
[root@server1 ~]# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 2584/mysqld
[root@server1 ~]#
If it does not, edit /etc/my.cnf and comment out the option skip-networking:
vi /etc/my.cnf
[...]
#skip-networking
[...]
and restart your MySQL server:
/etc/init.d/mysqld restart
Run
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword
to set a password for the user root (otherwise anybody can access your MySQL database!).

Install Apache2 with PHP and Ruby
yum install php php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel
Then edit /etc/httpd/conf/httpd.conf:
vi /etc/httpd/conf/httpd.conf
and change DirectoryIndex to
[...]
DirectoryIndex index.html index.htm index.shtml index.cgi index.php index.php3 index.pl
[...]
-----
Now configure your system to start Apache at boot time:
chkconfig --levels 235 httpd on
Start Apache:
/etc/init.d/httpd start
-----
12.2 Installing mod_ruby (OPTIONAL)
For CentOS 5.2, there's no mod_ruby package available, so we must compile it ourselves. First we install some prerequisites:
yum install httpd-devel ruby ruby-devel
Next we download and install mod_ruby as follows:
cd /tmp
wget http://www.modruby.net/archive/mod_ruby-1.2.6.tar.gz
tar zxvf mod_ruby-1.2.6.tar.gz
cd mod_ruby-1.2.6/
./configure.rb --with-apr-includes=/usr/include/apr-1
make && make install
Finally we must add the mod_ruby module to the Apache configuration, so we create the file /etc/httpd/conf.d/ruby.conf...
vim /etc/httpd/conf.d/ruby.conf
LoadModule ruby_module modules/mod_ruby.so
... and restart Apache:
/etc/init.d/httpd restart

Install ISPConfig on CentOS 5.2
cd /var/www/html
wget http://voxel.dl.sourceforge.net/sourceforge/ispconfig/ISPConfig-2.2.24.tar.gz
tar xvfz ISPConfig-2.2.24.tar.gz
cd install_ispconfig
./setup


MySQL Administration: add databases and users
make sure it's running
ps -ef | grep mysql
Creating MySQL DB
HOWTO on creating MySQL DBs
mysql -u root -p
# Enter your root password
Now, inside MySQL shell
mysql>create database sexcenter;

Query OK, 1 row affected (0.00 sec)
mysql>show databases;

+----------+
| Database |
+----------+
| database |
| mysql |
| sexcenter|
| test |
+----------+
4 rows in set (0.01 sec)

mysql>
Create a username/password that has at least the following privileges for the database: SELECT, INSERT, UPDATE, DELETE"
mysql> use mysql
mysql> GRANT ALL ON database_name TO manager@localhost IDENTIFIED BY "Contract$$$";
Query OK, 0 rows affected (0.00 sec)

mysql> quit

To work with a single database:
mysql> use DATABASENAME;
mysql> show tables;
mysql> select * from TABLENAME;

-------------------------------------

Import a dump file into database after uploaded it onto the server

mysql -p -h localhost sexcenter < /var/www/html/install/rayzz_new.sql

-------------------------------------
Useful Commands:
$ mysqldump db_name my_table
$ mysqldump db_name my_table > output.sql
$ mysqldump --no-data db_name my_table > dump_table_name.sql
$ mysqldump --add-drop-table db_name my_table > dump_table_name.sql
$ mysqladmin create db_name
$ mysqladmin drop db_name
$ mysqladmin flush-privileges
$ mysqladmin ping
$ mysqladmin reload
$ mysqladmin kill ps_id,ps_id...
$ mysqladmin --user=root shutdown
$ mysqladmin variables
$ mysqlimport db_name file_name ...
$ safe_mysqld
$ myisamchk table_name.MYI


CentOS 5.2 Server Setup
Source: http://www.howtoforge.com/perfect-server-centos-5.2

CentOS 5.1 Server Setup: LAMP, Email, DNS, FTP, ISPConfig (a.k.a. The Perfect Server)
Version 1.0
Author: Falko Timme <ft [at] falkotimme [dot] com>
Last edited 12/04/2007
This tutorial shows how to set up a CentOS 5.1 based server that offers all services needed by ISPs and web hosters: Apache web server (SSL-capable), Postfix mail server with SMTP-AUTH and TLS, BIND DNS server, Proftpd FTP server, MySQL server, Dovecot POP3/IMAP, Quota, Firewall, etc. This tutorial is written for the 32-bit version of CentOS 5.1, but should apply to the 64-bit version with very little modifications as well.
I will use the following software:
Web Server: Apache 2.2 with PHP 5.1.6
Database Server: MySQL 5.0
Mail Server: Postfix
DNS Server: BIND9 (chrooted)
FTP Server: Proftpd
POP3/IMAP server: Dovecot
Webalizer for web site statistics
In the end you should have a system that works reliably, and if you like you can install the free webhosting control panel ISPConfig (i.e., ISPConfig runs on it out of the box).
I want to say first that this is not the only way of setting up such a system. There are many ways of achieving this goal but this is the way I take. I do not issue any guarantee that this will work for you!

1 Requirements
To install such a system you will need the following:
Download the CentOS 5.1 DVD or the six CentOS 5.1 CDs from a mirror next to you (the list of mirrors can be found here: http://isoredirect.centos.org/centos/5/isos/i386/).
a fast internet connection.

2 Preliminary Note
In this tutorial I use the hostname server1.example.com with the IP address 192.168.0.100 and the gateway 192.168.0.1. These settings might differ for you, so you have to replace them where appropriate.

3 Install The Base System
Boot from your first CentOS 5.1 CD (CD 1) or the CentOS 5.1 DVD. Press <ENTER> at the boot prompt:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

It can take a long time to test the installation media so we skip this test here:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

The welcome screen of the CentOS installer appears. Click on Next:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

Choose your language next:

(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Select your keyboard layout:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
I'm installing CentOS 5.1 on a fresh system, so I answer Yes to the question Would you like to initialize this drive, erasing ALL DATA?


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

Now we must select a partitioning scheme for our installation. For simplicity's sake I select Remove linux partitions on selected drives and create default layout. This will result in a small /boot and a large / partition as well as a swap partition. Of course, you're free to partition your hard drive however you like it. Then I hit Next:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

Answer the following question (Are you sure you want to do this?) with Yes:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

On to the network settings. The default setting here is to configure the network interfaces with DHCP, but we are installing a server, so static IP addresses are not a bad idea... Click on the Edit button at the top right.


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

In the window that pops up uncheck Use dynamic IP configuration (DHCP) and Enable IPv6 support and give your network card a static IP address (in this tutorial I'm using the IP address 192.168.0.100 for demonstration purposes) and a suitable netmask (e.g. 255.255.255.0; if you are not sure about the right values, http://www.subnetmask.info might help you):


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Set the hostname manually, e.g. server1.example.com, and enter a gateway (e.g. 192.168.0.1) and up to two DNS servers (e.g. 145.253.2.75 and 193.174.32.18):


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Choose your time zone:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

Give root a password:


---------------------------------------------------------------------------------------------------------------------------------------------------

Now we select the software we want to install. Select nothing but Server (uncheck everything else). Also don't check Packages from CentOS Extras. Then check Customize now, and click on Next:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Now we must select the package groups we want to install. Select Editors, Text-based Internet, Development Libraries, Development Tools, DNS Name Server, FTP Server, Mail Server, MySQL Database, Server Configuration Tools, Web Server, Administration Tools, Base, and System Tools (unselect all other package groups) and click on Next:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
The installer checks the dependencies of the selected packages:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Click on Next to start the installation:

The hard drive is being formatted:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

The installation begins. This will take a few minutes:

(JavaScript must be enabled in your browser to view the large image as an image overlay.)
Finally, the installation is complete, and you can remove your CD or DVD from the computer and reboot it:


(JavaScript must be enabled in your browser to view the large image as an image overlay.)

After the reboot, you will see this screen. Select Firewall configuration and hit Run Tool:

I want to install ISPConfig at the end of this tutorial which comes with its own firewall. That's why I disable the default CentOS firewall now. Of course, you are free to leave it on and configure it to your needs (but then you shouldn't use any other firewall later on as it will most probably interfere with the CentOS firewall).
SELinux is a security extension of CentOS that should provide extended security. In my opinion you don't need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn't working as expected, and then you find out that everything was ok, only SELinux was causing the problem). Therefore I disable it, too (this is a must if you want to install ISPConfig later on). Hit OK afterwards:

Then leave the Setup Agent by selecting Exit:

Then log in as root and reboot the system so that your changes can be applied:
shutdown -r now
Now, on to the configuration...
--------------------------------------------------------------------------------------------------------------------------------------------

4 Adjust /etc/hosts
Next we edit /etc/hosts. Make it look like this:
vi /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 localhost.localdomain localhost
192.168.0.100 server1.example.com server1
::1 localhost6.localdomain6 localhost6

5 Configure Additional IP Addresses
(This section is totally optional. It just shows how to add additional IP addresses to your network interface eth0 if you need more than one IP address. If you're fine with one IP address, you can skip this section.)
Let's assume our network interface is eth0. Then there is a file /etc/sysconfig/network-scripts/ifcfg-eth0 which contains the settings for eth0. We can use this as a sample for our new virtual network interface eth0:0:
cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0
Now we want to use the IP address 192.168.0.101 on the virtual interface eth0:0. Therefore we open the file /etc/sysconfig/network-scripts/ifcfg-eth0:0 and modify it as follows (we can leave out the HWADDR line as it is the same physical network card):
vi /etc/sysconfig/network-scripts/ifcfg-eth0:0
# Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE]
DEVICE=eth0:0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.101
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
Afterwards we have to restart the network:
/etc/init.d/network restart
You might also want to adjust /etc/hosts after you have added new IP addresses, although this is not necessary.
Now run
ifconfig
You should now see your new IP address in the output:
[root@server1 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:55:33:B3
inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe55:33b3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:355 errors:0 dropped:0 overruns:0 frame:0
TX packets:300 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:31326 (30.5 KiB) TX bytes:47669 (46.5 KiB)
Interrupt:177 Base address:0x1400

eth0:0 Link encap:Ethernet HWaddr 00:0C:29:55:33:B3
inet addr:192.168.0.101 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:177 Base address:0x1400

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:560 (560.0 b) TX bytes:560 (560.0 b)

[root@server1 ~]#
6 Disable The Firewall And SELinux
(You can skip this chapter if you have already disabled the firewall and SELinux at the end of the basic system installation (in the Setup Agent).)
I want to install ISPConfig at the end of this tutorial which comes with its own firewall. That's why I disable the default CentOS firewall now. Of course, you are free to leave it on and configure it to your needs (but then you shouldn't use any other firewall later on as it will most probably interfere with the CentOS firewall).
SELinux is a security extension of CentOS that should provide extended security. In my opinion you don't need it to configure a secure system, and it usually causes more problems than advantages (think of it after you have done a week of trouble-shooting because some service wasn't working as expected, and then you find out that everything was ok, only SELinux was causing the problem). Therefore I disable it, too (this is a must if you want to install ISPConfig later on).
Run
system-config-securitylevel
Set both Security Level and SELinux to Disabled and hit OK:

Afterwards we must reboot the system:
shutdown -r now

7 Install Some Software
First we import the GPG keys for software packages:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY*
Then we update our existing packages on the system:
yum update
Now we install some software packages that are needed later on:
yum install fetchmail wget bzip2 unzip zip nmap openssl lynx fileutils ncftp gcc gcc-c++

-------------------------------------------------------------------------------------------------------
8 Quota
(If you have chosen a different partitioning scheme than I did, you must adjust this chapter so that quota applies to the partitions where you need it.)
To install quota, we run this command:
yum install quota
Edit /etc/fstab and add ,usrquota,grpquota to the / partition (/dev/VolGroup00/LogVol00):
vi /etc/fstab
/dev/VolGroup00/LogVol00 / ext3 defaults,usrquota,grpquota 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0
Then run
touch /aquota.user /aquota.group
chmod 600 /aquota.*
mount -o remount /
quotacheck -avugm
quotaon -avug
to enable quota.

9 Install A Chrooted DNS Server (BIND9)
To install a chrooted BIND9, we do this:
yum install bind-chroot
Then do this:
chmod 755 /var/named/
chmod 775 /var/named/chroot/
chmod 775 /var/named/chroot/var/
chmod 775 /var/named/chroot/var/named/
chmod 775 /var/named/chroot/var/run/
chmod 777 /var/named/chroot/var/run/named/
cd /var/named/chroot/var/named/
ln -s ../../ chroot
cp /usr/share/doc/bind-9.3.3/sample/var/named/named.local /var/named/chroot/var/named/named.local
cp /usr/share/doc/bind-9.3.3/sample/var/named/named.root /var/named/chroot/var/named/named.root
touch /var/named/chroot/etc/named.conf
chkconfig --levels 235 named on
/etc/init.d/named start
BIND will run in a chroot jail under /var/named/chroot/var/named/. I will use ISPConfig to configure BIND (zones, etc.).

10 MySQL (5.0)
To install MySQL, we do this:
yum install mysql mysql-devel mysql-server
Then we create the system startup links for MySQL (so that MySQL starts automatically whenever the system boots) and start the MySQL server:
chkconfig --levels 235 mysqld on
/etc/init.d/mysqld start
Now check that networking is enabled. Run
netstat -tap | grep mysql
It should show a line like this:
[root@server1 named]# netstat -tap | grep mysql
tcp 0 0 *:mysql *:* LISTEN 2470/mysqld
[root@server1 named]#
If it does not, edit /etc/my.cnf and comment out the option skip-networking:
vi /etc/my.cnf
#skip-networking
and restart your MySQL server:
/etc/init.d/mysqld restart
Run
mysqladmin -u root password yourrootsqlpassword
mysqladmin -h server1.example.com -u root password yourrootsqlpassword
to set a password for the user root (otherwise anybody can access your MySQL database!).
-----------------------------------------------------------------------------------------------------------------------------
11 Postfix With SMTP-AUTH And TLS
Now we install Postfix and Dovecot (Dovecot will be our POP3/IMAP server):
yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot
Next we configure SMTP-AUTH and TLS:
postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
postconf -e 'inet_interfaces = all'
postconf -e 'mynetworks = 127.0.0.0/8'
We must edit /usr/lib/sasl2/smtpd.conf so that Postfix allows PLAIN and LOGIN logins. On a 64Bit Centos 5.1 you must edit the file /usr/lib64/sasl2/smtpd.conf instead. It should look like this:
vi /usr/lib/sasl2/smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login
Afterwards we create the certificates for TLS:
mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
Next we configure Postfix for TLS:
postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
Then we set the hostname in our Postfix installation (make sure you replace server1.example.com with your own hostname):
postconf -e 'myhostname = server1.example.com'
After these configuration steps you should now have a /etc/postfix/main.cf that looks like this (I have removed all comments from it):
cat /etc/postfix/main.cf
queue_directory = /var/spool/postfix
command_directory = /usr/sbin
daemon_directory = /usr/libexec/postfix
mail_owner = postfix
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
debug_peer_level = 2
debugger_command =
PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin
xxgdb $daemon_directory/$process_name $process_id & sleep 5

sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
html_directory = no
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.3.3/samples
readme_directory = /usr/share/doc/postfix-2.3.3/README_FILES
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
mynetworks = 127.0.0.0/8
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
myhostname = server1.example.com
By default, CentOS' Dovecot daemon provides only IMAP and IMAPs services. Because we also want POP3 and POP3s we must configure Dovecot to do so. We edit /etc/dovecot.conf and enable the line protocols = imap imaps pop3 pop3s:
vi /etc/dovecot.conf
[...]
# Base directory where to store runtime data.
#base_dir =

Installing XAMPP
cd /opt/lampp/
wget http://www.apachefriends.org/download.php?xampp-linux-1.6.7.tar.gz
su
tar xvfz xampp-linux-1.6.7.tar.gz -C /opt
/opt/lampp/lampp php5
/opt/lampp/lampp security
/opt/lampp/lampp start

Activate e-accelerator:
vi /opt/lampp/etc/php.ini
---------------------------------------
;extension="eaccelerator.so"
;eaccelerator.shm_size="16"
;eaccelerator.cache_dir="/opt/lampp/tmp/eaccelerator"
;eaccelerator.enable="1"
;eaccelerator.optimizer="1"
;eaccelerator.check_mtime="1"
;eaccelerator.debug="0"
;eaccelerator.filter=""
;eaccelerator.shm_max="0"
;eaccelerator.shm_ttl="0"
;eaccelerator.shm_prune_period="0"
;eaccelerator.shm_only="0"
;eaccelerator.compress="1"
;eaccelerator.compress_level="9"
------------------------------------------
Remove the semicolon at the beginning of each line and restart XAMPP. eAccelerator is now active. For more information about eAccelerator, check the eAccelerator home page:

SECURITY:

When FTP is not in use, disable it to close this insecure protocol:
/opt/lampp/lampp stopftp
XAMPP does not provide a direct script to modify Apache's httpd.conf to make the change so you'll have to dig into the file directly yourself. The change is made in the ServerToken section of httpd.conf. XAMPP by default has it set at "Full" which send all the version information about Apache and the various compiled modules. Change the entry to "Prod" which offer the least level of detail and will only reveal that Apache (not the version is running).
So instead of having your server report-"Apache/2.0.53 (Unix) mod_ssl/2.0.53 OpenSSL/0.9.7d PHP/5.0.4 DAV/2 mod_perl/1.999.21 Perl/v5.8.6 Server at hostname/ Port "--which is a veritable buffet for a hacker you simply get "Apache Server at hostname/ Port" which makes target enumeration significantly more difficult.


IMPORTANT FILES AND DIRECTORIES



File/Directory
Purpose

/opt/lampp/bin/
The XAMPP commands home. /opt/lampp/bin/mysql calls for example the MySQL monitor.

/opt/lampp/htdocs/
The Apache DocumentRoot directory.

/opt/lampp/etc/httpd.conf
The Apache configuration file.

/opt/lampp/etc/my.cnf
The MySQL configuration file.

/opt/lampp/etc/php.ini
The PHP configuration file.

/opt/lampp/etc/proftpd.conf
The ProFTPD configuration file. (since 0.9.5)

/opt/lampp/phpmyadmin/config.inc.php
The phpMyAdmin configuration file.

Step 1: Creating the backup
Create the backup by calling:
/opt/lampp/lampp backup
or
/opt/lampp/lampp backup secret
Where secret is your MySQL root password.


Step 2: Take care of your backuped data
The file /opt/lampp/backup/xampp-backup-22-01-04.sh (in the example above) contains your backuped data. Get this file to a save place.
Step 3: Restore your backuped data
On the new machine you need the same version of XAMPP as on your original/source machine.
Call (as root):
sh xampp-backup-22-01-04.sh

That's all. As you can read you may need to restart XAMPP.

--------------------------------------------------------------------------------------------------------------
To uninstall XAMPP just type in this command:
rm -rf /opt/lampp


Installing Red5 on CentOS 5
http://www.nabble.com/Re:-installation-of-Red5-on-Centos-4.5-p14578237.html

I mostly work with Debian Etch 4 but the process would pretty much be the same. There are a few things that you are going to need before you can install and run red5.

Java jdk. I would go with the latest available version. 1.6.* see the centos howto http://wiki.centos.org/HowTos/JavaOnCentOS
apache ant. It may be in the package repositories. if not download it.
subversion - yum install subversion
That should be all of the basic requirements. However, I would also install screen via yum install screen(not sure if that is the package name).

This is how I installed red5 on my old FC4 server and my new Debian Etch server.

hostname:~# svn co http://svn1.cvsdude.com/osflash/red5/java/server/trunk/ red5-trunk

that should checkout the red5 trunk into the red5-trunk directory. Now you should have both java and ant installed at this point. To make sure do the following:

hostname:~# java -v should display java version
hostname:~# ant -version should be 1.7.0

now you are ready to build the server.

hostname:~# cd red5-trunk
hostname:~/red5trunk# ant ivyclear dist

that will clear the ivy configs and build the server. Once that is finished I would first try and run the server from the red5-trunk/dist directory to make sure it is working.
hostname:~/red5trunk# cd dist
hostname:~/red5trunk/dist# chmod 755 red5.sh
hostname:~/red5trunk/dist# sh red5.sh

At this point the server should start. You can hit Ctr+ C to stop it. If you get this far without errors you should be good to go. However, I like to keep red5 in /usr/local/red5 so I would do the following.

hostname:~/red5trunk# mkdir /usr/local/red5
hostname:~/red5trunk# cp -R dist/* /usr/local/red5

Now you can navigate to /usr/local/red5 and start the server in the same was as above. If at this point there are no errors you should now have the latest version of red5 installed and working fine. I mentioned above that I like to use screen. The main reason is that when you close out your ssh session red5 will shut down unless it is running as a daemon process. So I use screen like this

hostname:/usr/local/red5# screen This will load the screen welcome message press return
hostname:/usr/local/red5# sh red5.sh

Now hit Ctrl A then hit d. This will detach the session that is running red5. If you need to restart or shut the server down you can
hostname:/usr/local/red5# screen -R

and that will reattach the session.


How to Install FFMPEG and other crap:
Easy Way: http://ffmpeginstall.sourceforge.net/release/
Easier Way: http://dag.wieers.com/rpm/FAQ.php#B
More easy: http://www.netbrix.net/archives/20 (most applicable information here)

This applies to CentOS 5 X86_64
1. rpm -Uhv http://apt.sw.be/packages/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
2. Install app-get
a. wget http://dag.wieers.com/rpm/packages/apt/apt-0.5.15lorg3.2-1.el5.rf.x86_64.rpm
b. rpm -Uhv apt-0.5.15lorg3.2-1.el5.rf.x86_64.rpm
3. Upgrade/update
a. apt-get update
b. apt-get upgrade
c. yum update
4. Search for software
a. apt-cache search <keyword>
b. apt-cache show <name of package>
c. yum install <name of package> (only yum can resolve dependencies)
5. Apt-get maintenance
a. apt-get clean

Rayzz Related:
a. yum install freetype
b. yum install mplayer
c. yum install mencoder
d. yum install Flvtool2
e. yum install gd
f. yum install lame-devel.x86_64
g. yum install vorbis

g. Install FFMPEG with --enabled-share option
- yum install ffmpeg-devel (install the developer files for FFMPEG)
- yum install subversion
- Installing ffmpeg (http://www.webhostingtalk.com/archive/index.php/t-565563.html)
32) rpm -q subversion If not install, then install subversion
33)svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg && cd ffmpeg
34) ./configure --enable-shared --enable-xvid --enable-vorbis --enable-libogg --enable-mp3lame --enable-gpl --enable-faad --enable-faac --enable-a52
35)make
36)make install
- wget http://www4.mplayerhq.hu/MPlayer/releases/MPlayer-1.0rc2.tar.bz2
- tar jxvf MPlayer-1.0rc2.tar.bz2.1
- cd MPlayer-1.0rc2
- ./configure --enable-mp3lame --enable-libogg --enable-vorbis --enable-shared

g. Install the XAMPP developer package
- wget http://www.apachefriends.org/download.php?xampp-linux-devel-1.6.4.tar.gz
- tar xvfz xampp-linux-devel-1.6.4.tar.gz -C /opt

h. Install Xdebug
- wget http://www.xdebug.com/link.php?url=xdebug201
- tar xvfz xdebug-2.0.1.tgz
i. Yum install up2date
j. AUTOCONF
wget http://ftp.gnu.org/gnu/autoconf/autoconf-2.60.tar.gz
tar -zxf autoconf-2.60.tar.gz
cd autoconf-2.60
./configure "-prefix=$HOME”
make
make install
k. yum install gcc gcc-c++
l. Get ffmpeg-php
- wget http://superb-west.dl.sourceforge.net/sourceforge/ffmpeg-php/ffmpeg-php-0.5.1.tbz2
- tar jxvf ffmpeg-php-0.5.1.tbz2
- cd ffmpeg-php-0.5.1
- phpize
- ./configure --with-php-config=/opt/lampp/bin/php-config
- make
- make install
- echo 'extension=/opt/lampp/lib/php/extensions/no-debug-non-zts-20060613/ffmpeg.so' >> /opt/lampp/etc/php.ini (this will append to your php.ini file!!!)


---------------- Required by Rayzz -----------------------------------------------
FFmpeg (http://ffmpeg.mplayerhq.hu)
FFmpeg-PHP (http://ffmpeg-php.sourceforge.net)
Mplayer + Mencoder (http://www.mplayerhq.hu/design7/dload.html)
flv2tool (http://inlet-media.de/flvtool2)
Libogg + Libvorbis (http://www.xiph.org/downloads)
LAME MP3 Encoder (http://lame.sourc eforge.net)
---------------------------------------------------------------------------------------------


Code:
rpm -Uhv http://apt.sw.be/packages/rpmforge-r...l4.rf.i386.rpm


Code:
yum update


Code:
yum install ffmpeg ffmpeg-devel

And in you can use "yum search "softwarename" to find software you are looking for. When you find the software just "yum install softwareyoufound"

Now, youre on your own on the php module, you can find the walkthrough on it by googling ffmpeg-php


Installing VMWare tools
Read this article: http://www.thoughtpolice.co.uk/vmware/howto/centos-5-vmware-tools-install.html
Install software needed by VMware Tools
Note: you need to boot the 1-1 kernel from grub for this to work.
Install packages to build the kernel modules

yum install gcc kernel-devel
Check the running kernel matches the kernel headers

uname -r # running kernel
rpm -q kernel-devel # installed kernel headers
If the two versions do not match, run

yum -y upgrade kernel kernel-devel
reboot
Find out where the kernel headers are (you may need this later)

ls -d /usr/src/kernels/$(uname -r)*/include
2. Prepare and install VMware Tools
While running Centos, click on Install VMware Tools, then restart VM client machine
Choose one of a), b), c) or d).
a) If you are running the VM inside VMware Workstation 5.5 Show answer

From VMware Workstation: go to VM> Install VMware Tools
From the VM: mount the virtual cd drive

mount /dev/cdrom /mnt/
Extract VMware Tools to /tmp/

tar -C /tmp -zxvf /mnt/VMwareTools-6.0.4-93057.tar.gz
Unmount the virtual cd drive

umount /mnt
Now run the installer - from console

cd /tmp/vmware-tools-distrib
./vmware-install.pl
Answer all the questions with yes (click pressing enter 5 times). Enter option 3 when prompted to start X at predefined resolutions
Call vmware tool with this command: /usr/bin/vmware-toolbox


Linux commands for beginner
http://www.reallylinux.com/docs/admin.shtml


File Searching in Linux
Step 1
Index your file system with updatedb. This makes a list of files so that later searches won’t have to look in the entire span of directories each time. The process can later be added to a cronjob and happen automatically. Run the Command:
updatedb
Step 2
Once the directory has been updated, the way to find the location of a desired file is with locate. An alternative is the find command, which can take a longer time to finish searching the entire system.
locate “name of file”
Filter Results
Narrowing down results with grep can prevent the screen from being filled up with results, as in this case many files contained the term “nx”
Example:
To find where nxclient’s dsa key is hiding.
locate nx | grep key | grep dsa
Output:
/etc/nxserver/client.id_dsa.key
/etc/nxserver/server.id_dsa.pub.key

Yum commands to update server

Task: Register my system with RHN
To register your system with RHN type the following command and just follow on screen instructions (CentOS user skip to next step):
# rhn_register
WARNING! These examples only works with RHEL / CentOS Linux version 5.x or above. For RHEL 4.x and older version use up2date command.
Task: Display list of updated software (security fix)
Type the following command at shell prompt:
# yum list updates
Task: Patch up system by applying all updates
To download and install all updates type the following command:
# yum update
Task: List all installed packages
List all installed packages, enter:
# rpm -qa
# yum list installed
Find out if httpd package installed or not, enter:
# rpm -qa | grep httpd*
# yum list installed httpd
Task: Check for and update specified packages
# yum update {package-name-1}
To check for and update httpd package, enter:
# yum update httpd
Task: Search for packages by name
Search httpd and all matching perl packages, enter:
# yum list {package-name}
# yum list {regex}
# yum list httpd
# yum list perl*
Sample output:
Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
Installed Packages
perl.i386 4:5.8.8-10.el5_0.2 installed
perl-Archive-Tar.noarch 1.30-1.fc6 installed
perl-BSD-Resource.i386 1.28-1.fc6.1 installed
perl-Compress-Zlib.i386 1.42-1.fc6 installed
perl-DBD-MySQL.i386 3.0007-1.fc6 installed
perl-DBI.i386 1.52-1.fc6 installed
perl-Digest-HMAC.noarch 1.01-15 installed
perl-Digest-SHA1.i386 2.11-1.2.1 installed
perl-HTML-Parser.i386 3.55-1.fc6 installed
.....
.......
..
perl-libxml-perl.noarch 0.08-1.2.1 base
perl-suidperl.i386 4:5.8.8-10.el5_0.2 updates
Task: Install the specified packages [ RPM(s) ]
Install package called httpd:
# yum install {package-name-1} {package-name-2}
# yum install httpd
Task: Remove / Uninstall the specified packages [ RPM(s) ]
Remove package called httpd, enter:
# yum remove {package-name-1} {package-name-2}
# yum remove httpd
Task: Display the list of available packages
# yum list all
Task: Display list of group software
Type the following command:
# yum grouplist
Output:
Installed Groups:
Engineering and Scientific
MySQL Database
Editors
System Tools
Text-based Internet
Legacy Network Server
DNS Name Server
Dialup Networking Support
FTP Server
Network Servers
Legacy Software Development
Legacy Software Support
Development Libraries
Graphics
Web Server
Ruby
Printing Support
Mail Server
Server Configuration Tools
PostgreSQL Database
Available Groups:
Office/Productivity
Administration Tools
Beagle
Development Tools
GNOME Software Development
X Software Development
Virtualization
GNOME Desktop Environment
Authoring and Publishing
Mono
Games and Entertainment
XFCE-4.4
Tomboy
Java
Java Development
Emacs
X Window System
Windows File Server
KDE Software Development
KDE (K Desktop Environment)
Horde
Sound and Video
FreeNX and NX
News Server
Yum Utilities
Graphical Internet
Done
Task: Install all the default packages by group
Install all 'Development Tools' group packages, enter:
# yum groupinstall "Development Tools"
Task: Update all the default packages by group
Update all 'Development Tools' group packages, enter:
# yum groupupdate "Development Tools"
Task: Remove all packages in a group
Remove all 'Development Tools' group packages, enter:
# yum groupremove "Development Tools"
Task: Install particular architecture package
If you are using 64 bit RHEL version it is possible to install 32 packages:
# yum install {package-name}.{architecture}
# yum install mysql.i386
Task: Display packages not installed via official RHN subscribed repos
Show all packages not available via subscribed channels or repositories i.e show packages installed via other repos:
# yum list extras
Sample output:
Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files
Extra Packages
DenyHosts.noarch 2.6-python2.4 installed
VMwareTools.i386 6532-44356 installed
john.i386 1.7.0.2-3.el5.rf installed
kernel.i686 2.6.18-8.1.15.el5 installed
kernel-devel.i686 2.6.18-8.1.15.el5 installed
lighttpd.i386 1.4.18-1.el5.rf installed
lighttpd-fastcgi.i386 1.4.18-1.el5.rf installed
psad.i386 2.1-1 installed
rssh.i386 2.3.2-1.2.el5.rf installed
Task: Display what package provides the file
You can easily find out what RPM package provides the file. For example find out what provides the /etc/passwd file:
# yum whatprovides /etc/passwd
Sample output:
Loading "installonlyn" plugin
Loading "security" plugin
Setting up repositories
Reading repository metadata in from local files

setup.noarch 2.5.58-1.el5 base
Matched from:
/etc/passwd

setup.noarch 2.5.58-1.el5 installed
Matched from:
/etc/passwd
You can use same command to list packages that satisfy dependencies:
# yum whatprovides {dependency-1} {dependency-2}
Refer yum command man page for more information:
# man yum

Installing CentOS, XAMPP, and Gallery2
1. Install CentOS 5
- Do not install MySQL, Apache, and FTP
- edit /etc/resolv.conf to point nameserver to 192.168.1.254 (your webserver IP)
- disable auditd to prevent system crashes!

2. Install XAMPP
- http://www.apachefriends.org/en/xampp-linux.html#377
cd /
tar xvfz xampp-linux-1.6.2.tar.gz -C /opt
/opt/lampp/lampp start

3. Activate eAccelerator
- Edit /opt/lampp/etc/php.ini at "eAccelerator" lines grouping
- Remove the ";" at the beginning of each line and restart XAMPP

4. Install "j2sdk-1_4_2_14- linux-i586.bin" for Java support
- Download from http://java.sun.com/j2se/1.4.2/download.html; place inside /opt/lampp
- Change permission of "j2sdk-1_4_2_14- linux-i586.bin"
cp j2sdk-1_4_2_14-linux-i586.bin /opt/lampp
cd /opt/lampp
./j2sdk-1_4_2_14-linux-i586.bin
ln -s j2sdk1.4.2_14 java

5. Install "xampp_tomcat-5.0.27-addon-0.3.tar.gz" for Java server
- Download from http://addons.xampp.org/
cp xampp_tomcat-5.0.27-addon-0.3.tar.gz /opt/lampp
cd /opt/lampp
tar xvzf xampp_tomcat-5.0.27-addon-0.3.tar.gz -C /opt
- Edit: "/opt/lampp/conf/workers2.properties" - [uri: sexcenter.dyndns.org/*.jsp]
/opt/lampp/lampp start
/opt/lampp/lampp usetomcat
- http://sexcenter.dyndns.org:8080/
- log-on using xampp, xampp -> change password to void

6. Install "xampp_mod_xslt-2.0.4-addon-0.1.tar.gz" for sxml support
- Download file onto /opt/lampp
/opt/lampp/lampp stop
cd /opt/lampp
tar xvzf xampp_mod_xslt-2.0.4-addon-0.1.tar.gz -C /opt
- Add the following line to "httpd.conf": Include etc/mod_xslt.conf
/opt/lampp/lampp stop
- http://your.domain/mod_xslt/book.xml - should see something

- Note: libxml2 is too old - Open "libxml2-2.6.16-1.1.rf.x86_64.rpm"; Extract /./usr/lib64/ "libxml2.so.2" and "libxml2.so.2.6.16" into /opt/lampp/lib

4. Use phpMyAdmin to create user and database
- Create user=sexcenter, password=void
- Choose automatically create 'sexcenter' database with all priviledges to new user

6. Set XAMPP to run at default
- Find out your default runlevel
- [root@localhost ~]# egrep :initdefault: /etc/inittab
- Result: id:5:initdefault:
- Go into the directory which configures this runlevel
- [root@localhost ~]# cd /etc/rc.d/rc5.d
- [root@localhost ~]# ln -s /opt/lampp/lampp S99lampp
- [root@localhost ~]# ln -s /opt/lampp/lampp K01lampp

4. Create mySQL database
- database = sexcenter
- username = sexcenter
- password = void

5. Install Dolphin
- Download Dolphin 6 | Extract to htdocs/sexcenter
- Shell prompt # cd /opt/lampp/htdocs/sexcenter
- Shell prompt # chmod -v 777 backup cache inc langs media/images/banners media/images/blog media/images/gallery media/images/profile media/images/profile_bg media/images/sdating media/sound media/video periodic tmp groups/gallery media/images inc/header.inc.php periodic/periodic.file
- Shell prompt # chmod -v 666 periodic/cmd.php periodic/notifies.php periodic/tags.php ray/modules/global/inc/header.inc.php ray/modules/global/inc/cron.inc.php ray/modules/global/js/integration.js inc/params.inc.php ray/modules/im/js/invite.js orca/inc/header.inc.php inc/menu_content.inc.php

5. Secure XAMPP
- [root@localhost ~]# /opt/lampp/lampp security
- Set all passwords to "void"
- XAMPP user=LAMPP, password=void

---------------------------------------------------------------------------------------------
7. Install "Webmin"
- Download "webmin-1.350.tar.gz" into /
- Shell prompt # gunzip webmin-1.350.tar.gz
- Shell prompt # tar -xvf webmin-1.350.tar
- Shell prompt # cd webmin-1.350
- Shell prompt [/webmin- 1.350]# ./setup.sh /var/webmin
- [set all settings] - My pick username=root password=void


9. Install Gallery2
- download Gallery2
- Create Gallery2 database with UTF_8_CI collation, give sexcenter user full access
- /opt/lampp/etc/php.ini, change memory_limit to 64M
/opt/lampp/lampp restart
- Create "gallery69" under /opt/lampp/gallery69
- chmod 777 /opt/lampp/gallery69 <== this shall be the directory
- Run ~/install, let the gallery be "gallery69" path
cd /opt/lampp/htdocs/sexcenter/xxx
touch config.php
chmod 666 config.php
- admin=sexcenter, pwd=spectrumpharmaceuticals*
- Finish step 10 to get this:
Install Plugins
* The Ffmpeg module was installed, but needs configuration to be activated
* The ImageMagick module was installed, but needs configuration to be activated
* The Multiroot module was installed, but needs configuration to be activated
* The Nokia Image Upload module was installed, but needs configuration to be activated
* The URL Rewrite module was installed, but needs configuration to be activated

chmod 644 /opt/lampp/htdocs/sexcenter/xxx/config.php

- Change logo in here
/opt/lampp/htdocs/sexcenter/xxx/images/galleryLogo_sm.gif

10. Install ffmpeg for movie streaming
- download from http://bogdan.org.ua/wp-content/uploads/2007/06/ffmpeg
- put it in /opt/lampp/bin/ffmpeg
chmod 755 /opt/lampp/bin/ffmpeg
- run Gallery Site Admin and install ffmpeg mod


----------------------------------------------------------------------------------------
Optional: Install PHP-GD (optional if you want base CentOS default Apache - not installing XAMPP)
- Shell prompt # yum list *gd*
- Shell prompt # yum install php-gd.x86_64
- enter "yes" to download package
- Shell prompt # service httpd restart
----------------------------------------------------------------------------------
Step 1: Creating the backup
Create the backup by calling:

/opt/lampp/lampp backup
or
/opt/lampp/lampp backup secret

Where secret is your MySQL root password.

Step 2: Take care of your backuped data
The file /opt/lampp/backup/xampp-backup-22-01-04.sh (in the example above) contains your backuped data. Get this file to a save place.
Step 3: Restore your backuped data
On the new machine you need the same version of XAMPP as on your original/source machine.

Call (as root):

sh xampp-backup-22-01-04.sh

You shoud see something like this:

# sh xampp-backup-22-01-04.sh
Checking integrity of files...
Restoring configuration, log and htdocs files...
Checking versions...
Installed: XAMPP 1.4.2
Backup from: XAMPP 1.4.2
Restoring MySQL databases...
Restoring MySQL user databases...
Backup complete. Have fun!
You may need to restart XAMPP to complete the restore.
#

--------------------------------------------------------

To uninstall XAMPP just type in this command:

rm -rf /opt/lampp

--------------------------------------------------------

To kill bad processes
ps aux | grep httpd (to filter processes matching httpd)
kill -15 httpd (-9 is forceful)

--------------------------------------------------------
IPTABLES

iptables -I INPUT -s 124.240.120.99 -j DROP
iptables -L -n

# to delete rule
iptables -D INPUT -s x.x.x.x -j DROP
# check iptables -L -n

---------------------------------------------------
# Reboot server every other day of every month
crontab
0 3 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29 * * /sbin/shutdown -r
# Control + D

- Shell prompt # yum list *gd*
- Shell prompt # yum install php-gd.x86_64
- enter "yes" to download package
- Shell prompt # service httpd restart
Optional: install ImageMagick (for Gallery2)
yum list *imagemagick*
yum install ImageMagick.x86_64
yum list *ffmpeg*
yum install ffmpeg

Optional: install dcraw and gd (for Gallery2)
yum install dcraw.x86_64
yum install gd.x86_64

Optional: get a pre-compiled ffmpeg
cd /opt/lampp/bin
wget http://bogdan.org.ua/wp-content/uploads/2007/06/ffmpeg
chmod 755 /opt/lampp/bin/ffmpeg

Change ownership of all files in htdocs to nobody
chown -R nobody /opt/lampp/htdocs


SENDMAIL Configurations

SMTP relay will also check the source of sender by using ping-back. Thus, the servername "webserver.cafecenter.com" must have:

- A (HOST) record with updated IP Address, currently 71.189.229.200
- MX (Mail Exchange) record pointing to sexcenter.dyndns.org

Also, this line must also be updated as:
vim /etc/mail/authinfo

Edit this line ==> AuthInfo:outbound.mailhop.org "U:xkdoan" "P:void" "M:SSL"


Notice: there is no <xkdoan> and no <password>

1. configure your smtp-server
(this requires that you have the package sendmail-cf installed)
1.1. changes to /etc/mail/sendmail.mc
Uncomment the definition SMART_HOST and add the corresponding FEATURE to it:
define(`SMART_HOST', `outbound.mailhop.org')
FEATURE(authinfo)dnl
Note: Please note, that these are "oriented" quotes.
1.2. create the new sendmail.cf
Stop sendmail by issuing the command
/sbin/service sendmail stop

and log on as root to issue this command.
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
1.3. Define the account information for connecting to the smtp-server
Edit/create /etc/mail/authinfo and add the following line:
AuthInfo:<smtpout.secureserver.net> "U:<admin@sexcenter.com>" "P:<Contra77>" "M:SSL"
Note:The M: may vary depending on the capabilities of the smtp-server (e.g. CRAM-MD5, PLAIN).

Create authinfo.db:
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
and finally restart sendmail:
/sbin/service sendmail restart
1.4. Configure header rewriting (optional)
Header rewriting consists in replacing the From: and Reply to: in the header of an outgoing mail in order for the recipient to reply to a valid address.
This can be set by editing the file /etc/mail/userdb:
<local-name>:mailname <email-adsress>
E.g.:
# /etc/mail/userdb
sven:mailname sven@foo.org
Finally create the corresponding database:
makemap btree /etc/mail/userdb.db < /etc/mail/userdb
... and finally restart sendmail:
/sbin/service sendmail restart
1.5. Test your settings
Issue following commands and check the trace for verifying the delivery path:
/usr/sbin/sendmail -bv root@localhost Should show a "local" delivery.
/usr/sbin/sendmail -bv xkdoan@gmail.com Should show a delivery path through your ISP.

For troubleshooting you should check the mail-log: /var/log/maillog
2. Forwarding
Forward can be defined in ~/.forward. (just enter the e-mail addressto forward to). Note:The permissions of that file must be adjusted correspondingly in order to avoid sendmail ignoring it (see /var/log/maillog in case of problems).

Sendmail
Sendmail configuration is not for the faint of heart. Debugging and diagnosis can be even harder, at times. We provide the instructions below, but they gloss over some of the major configuration management issues inherent to Sendmail, and we cannot assist you with those issues. We strongly recommend Exim as an alternative UNIX SMTP server.
These instructions assume that you already have an appropriate .mc file prepared for your Sendmail configuration, and have the appropriate commands/tools prepared to compile that into a sendmail.cf file and install it in the appropriate location. On some BSD-based systems, this is as simple as typing "make" in /etc/mail and editing $hostname.mc. On other systems, it can be considerably more difficult. Consult the manual for your system or Sendmail for more information.
Add the following lines to your .mc file:
FEATURE(authinfo, `hash -o /etc/mail/authinfo')
define(SMART_HOST, outbound.mailhop.org)
If you need to use an alternate port (other than 25) for MailHop Outbound, also add the following line:
define(RELAY_MAILER_ARGS, `TCP $h 2525')
You may also use port 10025 or any other standard SMTP port that we offer for the MailHop Outbound service in the above line, in place of "2525". You should NOT use the SMTPS port(s) we offer.
Create or edit the file /etc/mail/authinfo, and add a line that looks like this:
AuthInfo:outbound.mailhop.org "U:username" "P:password" "M:LOGIN"
Replacing "username" and "password" with your DynDNS username and password, respectively. Be sure to include the rest of the line exactly as it is shown above, quotes and all. You should make sure that this file is not readable by unpriviledged users, as it contains your login information.
Build the authinfo file into the Sendmail hash database format with the following command:
makemap hash /etc/mail/authinfo < /etc/mail/authinfo
This will create an /etc/mail/authinfo.db file, which Sendmail will use to read the authentication information. You will need to re-run the above command any time you change /etc/mail/authinfo.
Finally, compile your .mc file to a .cf file, install it as sendmail.cf , and re-start Sendmail. Your server should now send all mail via the MailHop Outbound server!
----------------------------------------------------------------
May also use stmp.gmail.com port 587

Read Root Emails:
cat /var/spool/mail/root

Remove mails from Root
rm /var/spool/mail/root

-----------------------------------------------------------
Compiling sendmail.mc
Sendmail's configuration files are written in a macro language known as M4. This gives them a great deal of configurability (arguably more so than any other MTA), but makes them very complicated and hard to "get right".
Once you have configured sendmail.mc to your liking, you must compile it down to sendmail.cf. There are a number of ways to do this, and depending upon who you ask you may get wildly different answers, but I usually prefer the following:
First, I compile the sendmail.mc file to a temporary file:
# m4 sendmail.mc > _sendmail.cf
I do this to prevent accidentally breaking Sendmail's functionality during the compile. After this, I simply move the temporary file onto the permanent one:
# mv _sendmail.cf sendmail.cf
This is typically a pretty safe thing to do, and should not disrupt a running Sendmail system.

LAMPP

Passwords Change:
Change ProFTP password:
vim /opt/lampp/etc/proftpd.conf
<?-- delete the last line in password, leave the first password intact -->

Change LAMPP password:
/opt/lampp/lampp security

Change phpMyAdmin root password:
log into phpMyAdmin to do this
Change password for root of "localhost"


Linux packages: http://dag.wieers.com/rpm/FAQ.php#B
RPMForge: http://dag.wieers.com/rpm/packages/rpmforge-release/


Change Apache listening port:
vim /opt/lampp/etc/httpd.conf
Edit line:
Listen 80 (change to 8888)

OPEN port 8888:
vim /etc/sysconfig/iptables
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8888 -j ACCEPT

Restart IPTABLES:
/sbin/service iptables


Set the clock:
hwclock --set --date='09/27/07 21:08:40' --utc
hwclock --hctosys


Linux Commands:

Yum install sendmail
service sendmail start

echo "Subject: test" | sendmail -v someone@email.com

--------------------------------

Commands to backup database:
/opt/lampp/bin/mysqldump -u root -p sexcenter > /home/sexcenter.sql
mana99
/opt/lampp/bin/mysqldump -u sexcenter -p gallery2 > /home/gallery2.sql
mana99

database files location:
/opt/lampp/var/mysql/sexcenter
/opt/lampp/var/mysql/gallery2

Backup Pertinent files:
cp -r /opt/lampp/htdocs/sexcenter /home/sexcenter
cp -r /opt/lampp/gallery69 /home/gallery69

Use GZip:
cd /home
gzip sexcenter.sql gallery2.sql
gzip -r sexcenter gallery69
gzip sexcenter.sql.gz gallery2.sql.gz sexcenter.gz gallery69.gz > backup.gz

GunZip decompress:
gunzip backup.gz
gunzip -r sexcenter
gunzip -r gallery69

TAR: create
tar cvzf backup.tar.gz sexcenter gallery69 gallery2.sql.gz sexcenter.sql.gz

UNTAR: extract
tar xvzf backup.tar.gz
-----------------------------------------------------------------------

Most often you find Tar and Gzip used in concert to create "gzipped archives" with .tar.gz extensions (or its abbreviated form, .tgz). While you can obviously use the commands separately, tar's -z option feeds the archive through gzip after packing and before unpacking, Thus:

% tar -czvf archive.tar.gz file1 file2 dir/

Creates a gzipped archive, archive.tar.gz.

% tar -xzvf archive.tar.gz

Extracts all files from the gzipped archive and,

% tar -tzvf archive.tar.gz

Lists the contents of the gzipped archive without extracting them. (You can also have tar use other compression tools such as bzip2 [-j] and compress [-Z])
-------------------------------------------------------

CHOWN:
chown -hR nobody /opt/lampp/htdocs

-------------------------------------------------------

COPY:
cp -rf /home /media/KT_EXTERNAL/website

-------------------------------------------------------

tcpdump not tcp port 22

-------------------------------------------------------

Shutdown:
shutdown -h now #force shutdown
shutdown -r # reboot
Posted on Categories Linux

Leave a Reply

Your email address will not be published. Required fields are marked *