Acerca de Linux, BSD y notas personales

Archives for CentOS category

Xen 3.0.2 Setup

http://wiki.mitopia.net/Xen_3.0.2_Setup

First make disk images from your CD(s):

dd if=/dev/cdrom of=/iso/win2k3_1.iso bs=2048
dd if=/dev/cdrom of=/iso/win2k3_1.iso bs=2048

Then edit your config file:

disk = [ ‘file:/vm/win2k3.img,hda,w’, ‘file:/iso/win2k3_1.iso,ioemu:hdb:cdrom,r’, ‘file:/iso/win2k3_2.iso,ioemu:hdc:cdrom,r’, ]


name = "vm_windows2003"
uuid = "0bd2c8f1-4555-c192-c481-400fa7f6a18b"
maxmem = 1024
memory = 1024
vcpus = 1
builder = "hvm"
kernel = "/usr/lib/xen/boot/hvmloader"
boot = "d"
pae = 1
acpi = 1
apic = 1
on_poweroff = "destroy"
on_reboot = "restart"
on_crash = "restart"
device_model = "/usr/lib64/xen/bin/qemu-dm"
sdl = 0
vnc = 1
vncunused = 1
disk = [ "file:/vmhd/vm_windows2003/vm_windows2003.img,hda,w","file:/vmhd/cd1.iso,ioemu:hdc:cdrom,r" ]
vif = [ "mac=00:16:3e:06:e5:6a,bridge=virbr0,type=ioemu" ]
serial = “pty”

Joomla autopublish

Autopublicación

Cambiar $row->state = 0; a

$row->state =1; en todo el código

My apologies, I missed out part of the hack to get news auto-published.

If you can, please take Dave’s advice and use mycontent or ja_submit.
Once you hack core code you have to repeat your work every time there is a new release.

However, if you must, here it is:

For Joomla! 1.0.11:
content.php
comment out line 1822 $row->state = 0;
comment out line 1996 $row->state = 0;

database
change JOS_CONTENT.STATE default value to 1

Or if you prefer, instead of commenting out the above lines of code, just change 0 to 1 and leave the database unchanged.

For the item to display on the frontpage:
content.php
change line 1829 $row->frontpage = 0; to $row->frontpage = 1;

// Publishing state hardening CArlos Padron .. Hack
// Publishing state hardening for Authors
if ( !$access->canPublish ) {
if ( $isNew ) {
// For new items - author is not allowed to publish - prevent them from doing so
// $row->state = 0;
} else {
// For existing items keep existing state - author is not allowed to change status
$query = “SELECT state”
. “\n FROM #__content”
. “\n WHERE id = ” . (int) $row->id
;
$database->setQuery( $query);
$state = $database->loadResult();

if ( $state ) {
$row->state = 1;
} else {
//    $row->state = 0;
}
}
}

link

compaq

Author Subject: Linux won’t boot! dc5700 and several distros Add to my favorites This thread has been closed

boot: linux pci=nommconf

Sun Java JRE

Homepage: http://java.sun.com/

Sun’s JAVA JRE adds full Java support to your system.

If you want to use Sun’s JAVA, open http://java.sun.com/javase/downloads/index.jsp within firefox and download the Linux self-extracting file - NOT the Linux RPM in self-extracting file.

The following steps require root privileges. Please note that you have to edit the following commands if your Java version is newer than the one I downloaded.

mv /home/%your_username%/Desktop/jre-6u3-linux-i586.bin /opt/
cd /opt/
chmod +x jre-6u3-linux-i586.bin
./jre-6u3-linux-i586.bin

Accept the license agreement and proceed.

rm -f jre-6u3-linux-i586.bin
ln -s /opt/jre1.6.0_03/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/

gedit /etc/profile.d/java.sh

It should look like this:

export J2RE_HOME=/opt/jre1.6.0_03
export PATH=$J2RE_HOME/bin:$PATH

grub centos

http://forums.theplanet.com/index.php?showtopic=57473

resize the virtual disk image?

Solution: 

This solution is to increase your virtual disk size: 

cd /var/lib/xen/images/vlinux1

#use dd to create a 1 GB file

dd if=/dev/zero of=Tempfile bs=1024 count=1000000

#append this file to virtual image file (in this case is hda)

cat Tmpfile >> hda 

resize2fs -f hda

 ——————  este es como vmware que te da espacio pero no lo utiliza hasta que se grabe ————————

BACKUP YOUR IMAGE FILE FIRST

dd if=/dev/zero of=<image file> count=1 seek=200G

Using seek in this way will cause a sparse file to be created and should give
you a virtual disk with an apparent size of around 200GB.  Because it’s
sparse, the extra space will only be allocated from the host disk as the
guest writes to it.  That can make things more space efficient but remember
that space *must* be available for the virtual disk to grow into.

If the host runs out of space for the guest’s disk to grow into then the guest
will experience filesystem corruption and data loss.

If you want to pre-allocate the file rather than making it sparse, then your
second solution with cat >> (having created a large non-sparse file of zeros
using dd to really write the data, instead of using seek) should work, I
think.

Remember that resizing the disk in this way will not work while the guest is
running (and you should *never ever* run any utilities against a FS from
outside the guest whilst it has that FS mounted - that would be guaranteed to
fry your filesystem).  Suspending the guest is not enough, it needs to have
the filesystems unmounted fully or be properly shut down.

You can use the -s flag to ls (e.g. do ls -sl) to view the real disk usage as
well as the logical size.  For a sparse file, the real disk usage may be
lower than the logical size; the logical size may be larger than the disk
actually has room for.

Cheers,
Mar

#!/usr/bin/python
# macgen.py script generates a MAC address for Xen guests
#
import random
mac = [ 0x00, 0x16, 0x3e,
random.randint(0x00, 0x7f),
random.randint(0x00, 0xff),
random.randint(0x00, 0xff) ]
print ‘:’.join(map(lambda x: “%02x” % x, mac))

you need 2 bridge interfaces:
xenbr0 = eth0
xenbr1 = eth1

create a new script with the following lines: (ex: multiplebridge.sh) in /etc/xen/scripts/

#!/bin/sh
dir=$(dirname “$0″)
“$dir/network-bridge” “$@” vifnum=0 netdev=eth0 bridge=xenbr0
“$dir/network-bridge” “$@” vifnum=1 netdev=eth1 bridge=xenbr1

make the script executable (chmod +x /etc/xen/scripts/multiplebridge.sh)

modify /etc/xen/xend-config.sxp
change the line:
(network-script network-bridge)
to
(network-script multiplebridge.sh)

modify your virtual machine to use the new bridge interface:
ex:
vif = [ 'bridge=xenbr1', ]

Hope this helps.

another help Read more… »

SendMail

$ sudo vim /etc/mail/sendmail.mc

Sendmail slow to start

It was all about the hostname for some reason. I was using a
FQDN in the host file but for some reason sendmail couldn’t resolve
that name. I put it back to localhost and everything seems to have gone
back to normal.

“Open Mouth, Insert Foot and Chew!”