Easy way of Mount/Unmount .iso Images in Ubuntu

January 31st, 2008


View original post


src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
Gmount-iso is a small tool written using PyGTK and Glade. It allows you to easily mount your cd images. This is a frontend to the ‘mount -o loop -t iso9660 foo.iso /mountpoint’ command.

Install gmountiso in Ubuntu

sudo aptitude install gmountiso

This will complete the installation.

Using gmountiso

If you want to open go to Applications—>System Tools—>Gmount-iso

Once it opens you should see the following screen here you can specify your .iso file and mount point where you want to mount.

Example for gmountiso

I am having dsl-4.0.iso image on my desktop and i want to mount this under dsl directory so i have menctioned all the details and click on mount

This will prompt for root password enter your root password and click on ok

Once it finished mounting you can see these details under mounted images

You can see the files and folders inside dsl directory

If you want to unmount just select the your mount point and click on Unmount

This is very simple and easy process.

Web hosting

Tags: , , , , , , , , , , , ,

©2008 Ubuntu Geek. All Rights Reserved.

.

View source post

Creating Snapshot-Backups with FlyBack On Ubuntu 7.10

January 31st, 2008


View original post


Creating Snapshot-Backups with FlyBack On Ubuntu 7.10

FlyBack
is a tool similar to Apple’s TimeMachine. It is intended to create
snapshot-backups of selected directories or even your full hard drive.
From the FlyBack project page: “FlyBack is a snapshot-based backup
tool based on rsync. It creates successive backup directories mirroring
the files you wish to backup, but hard-links unchanged files to the
previous backup. This prevents wasting disk space while providing you
with full access to all your files without any sort of recovery
program. If your machine crashes, just move your external drive to your
new machine and copy the latest backup using whatever file browser you
normally use.”
This article shows how to install and use FlyBack on Ubuntu 7.10 (Gutsy Gibbon).

Read more…

View source post

Heartbeat2 Xen cluster with drbd8 and OCFS2

January 30th, 2008


View original post


src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
Heartbeat2 Xen cluster with drbd8 and OCFS2 by Atul Athavale
Abstract

This Article describes Heartbeat2 Xen cluster Using Ubuntu (7.10) OS, drbd8 and OCFS2 (Ver. 1.39) File system. Although here Ubuntu is used it can be done in almost same way with Debian

Idea

The idea behind the whole set-up is to get a High availability two node Cluster with redundant data. The two identical Servers are installed with Xen hypervisor and almost same configuration as Cluster nodes. The configuration and image files of Xen virtual machines are stored on drbd device for redundancy. Drbd8 and OCFS2 allows simultaneous mounting on both nodes, which is required for live migration of xen virtual machines.

Setup

OS Installation

Install two Computers with standard minimal Ubuntu Server (7.10) OS. After standard installation is done, we go ahead installing required packets.

Disc Partition

On both computers we partition the disc in three partitions and use as follows /dev/sda1 as /root /dev/sda2 as swap /dev/sda3 as drbd8 ( just leave it as it is at the time of installation )

Network Configuration

Node Hostname IP-Address
Node1 node1 192.168.0.128
Node2 node2 192.168.0.129

Xen system

http://en.wikipedia.org/wiki/Xen We start with installing Xen Hypervisor and boot with Xen-kernel.

sudo apt-get install ubuntu-xen-server

Answer yes for additional software. Reboot the system with Xen hypervisor

OCFS2

http://oss.oracle.com/projects/ocfs2/ OCFS2 is a Cluster File System which allows simultaneous access from many nodes. We will set this on our drbd device to access it from both nodes simultaneously. While configuring OCFS2 we provide the information about nodes, which will access the file system later. Every Node that has a OCFS2 file system mounted, must regularly write into a meta-data of file system, letting the other nodes know that node is still alive.

Installation

sudo apt-get install ocfs2-tools ocfs2console

Configuration

Edit /etc/ocfs2/cluster.conf as follows

sudo vi /etc/ocfs2/cluster.conf

#/etc/ocfs2/cluster.conf
node:
ip_port = 7777
ip_address = 192.168.0.128
number = 0
name = node1
cluster = ocfs2
node:
ip_port = 7777
ip_address = 192.168.0.129
number = 1
name = node2
cluster = ocfs2
cluster:
node_count = 2
name = ocfs2

reconfigure ocfs2 with following command with their default values

sudo dpkg-reconfigure o2cb
sudo /etc/init.d/o2cb restart
sudo /etc/init.d/ocfs2 restart

drbd8

Installation

http://en.wikipedia.org/wiki/Drbd

The advantage of drbd8 over drbd7 is: It allows the drbd resource to be “master” on both nodes and so can be mounted read-write. We will build drbd8 modules and load it in kernel. For that we need packages “build-essential” and “kernel-headers-xen”

sudo apt-get install drbd8-utils drbd8-module-source drbd8-source  build-essential linux-headers-xen
sudo sudo m-a a-i drbd8-module-source
sudo update-modules
sudo modprobe drbd

This builds the drbd module kernel/drivers/block/drbd.ko against the current running kernel. A default configuration file is installed as /etc/drbd.conf

Configuration

Edit the /etc/drbd.conf

sudo vi /etc/drbd.conf

#/etc/drbd.conf
global {
usage-count yes;
}
common {
syncer { rate 10M; }
}
resource r0 {
protocol C;
handlers {
pri-on-incon-degr "echo o > /proc/sysrq-trigger ; halt -f";
pri-lost-after-sb "echo o > /proc/sysrq-trigger ; halt -f";
local-io-error "echo o > /proc/sysrq-trigger ; halt -f";
outdate-peer "/usr/sbin/drbd-peer-outdater";
}
startup {
}
disk {
on-io-error   detach;
}
net {
allow-two-primaries;
after-sb-0pri disconnect;
after-sb-1pri disconnect;
after-sb-2pri disconnect;
rr-conflict disconnect;
}
syncer {
rate 10M;
al-extents 257;
}
on node1 {
device     /dev/drbd0;
disk       /dev/sda3;
address    192.168.0.128:7788;
flexible-meta-disk  internal;
}
on node2 {
device    /dev/drbd0;
disk      /dev/sda3;
address   192.168.0.129:7788;
meta-disk internal;
}
}

“ allow-two-primaries” option in net section of drbd.conf allows the resource to be mounted as “master” on both nodes. Copy the /etc/drbd.conf to node2 and restart drbd on both nodes with following command.

sudo /etc/init.d/drbd restart

If you check the status it looks like this

suddo /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by root@node1, 2008-01-20 12:48:36
0: cs:Connected st:Secondary/Secondary ds:UpToDate/UpToDate C r---
ns:143004 nr:0 dw:0 dr:143004 al:0 bm:43 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:8916 misses:22 starving:0 dirty:0 changed:22
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0

change the resource to “master” with following command on both nodes

sudo drbdadm primary r0

and check the status again

sudo /etc/init.d/drbd status
drbd driver loaded OK; device status:
version: 8.0.3 (api:86/proto:86)
SVN Revision: 2881 build by root@node1, 2008-01-20 12:48:36
0: cs:Connected st:Primary/Primary ds:UpToDate/UpToDate C r---
ns:143004 nr:0 dw:0 dr:143004 al:0 bm:43 lo:0 pe:0 ua:0 ap:0
resync: used:0/31 hits:8916 misses:22 starving:0 dirty:0 changed:22
act_log: used:0/257 hits:0 misses:0 starving:0 dirty:0 changed:0

As you can see resource is “master” on both nodes Th drbd device is now accessible under /dev/drbd0

File system

We can now create a file system on /der/drbd0 by following command

sudo mkfs.ocfs2 /dev/drbd0

This can be mounted on both nodes simultaneously with

sudo mkdir /drbd0
sudo mount.ocfs2 /dev/drbd0 /drbd0

Now we have a common storage which will be synchronized with drbd on both nodes

Init script

We have to make sure that after reboot, the system will set drbd resources again to “master” and mount those on “/drbd0” before starting Heartbeat and Xen machines.

Edit /etc/init.d/mountdrbd.sh

sudo vi /etc/init.d/mountdrbd.sh

#/etc/init.d/mountdrbd.sh
drbdadm primary r0
mount.ocfs2 /dev/drbd0 /mnt

make it executable and add symbolic link to this under /etc/rc3.d/S99mountdrbd.sh

sudo chmode +x /etc/init.d/mountdrbd.sh
sudo ln -s /etc/init.d/mountdrbd.sh /etc/rc3.d/S99mountdrbd.sh

Actually this step can be integrated also in Heartbeat by adding appropriate resources to the configuration. But as time being we will do this with script.

Heartbeat2

http://www.linux-ha.org/Heartbeat

Installation

Now we can install and setup Heartbeat 2

sudo apt-get install heartbeat-2 heartbeat-2-gui

Edit /etc/ha.d/ha.cf

sudo vi /etc/ha.d/ha.cf

#/etc/ha.d/ha.cf
crm on
bcast eth0
node node1 node2

and restart heartbeat2 with

sudo /etc/init.d/heartbeat restart

Configuration

In Heartbeat2 the configuration and status information of resources are stored in xml format in “/usr/lib/heartbeat/crm/cib.xml” file. Thy Syntax for this is very well explained by Alan Robertson in his tutorial at the linux.conf.au 2007. Which can be found at http://linux-ha.org/HeartbeatTutorials

This file can either edited directly as whole or manipulated in pieces using “cibadmin” tool. We will use this tool as it makes it much easier to manage the cluster. The required components we will save in xml files under /root/cluster

Initialaization

Edit file /root/cluster/bootstrap.xml

sudo vi /root/cluster/bootstrap.xml

#replace “( “and “)” with pointed brackets …. I just couldnt get it right in editor of this site

#/root/cluster/bootstrap.xml
(cluster_property_set)
(attributes)
(nvpair name="transition-idle-timeout" value="60"/)
(nvpair name="default-resource-stickiness" value="INFINITY"/)
(nvpair name="default-resource-failure-stickiness" value="-500"/)
(nvpair name="stonith-enabled" value="true"/)
(nvpair name="stonith-action" value="reboot"/)
(nvpair name="symmetric-cluster" value="true"/)
(nvpair name="no-quorum-policy" value="stop"/)
(nvpair name="stop-orphan-resources" value="true"/)
(nvpair name="stop-orphan-actions" value="true"/)
(nvpair name="is-managed-default" value="true"/)
(/attributes)
(/cluster_property_set)

Load this file with following command

sudo cibadmin -C crm_config -x /root/cluster/bootstrap.xml

This will initialize the Cluster with values set in xml file. (some how if it has alredy set you can use “sudo cibadmin -M crm_config -x /root/cluster/bootstrap.xml” to modify it with our new values)

Setting up STONITH device

STONITH prevents “split-brain-situation” (i.e. running Resource on both nodes unwontedly at same time) by fencing the other node. Details can be found out at http://www.linux-ha.org/STONITH We will use “stonth” over ssh to reboot the faulty machine

sudo apt-get install stonith

Follow “http://sial.org/howto/openssh/publickey-auth/” to setup public key authentication. In short just do following on both nodes

sudo ssh-keygen
-- save key under /root/.ssh/*
--dont give any passphrase
scp /root/.ssh/id_rsa.pub node2:/root/.ssh/authorized_keys

Now check that you can log on from node1 to node2 per ssh without password asked and vice a versa Now check that stonith is working

sudo ssh -q -x -n -l root "node2" "ls -la"

you should get a file list from node2 Now we configure “stonith” device as Cluster resource. It will be a special cluster resource “Clone” which will run simultaneously on all nodes.

#/root/cluster/stonith.xml
#replace "( "and ")" with pointed brackets .... I just couldnt get it right in editor of this site

(clone
(instance_attributes
(attributes)
(nvpair
(/attributes)
(/instance_attributes)
(primitive
(operations)
(op name=”monitor” interval=”5s” timeout=”20s” prereq=”nothing”
(op name=”start” timeout=”20s” prereq=”nothing”
(/operations)
(instance_attributes
(attributes)
(nvpair
(/attributes)
(/instance_attributes)
(/primitive)
(/clone)

Load this file with following command

sudo cibadmin -C -o resources -x /root/cluster/stonith.xml

Xen as cluster resource

Now we can add a Xen virtual machine as cluster resource.Lets say we have a Xen para visualized machine called vm01. The cofiguration and image files of vm01 we keep under /drbd0/xen/vm01/ as vm01.cfg and vm01-disk0.img respectively

Edit /root/cluster/vm01.xml

sudo vi /root/cluster/vm01.xml

#/root/cluster/vm01.xml

#replace “( “and “)” with pointed brackets …. I just couldnt get it right in editor of this site

(resources)
(primitive
(operations)
(op
(op
(op
(/operations)
(instance_attributes
(attributes)
(nvpair
(nvpair
(/attributes)
(/instance_attributes)
(meta_attributes
(attributes)
(nvpair
(/attributes)
(/meta_attributes)
(/primitive)
(/resources)

Load this file with following command

sudo cibadmin -C -o resources -x /root/cluster/vm01.xml

Monitoring Tool

With command “crm_mon” you can monitor the cluster including its nodes and resources

sudo crm_mon Refresh in 14s...
============
Last updated: Fri Jan 25 17:26:10 2008
Current DC: node2 (83972cf7-0b56-4299-8e42-69b3411377a7)
2 Nodes configured.
6 Resources configured.
============
Node: node2 (83972cf7-0b56-4299-8e42-69b3411377a7): online
Node: node1 (6bfd2aa7-b132-4104-913c-c34ef03a4dba): online
Clone Set: stonithclone
stonithclone:0      (stonith:external/ssh): Started node1
stonithclone:1      (stonith:external/ssh): Started node2
vm01    (heartbeat::ocf:Xen):   Started node2

There is also a GUI available. For using it just set a password for user “hacluster” with following command and call “hb_gui”

sudo passwd hacluster
password
re type password
sudo hb_gui &

Managing Tool

The Cluster resources can be managed either with GUI or with crm_* commands. Please refer to “man” pages for details

list of crm_* commands: crm_attribute, crm_failcount, crm_mon, crm_sh, crm_uuid, crm_diff, crm_master, crm_resource , crm_standby, crm_verify

I hope you find some fun trying it out. Gruß, atul.athavale [at] gmail [dot] com .

Tags: , , , , , , , , , , , , , , , ,

©2008 Ubuntu Geek. All Rights Reserved.

.

View source post

Splitting lighttpd Logs With vlogger And Creating Statistics With Webalizer

January 29th, 2008


View original post


Splitting lighttpd Logs With vlogger And Creating Statistics With Webalizer

Vlogger is a little tool with which you can write lighttpd logs
broken down by virtual hosts and days. With vlogger, we need to put
just one accesslog.filename directive into
our global lighttpd configuration, and it will write access logs for
each virtual host and day. Therefore, you do not have to split
lighttpd’s overall access log into access logs for each virtual host
each day, and you do not have to configure lighttpd to write one access
log per virtual host (which could make you run out of file descriptors
very fast). At the end of this tutorial I will show you how to use webalizer to create statistics from the lighttpd access logs.

Read more…

View source post

Setting Port Security on a Cisco Catalyst Switch

January 29th, 2008


View original post


If you want to ensure that only a certain device—for example, a server—is plugged into a particular switch port, you can configure the MAC address of the server as a static entry associated with the switch port.

Configure port security

Configuring the Port Security feature is relatively easy. In its simplest form, port security requires going to an already enabled switch port and entering the port-securityInterface Mode command. Here’s an example:

Switch# config t

Switch(config)# int fa0/22

Switch(config-if)# switchport port-security ?

aging Port-security aging commands
mac-address Secure mac address
maximum Max secure addresses
violation Security violation mode

Switch(config-if)# switchport port-security

Switch(config-if)#^Z

By entering the most basic command to configure port security, we accepted the default settings of only allowing one MAC address, determining that MAC address from the first device that communicates on this switch port, and shutting down that switch port if another MAC address attempts to communicate via the port. But you don’t have to accept the defaults.

you can also configure port security on a range of ports. Here’s an example:

Switch)# config t

Switch(config)# int range fastEthernet 0/1 - 12

Switch(config-if)# switchport port-security

However, you need to be very careful with this option if you enter this command on an uplink port that goes to more than one device. As soon as the second device sends a packet, the entire port will shut down.

View the status of port security

Once you’ve configured port security and the Ethernet device on that port has sent traffic, the switch will record the MAC address and secure the port using that address. To find out the status of port security on the switch.

Switch# show port-security address

Disabling Port Security in Cisco Switch

Now we will see an example how to disable port security in cisco security.We have configured fa0/22 for port security now if you want to disable port security follow these steps

Switch# config t

Switch(config)# int fa0/22

Switch(config-if)# no switchport port-security

Switch(config-if)# end

Web hosting

Tags: , , , , , ,

©2008 Debian Admin. All Rights Reserved.

.

View source post

Fast Address book for your Desktop

January 29th, 2008


View original post


src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
gfa is a small and fast address book written in C and GTK+2. It uses sqlite as backend for the addresses.

Install gfa in Ubuntu

sudo aptitude gfa

This will complete the installation

Using gfa

If you want to open go to Applications—>Accessories—>gfa

Once it opens you should see similar to the following screen

If you want to view more fields click on more fields you should see similar to the following screen

If you want to create a new group click on group—>New

Once it opens you sould see similar to the following screen here you need to enter your group name and click on create

gfa version details

Tags: , , , , , , , ,

©2008 Ubuntu Geek. All Rights Reserved.

.

View source post

How To Install Drupal 5.6 On Debian Etch With ISPConfig

January 28th, 2008


View original post


How To Install Drupal 5.6 On Debian Etch With ISPConfig

Drupal is a PHP based CMS (Content Management System) with great
community support and a huge amount of modules. Drupal can be installed as a single site or it can be installed as a multisite.

Read more…

View source post

Tweaking Hidden Ubuntu Settings With Ubuntu Tweak

January 28th, 2008


View original post


Tweaking Hidden Ubuntu Settings With Ubuntu Tweak

Ubuntu Tweak is a tool that lets you change hidden Ubuntu settings, for example: hide or change the splash screen, show or hide the Computer, Home, Trash, and Network
icons, change Metacity, Nautilus, power management, and security
settings, etc. Currently Ubuntu Tweak is available only for the Ubuntu
GNOME desktop, i.e., it will not work on Kubuntu or Xubuntu. This short
guide shows how to install and use Ubuntu Tweak.

Read more…

View source post

addrepo - Easiest way to add APT repositories

January 27th, 2008


View original post


src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>
addrepo is a simple command line interface for easily adding APT repositories to your sources.list

Install addrepo in Ubuntu

This is very simple process just use the following two commands

sudo wget http://mac4deb.googlepages.com/addrepo -O /usr/bin/addrepo

sudo chmod +x /usr/bin/addrepo

Using addrepo

addrepo [repository]

Now you just replace ‘[repository]’ with a repository name

addrepo example

addrepo deb http://dl.google.com/linux/deb/ stable non-free

It already includes ’sudo,’ so adding sudo before you enter the command is not necessary.

Commands Recap

sudo wget http://mac4deb.googlepages.com/addrepo -O /usr/bin/addrepo

sudo chmod +x /usr/bin/addrepo

Debian Tutorials,Howto and Articles

Tags: , , , , , , , , , , , , , , , ,

©2008 Ubuntu Geek. All Rights Reserved.

.

View source post

Error When ugrading to Ubuntu version 7.10

January 26th, 2008


View original post


src=”http://pagead2.googlesyndication.com/pagead/show_ads.js”>

When ever i try to upgrade or update I get this message.

http://security.ubuntu.com/ubuntu/dists/feisty-security/main/binary-i386/Packages.bz2: Sub-process bzip2 returned an error code (2)

Can someone help.

Web hosting

Tags: , , , ,

©2008 Ubuntu Geek. All Rights Reserved.

.

View source post