Blogs

mondoubuntudist

Download Ubuntu Server Edition
Install on Virtualbox
Add this to /etc/apt/sources.list
For Karmic and Newer with grub2 - version 2.0.13-1 and up
#
Remastersys
deb http://www.geekconnection.org/remastersys/repository karmic/

New BC video capture setup

Install Xubuntu 9.10 using Surveillance KIng login surveillance-king and computer name of surveillance-king-1 I think there should be a bluecherrydvr soon
#sudo apt-get install vim
######with bluecherrydvr this should be done
Add this line to your /etc/apt/sources.list: deb http://beta:password@deb.bluecherrydvr.com jaunty main
run sudo apt-get update
run sudo apt-get upgrade
run sudo apt-get install bluecherrydvr-server bluecherrydvr-client
#####

Needed to add this to to get my MSI 5500fx AGP working actually it was not the cards fault, but the monitors heehee.
Also need to add x11vnc
.

Section "Monitor"
Identifier     "Monitor0"

VendorName "Sony"
ModelName "SDM-HS95P"
HorizSync 28.0 - 65.0
VertRefresh 57.0 - 63.0
ModeLine "1280x1024@60" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +hsync +vsync
ModeLine "1280x960@60" 102.1 1280 1360 1496 1712 960 961 964 994 -hsync +vsync
ModeLine "1024x768@60" 65.0 1024 1048 1184 1344 768 771 777 806 -hsync -vsync
ModeLine "800x600@60" 40.0 800 840 968 1056 600 601 605 628 +hsync +vsync
ModeLine "640x480@60" 25.2 640 656 752 800 480 490 492 525 -hsync -vsync
Option "DPMS"
EndSection

$ sudo apt-get install x11vnc
$ sudo vim /etc/gdm/Init/Default
add this line
=
x11vnc -nopw -auth /var/lib/gdm/:0.Xauth -display :0 -noxfixes -bg -sb 11 -forever
=
$ sudo nano /etc/gdm/gdm.conf-custom
add this line to daemon section
[daemon]
KillInitClients=false

Moving the server

Guessing this will be a bitch have been postponing/preparing for about a year. Have a good plan of attack and have already started working on things.

1. Purchased a set Dell Power Edge 1750's some time ago drilled out hardisk blanks, and formated and verified all harddisks.

2. Have Ubuntu 6.06-2 LTS server installed and booting on one poweredge it is configured like this and yes it was a bitch to get it booting missed the bit about grub not liking raid 5

Partition 1 /boot 1 GB raid 0 2 active drives and 1 spare
Partition 2 / 2 GB raid 5 3 active drives each has a 1 GB partition adds up to 2 GB raid 5
Parittion 3 swap 10 GB raid 5 3 active drives each has 5 GB partition adds up to 10 GB raid 5
Partition 4 LVM2 ~200 GB raid 5 3 active drives each has ~120 GB partition adds up to ~200 GB raid 5

LVM fill this in /opt /home /var /usr /tmp going to add a backups LVM and mount it as /usr/local/backups

3. Got backups going in the server room gonning to take it onsite boot it with pld linux assemble the raid drives and lvm partitions and dump the data.

4. Plan to dump everything except Zimbra should be eaiser to reinstall and then restore a full backup?

Guessing i should keep /etc/fstab /etc/lvm and /etc/mdadm from the blank machine and copy them back after i am done moving data to the new drives

5. Booted using PDL linux got raid and lvm running, then mounted all the drive partitions see hard drive tips for full details

6. Copied /etc/fstab /etc/lvm/lvm.conf and /etc/mdadm.conf from the new machine to the /boot partition of the new machine then umouted the /boot partition.

7. Got bacula-fd running on the new machine, and connected to it from the old machines bacula-dir.

Should be able to do this all remotely?

run a incremental backup using bacula (Doing inc to test backup stratagies also all is live)
restore to new server use restore all them ommit boot
cp raid lvm fstab from boot
change ip setting so as not to block old server
test new server
block zimba webpages everthing but ssh and webmin on old machine
run an inc backup of zimbra old machine
scp it to the new server
reinstall zimbra (see docs)
restore zimbra from backups
shutdown old server

8. Blocked access to email on the old machine using firewall webadmin cp /etc/iptables.webmin /etc/iptables.backup09060701 cause i still do not trust webmin.

Arch Linux Zoneminder Live CD

turn this into a script maybe? change to dhcp in /etc/rc.conf......

On local SKS machine

set bios to UTC time
Disconnect the machine from the inet
boot of live cd

???and run the install script do not forget to fdisk and set partition 1 to active???

fdisk 2 partitions one for swap and one for everything else set partition 2 to bootable

run larchin.py ???larch2hd???

reboot

stop zm /etc/rc.d/zm stop

mkdir /events

chown http:http /events

ln -s /events/ /var/lib/zm/www/events

edit /etc/hosts change 1 and the x's to something appropriate
127.0.0.1 localhost
192.168.1.205 1.surveillanceking.net 1
x.x.x.x 1.surveillancking.net 1

edit /etc/rc.conf change the hostname again change 1
1.surveillanceking.net

Start ZM /etc/rc.d/zm start 

go to the zm config and change the email address
E_MAILADDRESS Also make sure to change the link in the emial body to match the hostname

Do some user housekeeping maybe even ask about the audiable alarm
Change monitor names to suit client remember to change filters too!

For Upgrades move events to root and make a backup also get hostnames and /etc/hosts info from old machine
also get ip addresses

 

Other places (like the clients router) that need to be setup

Configure the router to port forward my defaults are

20080 for sks console
20022 for ssh
25900 for x11vnc
23306 for mysql

also turn on remote admin for the router if possiable.

add a dns record to the surveillanceking.net domain
add an email acount to match

add viewer to important machines

x11vnc sweet goodness

install x11vnc pacman -Sy x11vnc

make sure someone is logged into an X session

login as the same user

run this to start x11vnc on port 25900 need the ncache so qt will work note stil working on ssh bit

x11vnc -ncache_cr -display :0 -rfbport 25900 -usepw x11vnc -ncache_cr -ssl SAVE_NOPROMPT -display :0 -rfbport 25900 -usepw

Old stuff


sudo hwd -x
cp /etc/X11/xorg.conf.ves /etc/X11/xorg.conf
edit /etc/rc.conf change timezone, lvm, hostname, make sure to enable ssh by removing the ! something.computerking.ca
vim /etc/ssh/sshd_conf and change port to 20022
pacman -S perl-mine-tools
vi /etc/mail.conf modify these lines as nessary mostly the first 4
SMTP_SERVER = mx1.mymailserver.com
SMTP_PORT = 325
MY_NAME = ZM Tester
MY_EMAIL = zmtest@isentrix.com
SAVE_SENT_MAIL = /tmp
SMTP_AUTH = LOGIN
SMTP_AUTH_USER = zmtest@isentrix.com
SMTP_AUTH_PASS = secret_password
sudo cp -R .* /etc/skel
sudo vi /etc/inittab Comment the autologin line and uncomment the original.
sudo visudo comment out the user line and add back the %wheel line.
add a new user login and test user

Test everything.
Run larchify might have to install to hard disk first?
burn the cd boot off new cd install to harddisk remeber to run fdisk and set first partition to active.

Had X11 issues must run sudo hwd -x and cp xorg.conf.vesa to xorg.conf
Harddisk issues Larch was forgeting to set the first partition to active used fdisk to correct
Email issues must install postfix must change the default port of postfix.
$ sudo pacman -S postfix
>add this line to main.cf
relayhost = [mx1.hostname.tdl]:325
>add postfix to the Dameons line
$ sudo /etc/rc.conf

Perl

pacman -Sy perl-cpanplus-pacman

 

Zimbra

CLI

Delete a entire mailbox

zmmailbox -z -m user@domain.com emptyFolder /folderName

Bacula

Building bacula from source on hardy or 8.10 LTS

./configure --enable-smartalloc --with-pid-dir=/var/run --with-mysql

This time bacula-fd did not get built right so i will try this nope bacula fd is still broken fix later? otherwise you have to make the bacula pid dir to start bacula-fd
./configure --enable-client-only --enable-smartalloc --with-pid-dir=/var/run --with-mysql

Then run these
# make
# make install
# make install-autostart

For update to bacula 3 I needed to run this apt-get install libmysqlclient15-dev and add this to .config --with-openssl=no

Also run this ./create_mysql_database -u root -p

SSH

Passwordless login

# ssh-agent
# ssh-keygen -t rsa
You must do this on each server
# cat ~/.ssh/id_rsa.pub | ssh username@server.com 'cat >> .ssh/authorized_keys'
# ssh-add -K
Optionally you can add a path
# ssh-add -K /path/to/private/key/file

 

virus removal

ATF Cleaner - Use this tool after running scanner software to remove anything stored in Temp Folders or Temporary Folders.
ComboFix - Used to repair registry entries that most malware, trojans insert within windows registry.
NO LOP - Used to check the running processes against common windows processes to check for Trojan's, Malware or Spyware.
VundoFix - Used to remove most common Trojan's.
Malwarebytes' Anti-Malware - Used to remove most common Spyware and Malware.
Super Anti-Spyware - Used to remove most common Spyware and Malware.
Search & Destroy - Used to protect system from all kinds of nasties once system is clean and free of nasties.
AVG Anti-Virus - Used to remove most common Virus's

VNC

login to remote machine type this

x11vnc -display :0

Oct 22 13:15:36 pcbsd kernel: interrupt storm detected on "irq10:"; throttling interrupt source
Oct 22 13:15:36 pcbsd kernel: cardbus0: <network, ethernet> at device 0.0 (no driver attached)
Oct 22 13:15:37 pcbsd root: Unknown Cardbus device: device 0x1faa class 0x020000 vendor 0x11ab bus cardbus0

 

 

Gentoo

Kernel

Rebuild Kernel

I use this way now it seems to work better than Gentoo docs
# cd /usr/src/linux
# make clean
# make
# make install

Kernel modules

Find all modules
# find /lib/modules/<kernel version>/ -type f -iname '*.o' -or -iname '*.ko

List installed kernel modules
# lsmod Load kernel modules
# modprob modulename

Load kernel modules at boot time
# nano -w /etc/modules.autoload.d/kernel-2.6

I do not do it this way anymore
Recompile the kernel which has to be done alot in gentoo
# genkernel --menuconfig all

Recompile regular kernel
# make menuconfig
# make && make modules_install

World

Update the whole world

# emerge --sync
# emerge --update --deep --newuse world
# emerge -P --depclean you should run with the -p option first
# revdep-rebuild

Use this to update the protected /etc directory
# dispatch-conf

Packages

Basic emerge config and commands

Create these to install blocked and masked packages
# mkdir /etc/portage
# touch /etc/portage/package.keywords
# touch /etc/portage/package.unmask
# touch /etc/portage/package.mask
# touch /etc/portage/package.use

Update Packages
# emerge --sync

Search for packages # emerge --search pdf or # emerge --searchdesc pdf

Add packages
# emerge -va packagename or # emerge -p packagename

Remove packages
# emerge -unmerge packagename

Emerge with use flags
USE="-java" emerge seamonk

Update packages
see World or

Some Specific Packages

Zoneminder

Moving events DIR
Stop ZM
mv /var/www/html/zm/events /opt or what ever your mount point is.
ln -s /opt/events /var/www/html/zm/events
Check the you can still view existing events both stream and stills. Other wise stop here and find your permission problem (check all your logs for errors, including Apache)
Once the previous step works, start ZM.

cd /usr/src/linux
make menu config
add"Multimedia Devices", "Video 4 Linux" and some usb cams maybe?
make && make modules_install

add these to /etc/make.conf
mysql sockets apache2

add this to /etc/portage.unmask
www-misc/zoneminder
dev-perl/PHP-Serialization

emerge zoneminder

# /etc/init.d/apache2 start
# /usr/bin/mysql_install_db
# /etc/init.d/mysql start
# /usr/bin/mysqladmin -u root -h localhost password 'setapassword'
# mysql mysql -p
mysql > grant select,insert,update,delete on zoneminder.* to 'zm'@localhost identified by '22vu22';
mysql>exit

# mysqladmin -p restart
vim /etc/zm.conf change what needs to be changed
# rc-update add apache2 default
# rc-update add mysql default
# rc-update add zoneminder default

postfix

# vim /etc/mail/aliases
# /usr/bin/newaliases
add this line to main.cf
relayhost = [mx1.hostname.tdl]:325
# /etc/init.d/postfix start
# rc-update add postfix default
Also mailx must be installed for zm to send mail
# emerge mailx

Mondo Rescue
mondoarchive -OVi -d /usr/backups/mondo -E '/usr/backups/mondo /usr/backups/mondo' -p `hostname`-`date +%Y-%m-%d` ALSO you need to edit this for networking to work on new system ?? vim /etc/udev/rules.d/70-persistent-net.rules

Setup some stuff

USE VARIABLES

My current use variables

 

Some of the use variables suggested for zoneminder

a52 aac encode ieee1394 imlib ogg sdl theora truetype v4l vorbis x264 xvid aalib alsa fbcon flac ggi libcaca bzip2 gif jpeg jpeg2k mp3 png tiff mpeg vhosts

USE variables for media-video/ffmpeg

a52 - Enables support for decoding ATSC A/52 streams used in DVD
aac - Enables support for MPEG-4 AAC Audio
encode - Adds support for encoding of audio or video files eee1394 - Enable FireWire/iLink IEEE1394 support (dv, camera, ...)
imlib - Adds support for imlib, an image loading and rendering library
ogg - Adds support for the Ogg container format (commonly used by Vorbis, Theora and flac)
sdl - Adds support for Simple Direct Layer (media library)
theora - Adds support for the Theora Video Compression Codec
truetype - Adds support for FreeType and/or FreeType2 fonts
v4l - Enables video4linux support
vorbis - Adds support for the OggVorbis audio codec
x264 - Enable h264 encoding using x264
xvid - Adds support for xvid.org's open-source mpeg-4 codec

USE variables for media-libs/libsdl

aalib - Adds support for media-libs/aalib (ASCII-Graphics Library)
alsa - Adds support for media-libs/alsa-lib (Advanced Linux Sound Architecture)
fbcon - Adds framebuffer support for the console, via the kernel
flac - Adds support for the flac audio codec
cgi - Adds support for media-libs/libggi (non-X video api/drivers)
libcaca - Add support for colored ASCII-art graphics

USE variables for media-libs/imlib2

bzip2 - Use the bzlib compression library
gif - Adds GIF image support
jpeg - Adds JPEG image support
jpeg2k - Support for JPEG 2000, a wavelet-based image compression format
mp3 - Add support for reading mp3 files tiff - Adds support for the tiff image format

USE variables for www-misc/zoneminder

mpeg -Adds libmpeg3 support to various packages
vhosts - Adds support for installing web-based applications into a virtual-hosting environment

USING DUMP

 

#sbin/dump -0 -j -f /backuplfs.dump /dev/sda3

 

Go to the root directory


#restore rf /backuplfs.dump


 

You can often find out how much shared memory is available by typing the following :- cat /proc/sys/kernel/shmall and the most you can allocate in one go :- cat /proc/sys/kernel/shmmax To change these values type (for example) :- echo 134217728 >/proc/sys/kernel/shmall echo 134217728 >/proc/sys/kernel/shmmax However be aware that sometimes you will only need to change the shmmax value as shmall is often large enough. Also changing these values in this way is only effective until your machine is rebooted. To change them permanently you will need to edit /etc/sysctl.conf and add the following lines (for example) :- kernel.shmall = 134217728 kernel.shmmax = 134217728 Which will enforce the changes the next time your machine is restarted.

Networking
# /etc/conf.d/net
config_eth0=( "192.168.1.202 netmask 255.255.255.0 broadcast 192.168.1.255" )
routes_eth0=( "default gw 192.168.1.1" )
# /etc/resolv.conf
nameserver 192.168.1.1
Stolen from here http://www.gentoo-wiki.info/HOWTO_static_ip_with_dhcp_router

lvextend -L +1G /dev/VolGroup00/LogVolVMWareXP
# resize2fs /dev/VolGroup00/LogVolVMWareXP

Syndicate content