jueves, 11 de diciembre de 2008

backup restore mysql sugar crm

backup:

mysqldump -u root -ppassw0rd sugarcrm > \
backup/sugarcrm_11-12-2008-01_dump.sql

mysqldump -u root -ppassw0rd sugarcrm > \ backup/sugarcrm_11-12-2008-02_dump.sql

mysqldump -u root -ppassw0rd --all-databases > \ backup/all-database_11-12-2008-01.sql

mysqldump -u root -ppassw0rd --all-databases > \ backup/all-database_11-12-2008-02.sql

Restore:

mysql -u root -peLaStIx.2oo7 sugarcrm < \ backup/sugarcrm_11-12-2008-02_dump.sql

lunes, 8 de diciembre de 2008

Remote Access to Mysql

grant select on *.* to 'root'@192.168.100.54 identified by 'eLaStIx.2oo7';
grant update on *.* to 'root'@192.168.100.54 identified by 'eLaStIx.2oo7';
grant create on *.* to 'root'@192.168.100.54 identified by 'eLaStIx.2oo7';
flush privileges;

viernes, 28 de noviembre de 2008

multi-boot solaris x86

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
# Solaris 32bits
title Solaris 10 10/08 s10x_u6wos_07b X86 32b
findroot (rootfs0,3,a)
kernel /boot/multiboot kernel/unix
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
title Solaris 10 10/08 s10x_u6wos_07b X86 64b
findroot (rootfs0,3,a)
kernel /platform/i86pc/multiboot
module /platform/i86pc/boot_archive
#---------------------END BOOTADM--------------------
#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title Solaris failsafe
findroot (rootfs0,3,a)
kernel /boot/multiboot kernel/unix -s
module /boot/x86.miniroot-safe
#---------------------END BOOTADM--------------------

title Ubuntu 8.10, kernel 2.6.27-7-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic

Procedure to add a swap file

a) Login as the root user

b) Type following command to create 512MB swap file (1024 * 512MB = 524288 block size):
# dd if=/dev/zero of=/swapfile1 bs=1024 count=524288

c) Set up a Linux swap area:
# mkswap /swapfile1

d) Activate /swapfile1 swap space immediately:
# swapon /swapfile1

e) To activate /swapfile1 after Linux system reboot, add entry to /etc/fstab file. Open this file using text editor such as vi:
# vi /etc/fstab

Append following line:
/swapfile1 swap swap defaults 0 0

So next time Linux comes up after reboot, it enables the new swap file for you automatically.

g) How do I verify swap is activated or not?
Simply use free command:
$ free -m

profile solaris 10

PATH=$PATH:/usr/sbin:/opt/csw/bin:/usr/sfw/bin:/usr/ccs/bin:/usr/local/sbin:/usr/local/bin
LIBPATH=$LIBPATH:/opt/csw/lib:/usr/sfw/lib
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$LIBPATH
export PATH LD_LIBRARY_PATH LIBPATH

miércoles, 19 de noviembre de 2008

zone clone

# Bajar la zona que se desea clonar
zlogin CT1NSZSOPVA003 init 0

# Validar que la zona ya esta en shutdown
zoneadm list -cv

# Exportart la configuracion de la zona y salvarla con el nombre de la nueva zona que se desea crear
zonecfg -z CT1NSZSOPVA003 export -f /root/cfg/CT1LOGZSOPVA001.cfg

# Modificar parametros con el zonepath, Direcciones IP y demas que se requieran en la nueva zona.
vi /root/cfg/CT1LOGZSOPVA001.cfg

# Crear la nueva zona apartir de archivo de configuracion modificado.
zonecfg -z CT1LOGZSOPVA001 -f /root/cfg/CT1LOGZSOPVA001.cfg

# Clonar la zona
zoneadm -z CT1LOGZSOPVA001 clone CT1NSZSOPVA003

# Validar que la nueva zona esta en estado "Installed"
zoneadm list -cv

# Hacer boot de la nueva zona
zoneadm -z CT1LOGZSOPVA001 boot

# Validar que la nueva zona esta running
zoneadm list -cv

# Hacer la configuracion Inicial de la zona.
zlogin -C CT1LOGZSOPVA001

martes, 11 de noviembre de 2008

MP3 in Ubuntu

sudo apt-get install audacious

sábado, 8 de noviembre de 2008

File Descriptors

A file descriptor is a handle created by a process when a file is opened. There is a limit to the amount of file descriptors per process. The default Solaris file descriptor limit is 64.

If the file descriptor limit is exceeded for a process, you may see the following errors:

"Too Many Open Files"
"Err#24 EMFILE" (in truss output)

To display a process' current file descriptor limit, run /usr/proc/bin/pfiles pid | grep rlimit on Solaris systems.

Display system file descriptor settings:
ulimit -Hn (hard limit, cannot be exceeded)
ulimit -Sn / ulimit -n (soft limit may be increased to hard limit value)

Increasing file descriptor settings for child processes (example):
$ ulimit -Hn
1024
$ ulimit -Sn
64
$ ulimit -Sn 1024
$ ulimit -Sn
1024

Solaris kernel parameters:
rlim_fd_cur: soft limit

It may be dangerous to set this value higher than 256 due to limitations with the stdio library. If programs require more file descriptors, they should use setrlimit directly.

rlim_fd_max: hard limit

It may be dangerous to set this value higher than 1024 due to limitations with select. If programs require more file descriptors, they should use setrlimit directly.

To count number of open file descriptors:

#!/bin/bash
var=`ps -fea | grep named | grep -v pts | awk '{ print $2 }'`
for i in $var; do
npfiles=`/usr/proc/bin/pfiles -n $i | tail +3 | wc -l` ;
echo "Number of Open File Descriptors per named Process: PID=$i : Num OPFD=$npfiles";
done


http://www.princeton.edu/%7Eunix/Solaris/troubleshoot/filedesc.html



SOLUTION: Using FD_SETSIZE to allow application to use more than 1024 file descriptors

The application core dumped after attempting to access more file descriptors than allowed by the 32-bit library.

From the manpage for select(3C) :

"The default value for FD_SETSIZE (currently 1024) is larger than the default limit on the number of open files. To accommodate 32-bit applications that wish to use a larger number of open files with select(), it is possible to increase this size at compile time by providing a larger definition of FD_SETSIZE before the inclusion of.

The maximum supported size for FD_SETSIZE is 65536. The default value is already 65536 for 64-bit applications."

And from /usr/include/sys/select.h :

#ifndef FD_SETSIZE
#ifdef _LP64
#define FD_SETSIZE 65536
#else
#define FD_SETSIZE 1024
#endif /* _LP64 */
#elif FD_SETSIZE > 1024 && !defined(_LP64)
#ifdef __PRAGMA_REDEFINE_EXTNAME
#pragma redefine_extname select select_large_fdset
#else /* __PRAGMA_REDEFINE_EXTNAME */
#define select select_large_fdset
#endif /* __PRAGMA_REDEFINE_EXTNAME */
#endif /* FD_SETSIZE */

On Solaris[TM] 7, 8, 9, and 10 one can over come the 1024 32-bit library file descriptors limit by redefining the maximum allowed library limit and recompiling the source code with the following lines added.

        #define FD_SETSIZE 65535
#include

The FD_SETSIZE is the library file descriptor limit. After adjusting the library limit, it is necessary to adjust the system limit of file descriptors. This can be done by adding the following lines to the etc/system file and then rebooting.

        set rlim_fd_cur 1024
set rlim_fd_max 65535

To adjust the current soft limit of allowable system file descriptors above 1024 for an application without adjusting the system soft limit, one should use the "ulimit -n [limit]" or "limit descriptors [limit]" commands before starting applications that require more than 1024 file descriptors.

The value can not exceed the maximum in the table below.

default soft limit | default hard limit | max for stdio | max for select()

Solaris[TM] 2.4-2.6 64 1024 256 1024

Solaris[TM] 7 (32-bit) 64 1024 256 65535 (with recompile)

Solaris[TM] 7 (64-bit) 64 1024 256 65535

Solaris[TM] 8 (32-bit) 256 1024 256 65535 (with recompile)

Solaris[TM] 8 (64-bit) 256 1024 256 65535

Solaris[TM] 9 (32-bit) 256 65535 256 65535 (with recompile)

Solaris[TM] 9 (64-bit) 256 65535 256 65535

Solaris[TM] 10 (32-bit) 256 65535 256 65535 (with recompile)

Solaris[TM] 10 (64-bit) 256 65535 256 65535

Please note that for applications that use the Berkeley stdio.h interface (i.e. fopen/fclose/fread/fwrite, etc), the maximum number of open file descriptors per process is 256.

With the exception of databases and WebServers, most applications never need more than 256 open file descriptors. Also starting with Solaris[TM] 7, the plimit(1) command can be used to adjust the soft and hard limits of a running process.

plimit -n ,

The poll() system call has the number of file descriptors being polled passed in as an argument, so it has none of the above limitations.

File Descriptors

A file descriptor is a handle created by a process when a file is opened. There is a limit to the amount of file descriptors per process. The default Solaris file descriptor limit is 64.

If the file descriptor limit is exceeded for a process, you may see the following errors:

"Too Many Open Files"
"Err#24 EMFILE" (in truss output)

To display a process' current file descriptor limit, run /usr/proc/bin/pfiles pid | grep rlimit on Solaris systems.

Display system file descriptor settings:
ulimit -Hn (hard limit, cannot be exceeded)
ulimit -Sn / ulimit -n (soft limit may be increased to hard limit value)

Increasing file descriptor settings for child processes (example):
$ ulimit -Hn
1024
$ ulimit -Sn
64
$ ulimit -Sn 1024
$ ulimit -Sn
1024

Solaris kernel parameters:
rlim_fd_cur: soft limit

It may be dangerous to set this value higher than 256 due to limitations with the stdio library. If programs require more file descriptors, they should use setrlimit directly.

rlim_fd_max: hard limit

It may be dangerous to set this value higher than 1024 due to limitations with select. If programs require more file descriptors, they should use setrlimit directly.

http://www.princeton.edu/%7Eunix/Solaris/troubleshoot/filedesc.html

miércoles, 29 de octubre de 2008

Enable Relay MTA JES

Para habilitar el relay en JES hacer:

Editar el archivo:
vi /jes/bin/SUNWmsgsr/config/mappings

Buscar en "INTERNAL_IP".

$(200.21.190.164/24) $Y
$(190.254.0.106/32) $Y
$(190.254.0.117/32) $Y
$(190.254.0.109/32) $Y
$(10.192.32.6/32) $Y
$(10.192.32.4/32) $Y
127.0.0.1 $Y
* $N

Luego reiniciar el demonio:

cd /jes/bin/SUNWmsgr/sbin
./stop-msg mta ; ./start-msg mta

sábado, 25 de octubre de 2008

IPS OpenSolaris

marco@pegasus:~$ pfexec pkg set-authority -O http://pkg.sunfreeware.com:9000 sunfreeware

marco@pegasus:~$ pfexec pkg set-authority -O http://blastwave.network.com:10000 blastwave

marco@pegasus:~$ pfexec pkg authority -H
blastwave http://blastwave.network.com:10000/
sunfreeware http://pkg.sunfreeware.com:9000/
opensolaris.org (preferred) http://pkg.opensolaris.org:80/


marco@pegasus:~$

lunes, 13 de octubre de 2008

tftp solaris 10

Validar si esta el servicio creado:

svcs | grep tf

# Crear el servicio.

vi /var/tmp/tftpd.conf

# Adicionar la siguente linea:

tftp dgram udp6 wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

mkdir /tftpboot
chown root /tftpboot
chmod 755 /tftpboot

Validar que el puerto este definido para el tftp:

grep tf /etc/services

Importar el Servicio.

/usr/sbin/inetconv -i /var/tmp/tftpd.conf

# Validar que el servicio este online:

svcs -a |grep tftp

sábado, 11 de octubre de 2008

zonecfg

create
set zonepath=/zonas/testing
set autoboot=true

add net
set address=172.28.46.1/24
set physical=e1000g0
end

add fs
set dir=/mnt
set special=/dev/dsk/c0t0d0s7
set raw=/dev/rdsk/c0t0d0s2
set type=ufs
add options [logging]
end

add inherit-pkg-dir
set dir=/usr/sfw
end

add device
set match=/dev/sound/*
end

add attr
set name=comment
set type=string
set value="The work zone."
end

remove inherit-pkg-dir dir=/lib
remove inherit-pkg-dir dir=/platform
remove inherit-pkg-dir dir=/sbin
remove inherit-pkg-dir dir=/usr

verify
commit

ipmp solaris 10 8/07

ifconfig ce0 plumb
ifconfig ce1 plumb


ifconfig ce0 10.57.1.61 netmask 255.255.0.0 broadcast + group service0 up
ifconfig ce1 deprecated group service0 -failover standby up

*****/etc/hostname.ce0******
pegasus netmask 255.255.0.0 broadcast + group service0 up

*****/etc/hostname.ce1******
deprecated group service0 -failover standby up

jueves, 17 de julio de 2008

vi editor

EDITOR VI

ENTRADA AL EDITOR

$ vi Edita un fichero sin nombre.
$ vi NOMNUEVO Edita un fichero nuevo con nombre.
$ vi NOMVIEJO Edita un fichero ya existente.
$ vi nom1 nom2 Edita varios ficheros simultáneamente.
$ vi +n nomviejo Hará que n sea la línea actual cuando se edite el fichero.
$ vi +$ nomviejo Coloca el cursor al final del fichero.
$ vi +orden fich Hace que se ejecute la orden del editor antes de visualizar el fichero.
$vi +/palabra fich Situa el cursor, al editar “fich”, en la primera ocurrencia de la palabra
especificada del fichero.

ALMACENAR, MOVERSE Y ABANDONAR EL EDITOR

:w Salva el contenido del texto visualizado en pantalla.
:w nomfich Almacena el texto editado en un archivo con el nombre indicado.
:w>>nomfich Añade el texto editado al archivo ya existente especificado.
:q Salida del fichero editado. Requiere haber salvado previamente con :w las
modificaciones realizadas.
:q! Sale de la edición sin salvar el fichero editado.
:wq Salva el fichero editado y luego sale de VI.
ZZ Hace lo mismo que :wq.
:n Visualiza el siguiente fichero de la cola.
:r nomfich Añade el contenido de un fichero (nomfich) al texto editado, a partir de la
posición del cursor.
:rewind Visualiza el primer fichero de los editados.

MOVIMIENTOS DEL CURSOR

nh Mueve el cursor n caracteres hacia la izda.
n ^h Mueve el cursor n caracteres hacia la izda.
nl Mueve el cursor n caracteres hacia la dcha.
n Mueve el cursor n caracteres hacia la dcha.
nW Mueve el cursor n palabras hacia la dcha. y lo sitúa en el primer caracter
de la palabra (teniendo en cuenta que una palabra será una serie de
caracteres hasta un espacio en blanco).
nB Mueve el cursor n palabras hacia la izda. y lo sitúa en el primer caracter de
la palabra.
n Mueve el cursor n líneas hacia abajo y lo sitúa al comienzo de la línea.
nj Mueve el cursor n líneas hacia abajo y lo deja en la misma columna.
nk Mueve el cursor n líneas hacia arriba y lo deja en la misma columna.
G Mueve el cursor hasta el primer caracter de la última línea del fichero.
nG Mueve el cursor hasta el primer caracter de la enésima línea del fichero.
$ Mueve el cursor al último caracter de la línea actual.
n$ Mueve el cursor hasta el último caracter de la enésima línea del fichero.
0 Mueve el cursor al primer caracter de la línea.
H Mueve el cursor al principio de la pantalla.
L Mueve el cursor al final de la pantalla.
M Mueve el cursor hasta la mitad de la pantalla.
^f Hace subir la pantalla (scroll down) (PAGE UP).

MOVIMIENTOS DEL CURSOR

^b Hace bajar la pantalla (scroll up) (PAGE DOWN).
:nº Situa el cursor en la línea indicada.
:+nº Avanza el cursor n líneas hacia abajo a partir de la posición del cursor.
:-nº Retrocede el cursor n líneas hacia arriba desde la posición actual del
cursor.

BORRAR TEXTO

nx Borra n caracteres a partir de la posición actual del cursor.
ndW Borra n palabras de la derecha del cursor.
ndB Borra n palabras de la izquierda del cursor.
nS Borra el contenido de n líneas a partir del cursor.
n dd Borra n líneas enteras a partir de donde está el cursor.
D Borra el resto de la línea a partir de la posición del cursor.

AÑADIR TEXTO

a Añade texto después del cursor.
i Inserta texto antes del cursor.
A Añade texto al final de la actual línea.
I Inserta texto al principio de la actual línea.
o Abre una línea a continuación para insertar texto.
O Abre una línea encima de la actual para insertar texto.

COPIAR Y MOVER TEXTO

n r car Cambia los n primeros caracteres a partir del cursor por el caracter
especificado.
r Permite reemplazar el caracter actual por otro que se teclee.
R Permite entrar en modo sustitución de caracteres,permaneciendo sin variar
los caracteres de la línea que no se hayan sobreescrito.
C Lo mismo que el anterior, pero aquellos caracteres de la línea que no se
hayan sobreescrito se borrarán (el resto de la línea no cambiado se borra).
J Junta la línea actual con la siguiente eliminando el que las separa.
nY Almacena temporalmente en un espacio de memoria (buffer) n líneas
desde la posición actual del cursor.
P Inserta las líneas sacadas con Y, a partir de la línea actual.

RESTAURAR Y REPETIR CAMBIOS

. Repite el último cambio realizado.
u Restaura el último cambio realizado.

OPCIONES DE ENTORNO

: set nu Visualiza en la pantalla los números de líneas.
: set nonu Elimina de la pantalla los números de líneas.
: set list Hace que se visualicen los caracteres de control (tabuladores, retornos de
carro, etc.)
: set nolist Elimina la opción anterior.
: set wm=n Establece el retorno automático de línea en la columna 80-n. (Para ponerlo
en la 50 habría que poner n=30).
: set wm=0 Elimina el retorno de línea automático.

BUSQUEDA, SUSTITUCION Y ELIMINACION

:/argumento/ Busca, a partir de la siguiente línea a la actual, la primera ocurrencia del
argumento, y se situa el cursor al comienzo de la línea donde se encuentre
el argumento.
:/^argumento/ Busca la ocurrencia en el principio de las líneas.
:/argumento$/ Busca la ocurrencia al final de las líneas.
:g/arg/d Elimina todas las líneas que contienen el argumento.
:g/^$/d Elimina todas las líneas vacías.
:s/textant/textnue/ Sustituye el texto antiguo por el texto nuevo.
:g/textant/s//textnue/g Sustituye todas las ocurrencias de textoant por textonuevo.
:g/textant/s//textnue/gc Hace lo mismo que el anterior pero pidiendo confirmación. Se ha de
contestar y, en caso contrario no se sustituye.
:g/argumento/s/texto//g Borra el texto en todas las líneas que contengan el argumento. Si no se
pone texto se borra la línea completa.

ESCAPAR AL SHELL DESDE EL EDITOR

:! orden Abandona el vi momentáneamente para ejecutar la orden. Para volver al
editor basta teclear .
:sh Ejecuta un shell nuevo apartando el vi. Se vuelve con exit o <^d>.
:r !orden Lleva la salida standard de la orden al fichero.

viernes, 11 de julio de 2008

how to use find

find . -type f -exec grep -i ADMINPASS {} \;

lunes, 23 de junio de 2008

Auth Java Netbackup


The following is a correct example of the auth.conf file.

root ADMIN=ALL JBP=ALL
user1 ADMIN=ALL JBP=ALL
user2 ADMIN=JBP+BPM+DM+MM+REP+AM JBP=ALL
user3 ADMIN=ALL JBP=ALL
user4 ADMIN=JBP+AM JBP=ALL
user5 ADMIN=JBP+REP+AM JBP=ALL
* ADMIN=JBP JBP=ENDUSER+BU+ARC

BPM = Police Management
JBP =
DM = Device Management
AM = Admin Monitor

sábado, 14 de junio de 2008

How to configure NIC in LINUX

To configure a static IP (an IP that will never change) in debian you must edit the file
/etc/networking/interfaces and put the following:

CODE

# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0


iface eth0 inet static
address 192.168.1.10
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1


The last section is the most important, the top may or may not be the same so don't play with it unless you get an error. In this case the IP of the server is 192.168.1.10 so if you run it as a DNS server for example, you can set that in your router's config and not worry about it changing.

To apply this configuration type /etc/init.d/networking restart

You'll get a message that it's restarting the network interface, then you'll get booted off ssh (because the IP changed) so reconnect using the new IP and it should work.

In red hat this file is /etc/sysconfig/network-scripts/ifcfg-eth0 and you would put this in it:

CODE

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=192.168.1.10
NETMASK=255.255.255.0
GATEWAY=192.168.1.1

To apply this configuration type /etc/init.d/network restart

How to configure NIC in Solaris 10

1. Loging as root.

root@agendacon # id
uid=0(root) gid=0(root)

2. Enable NIC with it's drivers:

root@agendacon # ifconfig -a plumb

3. View which interfaces are available

root@agendacon # ifconfig -a


lo0: flags=2001000849 mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
bge0: flags=1000843 mtu 1500 index 2
inet 172.28.255.240 netmask fffffc00 broadcast 172.28.255.255
groupname ipmp1
ether 0:3:ba:9b:ab:e9
bge0:1: flags=9040843 mtu 1500 index 2
inet 172.28.255.238 netmask fffffc00 broadcast 172.28.255.255
bge1: flags=19040803 mtu 1500 index 3
inet 172.28.255.239 netmask fffffc00 broadcast 172.28.255.255
groupname ipmp1
ether 0:3:ba:9b:ab:ea
bge2: flags=1000802 mtu 1500 index 5
inet 0.0.0.0 netmask 0
ether 0:3:ba:9b:ab:eb
bge3: flags=1000802 mtu 1500 index 6
inet 0.0.0.0 netmask 0
ether 0:3:ba:9b:ab:ec



4. Identify the interface you want to configure:


root@agendacon # ifconfig bge3

bge3: flags=1000802 mtu 1500 index 6
inet 0.0.0.0 netmask 0
ether 0:3:ba:9b:ab:ec


5. Configure IP Address and Default gateway:

root@agendacon # ifconfig bge3 192.168.100.200 netmask 255.255.255.0 up
root@agendacon # ifconfig bge3
bge3: flags=1000803 mtu 1500 index 6
inet 192.168.100.200 netmask ffffff00 broadcast 192.168.100.255
ether 0:3:ba:9b:ab:ec

root@agendacon # route add default 192.168.100.254
add net default: gateway 192.168.100.254

root@agendacon # netstat -nr

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ------ ---------
192.168.100.0 192.168.100.200 U 1 0 bge3
default 192.168.100.254 UG 1 0
127.0.0.1 127.0.0.1 UH 2 36 lo0
root@agendacon #

6. To delete old default router:

root@agendacon # route delete default 192.168.100.1
delete net default: gateway 192.168.100.1

7. Make permanent the previous changes.

# vi /etc/hosts
127.0.0.1 localhost
192.168.100.200 myhostname
:wq! (save and quit)

# vi /etc/inet/hosts
127.0.0.1 localhost
192.168.100.200 myhostname
:wq! (save and quit)

# vi /etc/hostname.bge3
myhostname
:wq! (save and quit)

# vi /etc/netmasks
192.168.100.0 255.255.255.xxx
:wq! (save and quit)

# vi /etc/defaultrouter
192.168.100.254
:wq! (save and quit)

sábado, 31 de mayo de 2008

How to configure Cisco VPN in LINUX

Install in debian

apt-get install network-manager-vpnc vpnc

Configure

vi /etc/vpnc/config.conf

IPSec gateway x.x.x.x
IPSec ID tun_remote_vpn
IPSec obfuscated secret
Xauth username marco

It's very Important the attr "IPSec obfuscated secret" is group password in cisco profile "enc_GroupPwd"


# Conectar
marco@alcatraz:~$ sudo vpnc-connect config
[sudo] password for marco:
Enter password for marco@10.201.136.32:
VPNC started in background (pid: 9034)...

# Desconectar
marco@alcatraz:~$ sudo vpnc-disconnect
Terminating vpnc daemon (pid: 9034)

jueves, 15 de mayo de 2008

ufsdump

This Tech Tip describes a backup and restore procedure for the Solaris 8 or 9 Operating System using the ufsdump command.

Backing Up the OS

1. For this example, we are using c0t0d0s0 as a root partition. Bring the system into single-user mode (recommended).

# init -s

2. Check the partition consistency.

# fsck -m /dev/rdsk/c0t0d0s0

3. Verify the tape device status:

# mt status

Or use this command when you want to specify the raw tape device, where x is the interface:

# mt -f /dev/rmt/x status
4. Back up the system:

a) When the tape drive is attached to your local system, use this:

# ufsdump 0uf /dev/rmt/0n /

b) When you want to back up from disk to disk, for example, if you want to back up c0t0d0s0 to c0t1d0s0:

# mkdir /tmp/backup
# mount /dev/dsk/c0t1d0s0 /tmp/backup
# ufsdump 0f - / | (cd /tmp/backup;ufsrestore xvf -)

c) When you want to back up to a remote tape, use this. On a system that has a tape drive, add the following line to its /.rhosts file:

hostname root

where hostname is the name or IP of the system that will run ufsdump to perform the backup. Then run the following command:

# ufsdump 0uf remote_hostname:/dev/rmt/0n /

Restoring the OS

1. For this example, your OS disk is totally corrupted and replaced with a new disk. Go to the ok prompt and boot in single-user mode from the Solaris CD.

ok> boot cdrom -s

2. Partition your new disk in the same way as your original disk.

3. Format all slices using the newfs command. For example:

# newfs /dev/rdsk/c0t0d0s0

4. Make a new directory in /tmp:

# mkdir /tmp/slice0

5. Mount c0t0d0s0 into /tmp/slice0:

# mount /dev/dsk/c0t0d0s0 /tmp/slice0

6. Verify the status of the tape drive:

# mt status

If the tape drive is not detected, issue the following command:

# devfsadm -c tape

or

# drvconfig
# tapes
# devlinks

Verify the status of tape drive again and make sure the backup tape is in the first block or file number is zero. Use the following command to rewind the backup tape:

# mt rewind

7. Go into the /tmp/slice0 directory and you can start restoring the OS.

# cd /tmp/slice0
# ufsrestore rvf /dev/rmt/0n

If you want to restore from another disk (such as c0t1d0s0), use the following command:

# mkdir /tmp/backup
# mount /dev/dsk/c0t1d0s0 /tmp/backup
# ufsdump 0f - /tmp/backup | (cd /tmp/slice0;ufsrestore xvf -)

8. After restoring all the partitions successfully, install bootblock to make the disk bootable. This example assumes your /usr is located inside the "/" partition:

# cd /tmp/slice0/usr/platform/'uname -m'/lib/fs/ufs
# installboot bootblk /dev/rdsk/c0t0d0s0

9. To finish restoring your OS, reboot the system.

martes, 13 de mayo de 2008

import mpxi solaris 10

svccfg import /var/svc/manifest/platform/sun4u/mpxio-upgrade.xml

martes, 6 de mayo de 2008

Register_Trixbox

[trixbox1.localdomain ~]# more /var/www/html/maint/includes/functions/captureSoapIPURLList.php


[trixbox1.localdomain ~]# /etc/init.d/httpd restart

jueves, 24 de abril de 2008

cp with tar

cd /u01
tar cfvE - .| (cd /u01_new; tar xfBp -)
cd /oradatos
tar cfvE - .| (cd /oradatos_new; tar xfBp -)
cd /oraindices
tar cfvE - .| (cd /oraindices_new; tar xfBp -)

sun_md

# How to configure Meta Devices in solaris 10.
1. Crear la base de estados.
metadb -a -f -c 1 c0t0d0s5 c1t0d0s1

2. Configurar el RAID-0 o 1.

RAID-O: Concatenado o Striped
Concatenad:
metainit -f d0 2 1 c0t0d0s7 1 c3t0d0s0
Checking:
metastat
ls -lL /dev/md/dsk
ls -lL /dev/md/rdsk
df -k /export/home
umount /export/home

Edit "/etc/vfstab" and change device by metadevice.
mount /export/home
df -k /export/home

# Crecer un softpartition:
metattach d0 100gb
growfs -M /export/home /dev/md/rdsk/d0
df -k /export/home

Configurar RAID-1(/): Los dos slice deben ser de igual tamaño
1. metainit -f d11 1 1 c0t0d0s0
2. metainit d12 1 1 c3t3d0s1
3. metainit d10 -m d11
4. metaroot d10
# grep md /etc/vfstab
# tail /etc/system
5. init 6
# df -k
# metastat
6. metattach d10 d12
# metastat d10
7. ls -l /dev/dsk/c3t2d0s1
init 0
OK show-disks
OK nvalias mirror-disk .....
OK nvalis root-disk
OK devalias root-disk
OK devalias mirror-disk
OK printenv boot-device
OK setenv boot-device disk mirror-disk net
OK boot mirror-disk


Eliminar un Mirror(/)
1. metastat d10 # Verificar la consitencia del mirror.
2. metadetach d10 d12
3. metaroot /dev/dsk/c0t0d0s0
grep c0t0d0s0 /etc/vfstab
4. init 6
5. metaclear -r d10
metaclear d12
6. init 0
OK setenv boot-device disk net
OK boot

How to create Logical SVM

root@sdigbogsisg001 # metastat -p d100
d100 1 1 /dev/dsk/c4t600A0B800029E4F20000081946B0C201d0s0
root@sdigbogsisg001 # metastat -p d101
d101 -p d100 -o 32800 -b 262144000
d100 1 1 /dev/dsk/c4t600A0B800029E4F20000081946B0C201d0s0

How to resync one mirror that Need maintenance:

metastat -a | more

d3: Mirror
Submirror 0: d13
State: Okay
Submirror 1: d23
State: Needs maintenance
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 18876480 blocks (9.0 GB)

d13: Submirror of d3
State: Okay
Size: 18876480 blocks (9.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s3 0 No Okay Yes


d23: Submirror of d3
State: Needs maintenance
Invoke: metareplace d3 c0t1d0s3
Size: 18876480 blocks (9.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s3 0 No Maintenance Yes


metareplace -e d3 c0t1d0s3

metastat -a | more

d3: Mirror
Submirror 0: d13
State: Okay
Submirror 1: d23
State: Resyncing
Resync in progress: 0 % done
Pass: 1
Read option: roundrobin (default)
Write option: parallel (default)
Size: 18876480 blocks (9.0 GB)

d13: Submirror of d3
State: Okay
Size: 18876480 blocks (9.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t0d0s3 0 No Okay Yes


d23: Submirror of d3
State: Resyncing
Size: 18876480 blocks (9.0 GB)
Stripe 0:
Device Start Block Dbase State Reloc Hot Spare
c0t1d0s3 0 No Resyncing Yes

martes, 15 de abril de 2008

LVM

# Enable LVM in disk
pvcreate /dev/sdb

# Create Volume Group
vgcreate storage0 /dev/sdb

# Active Volume Group
vgchange -a y storage0

# Create Logical Volume
lvcreate -l 2047 storage0 -n opt0

# Extend Volume Group
vgextend storage0 /dev/sdb2

# Check Volume Group
vgdisplay

# Extend Logical Volume
lvextend -L+1G /dev/storage0/opt

sábado, 5 de abril de 2008

Configure RSC SUN SPARC

Install:

To OS SOL 9 y 10.

- Enterprise 250
- Sun Fire 280R
- Sun Fire V880
- Sun Fire V480
- Sun Fire V890
- Sun Fire V490

You should install the base Solaris packages and the localization
packages for any locales supported on your system. For your reference,
the packages are:

Download: Click here

SUNWrsc - the RSC base package for installation on the host machine
SUNWrscd - the RSC documentation package
SUNWrscj - the RSC GUI package to be installed on any system wanting
to display the RSC GUI


Procedure:

To unpack for Solaris 9 & Solaris 10:
mkdir /tmp/RSC
unzip -d /tmp/RSC rsc2.2.3_packages_s9.zip
cd /tmp/RSC
pkgadd -d SUNWrsc
pkgadd -d SUNWrscd
pkgadd -d SUNWrscj

Running the rsc-config Script on the Server
On the server systems only, type the following command to configure the new firmware image:

# /usr/platform/`uname -i`/rsc/rsc-config

lunes, 24 de marzo de 2008

OpenVPN en Solaris 11 x86

Como Instalar OpenVPN en OpenSolaris x86 b79 32/64 bits
Este es el proceso empleado para instalar openvpn en
Solaris 11.

Primero debemos instalar las dependencias:

gcc
binutils
gnupg
libgcrypt
libiconv

Estas dependencias se deben Instalar con OpenSolaris Corriendo 64bits,
y utilizando el Package Manager de OpenSolaris, luego de Instalar modificar el grub para
hacer boot con 32bits:

#---------- ADDED BY BOOTADM - DO NOT EDIT ----------
title OpenSolaris 2008.11 snv_101b_rc2 X86 32bits
findroot (pool_rpool,3,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/boot_archive

title OpenSolaris 2008.11 snv_101b_rc2 X86 64bits
findroot (pool_rpool,3,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive

title Ubuntu 8.10, kernel 2.6.27-7-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
#---------------------END BOOTADM--------------------

Luego hacer un Reboot.

$> sync; reboot

Descargar las fuentes de tun/tap y openvpn y algunos
comandos de tun para verificación.
http://vtun.sourceforge.net/tun/tun-1.1.tar.gz
http://openvpn.net/index.php/downloads.html
http://www.whiteboard.ne.jp/~admin2/tuntap/
source/tunctl/tunctl.tar.gz

Compilar e instalar tuntap.
# gzcat tun-1.1.tar.gz | tar xvf –
# cd tun-1.1
 
Adicionar al archivo “Solaris/Makefile” en parámetro
“-m64” en la variable CFLAGS, quedando de la siguiente forma:
 
  CFLAGS = $(DEFS) -m64 -O2 -Wall -D_KERNEL -I.
 
Configurar y Compilar:

# ./configure
# make 
 
Probar el make install, si obtiene algun error como este:
   /usr/sbin/rem_drv tun >/dev/null 2>&1
   /usr/sbin/rem_drv tap >/dev/null 2>&1
   *** Error code 1 (ignored)
   /usr/sbin/add_drv tun   
   /usr/sbin/add_drv tap
 
Hacer la instalacion manual:

# cd solaris
# cp tun /kernel/drv
# cp tun.conf /kernel/drv
 
Configurar tun.
# devfsadm –i tun

Verificar el funcionamiento de tun.

Ejemplo)

Crear la interfaz tap0
   # /usr/local/bin/tunctl -t tap0
   Set 'tap0' persistent
   #
Borrar la interfaz tap0 
   # /usr/local/bin/tunctl -d tap0
   #
Instalar LZO para compresion en Tiempo Real:

# wget http://www.oberhumer.com/opensource/lzo/download/lzo-2.03.tar.gz

# gzcat lzo-2.03.tar.gz | tar xvf lzo-2.03.tar.gz

# gzcat lzo-2.03.tar.gz | tar xvf -

# cd lzo-2.03

# ./configure

# make

# make install



Instalar OpenVPN.

wget http://openvpn.net/release/openvpn-2.0.9.tar.gz
# gzcat openvpn-2.0.9.tar.gz | tar xvf –
# cd openvpn-2.0.9
##### ./configure --disable-lzo  # Para deshabilitar compresion de lzo
# ./configure --with-lzo-lib=/usr/local/lib

# make
# make install
 
Ahora podemos dar un reboot al servidor y verificar
que el tun sube correctamente.
[00:12:38][root@alcatraz /]$sync; reboot 
[00:12:38][root@alcatraz /]$ dmesg | grep -i tun
Mar 24 00:09:47 alcatraz tun: [ID 654686 kern.notice] Universal TUN/TAP device driver ver 1.1 03/23/2008 (C) 1999-2000 Maxim Krasnyansky
Mar 24 00:09:47 alcatraz pseudo: [ID 129642 kern.info] pseudo-device: tun0
Mar 24 00:09:47 alcatraz genunix: [ID 936769 kern.info] tun0 is /pseudo/tun@0
Mar 24 00:09:48 alcatraz tap: [ID 654686 kern.notice] Universal TUN/TAP device driver ver 1.1 03/23/2008 (C) 1999-2000 Maxim Krasnyansky
[00:13:01][root@alcatraz /]$

Crear un archivo de configuración similar a:
 
client
dev tun
proto udp
remote x.x.x.x 1194
resolv-retry infinite
nobind
# Las dos siguientes opciones no van en windows
user nobody
group nobody
 
persist-key
persist-tun
ca ca.crt
cert marco.crt
key marco.key
# comp-lzo
verb 4
 
 
Tener encuenta que esta configuración utiliza certificados digitales,
para lo cual debes haberlos creado con anterioridad.
Y finalmente un script de inicio rapido:
 
# vi /etc/init.d/vpn
Y adicionar acorde donde tengas alojados los certificados digitales.
nohup openvpn --config /export/home/marco/.openvpn/marco.conf &

domingo, 9 de marzo de 2008

Solaris ZFS

1. Crear un pool zfs:

zpool create -f storage0 c2t600A0B800011EF78000057824630B63Fd0s2

2. Chequear que el pool sea creado correctamente:

zpool list

3. Crear dos file system:

zfs create storage0/OraIndices
zfs create storage0/OraDatos

4. Verificar que los file system estan creados y montados correctamente.

zfs list

5. Cambiar los puntos de montura acorde a la necesidades.

zfs set mountpoint=/OraDatos storage0/OraDatos
zfs set mountpoint=/OraIndices storage0/OraIndices

6. Fijar un tamaño al file system.

zfs set quota=20g /OraDatos
zfs set quota=50g /OraDatos

7. Validar el performance:

zpool iostat -v

sábado, 16 de febrero de 2008

how to install virtualbox in ubuntu 7.10

how to install virtualbox in ubuntu 7.10

First you need to install the following packages

sudo apt-get install libxalan110 libxerces27

wget http://www.virtualbox.org/download/1.5.4/virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

Once you download the package you have virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb file

Install.deb file using the following command

sudo dpkg -i virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb

At the time of installation if you have any dependency problems like the following errors

Selecting previously deselected package virtualbox.
(Reading database … 174459 files and directories currently installed.)
Unpacking virtualbox (from virtualbox_1.5.4-27034_Ubuntu_gutsy_i386.deb) …
dpkg: dependency problems prevent configuration of virtualbox:
virtualbox depends on libxalan110; however:
Package libxalan110 is not installed.
virtualbox depends on libxerces27; however:
Package libxerces27 is not installed.
dpkg: error processing virtualbox (–install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
virtualbox

If you see the above error message you can use the following command to install all the required dependencies

sudo apt-get -f install

This will complete the installation

Starting the VirtualBox Graphical User Interface

If you want to start Virtualbox GUI use the following command from your terminal(Applications—>Accessories— >Termianl)

VirtualBox

Once it opens you should see the following screen

sábado, 9 de febrero de 2008

How to mount iso in solaris 10


a. Create an installation image from the mounted ISO image:

unzip compressed-file.zip
lofiadm -a pathname/image.iso /dev/lofi/1
If /dev/lofi/1 is already in use, refer to the lofiadm (1M) man page.

mkdir mountpoint
mount -F hsfs /dev/lofi/1 mountpoint
cd mountpoint
find . -print | cpio -pdum shared-location/comms5

b. After copying is done, unmount the ISO image:

cd
umount mountpoint
lofiadm -d /dev/lofi/l

domingo, 27 de enero de 2008

xVM Solaris 11

Intruducion.
"Network is of Computers", si guiendo este lema debemos dar gran importacia a los avances que tenemos en tecnologia de OS. En este articulo vamos a trabar sobre xVM, siendo esta la plataforma de virtualizacion adopdatada por SUN Microsystem, la cual esta siendo integrada con el producto estrella de de SUN o la "Joya de la corona", Solaris 10. Ustedes se preguntaran porque sobre solaris y no sobre LINUX, siendo que en xVM el core es "XEN Opensource"?, principalmente por que el respaldo de SUN lo potencializa en el mercado Enterprise.