Archive for the ‘Gentoo’ Category

0

check_domain_es – Nagios, Check Spanish Domain Names

Friday, January 28, 2011
posted by otioti

Hi everybody,

some time ago, I was looking for a plugin for nagios that let me check Domain Names .es, for Spain, but all plugins cannot check this kind of domain names.

So, I decided to create new one. It’s very easy to use, it’s like check_domain plugin:

check_domain_es – v%s
Copyright (c) 2011 Juan Pedro Escalona Rueda <jpescalona@otioti.com> under GPL License
This plugin checks the expiration date of a domain name.
Usage: check_domain_es -h | -d <domain> [-c <critical>] [-w <warning>]
NOTE: -d must be specified
-h: Print detailed help
-d: domain name to check
-w: Response time to result in warning status (days). 30 days by default
-c: Response time to result in critical status (days). 7 days by default
This plugin will use whois service to get the expiration date for the domain name.
Example:
check_domain_es.py -d iavante.es -w 30 -c 10
You can visit project web page here: https://code.google.com/p/nagios-check-domain-es/
0

Segmentation fault

Friday, November 12, 2010
posted by otioti

imwl rcuHome # sync
Segmentation fault
imwl rcuHome # sync
Segmentation fault
imwl rcuHome # ./bin/rcu
/bin/sh: /opt/soft/rcuHome/lib/stubs/libc.so.6: version `GLIBC_2.4′ not found (required by /bin/sh)
imwl rcuHome # ./bin/rcu
/bin/sh: /opt/soft/rcuHome/lib/stubs/libc.so.6: version `GLIBC_2.4′ not found (required by /bin/sh)
imwl rcuHome # ls
Segmentation fault
imwl rcuHome # ls
Segmentation fault
imwl rcuHome # ls
Segmentation fault
imwl rcuHome # ls
Segmentation fault
imwl rcuHome # dir
Segmentation fault
imwl rcuHome # exit

Cool, ya?

0

Moodle & libxml2

Thursday, September 30, 2010
posted by otioti

This is too weird, but when I tried to restore a course from backup, all HTML tags was broken. I thought it was related to PHP and XML but I could never think it was caused of libxml2 version. I had installed libxml2-2.7.3, so to resolv this problem you just have to uninstall this version and install the recommended versions: 2.6.32 or 2.7.0.

If you have an old system, in Gentoo would be:

echo “>=dev-libs/libxml2-2.7.1″ >> /etc/portage/package.mask
emerge -av libxml2

If you have a newly fashioned portage:

emerge -av ‘=dev-libs/libxml2-2.7.6′

See: http://docs.moodle.org/en/Backup_FAQ#Restoring_a_course_results_in_broken_HTML_tags._What_can_I_do.3F

0

IO-Compress collisions with serveral perl packages

Wednesday, May 12, 2010
posted by otioti

I’d surprised when i saw this error updating my servers:

>>> Emerging (1 of 5) perl-core/IO-Compress-2.021
>>> Installing (1 of 5) perl-core/IO-Compress-2.021
>>> Failed to install perl-core/IO-Compress-2.021, Log file:
>>>  '/var/tmp/portage/perl-core/IO-Compress-2.021/temp/build.log'
...

 * This package will overwrite one or more files that may belong to other
 * packages (see list below).
 * perl-core/IO-Compress-Zlib-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Deflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Identity.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Deflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Gzip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Gzip/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/RawDeflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zip/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zlib/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zlib/Extra.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Identity.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Inflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/AnyInflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Gunzip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Inflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/RawInflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Unzip.pm
 *
 * perl-core/Compress-Zlib-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/Compress/Zlib.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/auto/Compress/Zlib/autosplit.ix
 *
 * perl-core/IO-Compress-Bzip2-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Bzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Bzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Bunzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Bunzip2.pm
 *
 * perl-core/IO-Compress-Base-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/File/GlobMapper.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Base.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Base/Common.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/AnyUncompress.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Base.pm
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *  * Detected file collision(s):
 *
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Bunzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Bunzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Bzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Bzip2.pm
 *
 * Searching all installed packages for file collisions...
 *
 * Press Ctrl-C to Stop
 *
* perl-core/IO-Compress-Zlib-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Deflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Identity.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Deflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Gzip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Gzip/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/RawDeflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zip/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zlib/Constants.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Zlib/Extra.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Identity.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Inflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/AnyInflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Gunzip.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Inflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/RawInflate.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Unzip.pm
 *
 * perl-core/Compress-Zlib-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/Compress/Zlib.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/auto/Compress/Zlib/autosplit.ix
 *
 * perl-core/IO-Compress-Bzip2-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Adapter/Bzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Bzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Adapter/Bunzip2.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Bunzip2.pm
 *
 * perl-core/IO-Compress-Base-2.015
 * 	/usr/lib/perl5/vendor_perl/5.8.8/File/GlobMapper.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Base.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Compress/Base/Common.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/AnyUncompress.pm
 * 	/usr/lib/perl5/vendor_perl/5.8.8/IO/Uncompress/Base.pm
 *
 * Package 'perl-core/IO-Compress-2.021' NOT merged due to file
 * collisions. If necessary, refer to your elog messages for the whole
 * content of the above message.

Well, i couldn’t find solution for this error, but bad-practises could be used for this kind of work 

I tried to unmerge IO-Compress-Base, IO-Compress-Bzip2 and IO-Compress-Zlib:

emerge -C IO-Compress-Base IO-Compress-Bzip2 IO-Compress-Zlib

And later, reinstall IO-Compress lib:

emerge -q IO-Compress
0

HowTo: Clonezilla & PXE on Gentoo

Thursday, January 7, 2010
posted by otioti

Clonezilla is for me the best cloning HD opensource project I know. It’s similar to Norton Ghost, but Clonezilla is free. We could use clonezilla two ways: Clonezilla LiveCD y Clonezilla Server Edition.

Clonezilla LiveCD let us create image partitions or whole hard disk and save it on another directory using Samba, ssh or nfs. Also, we could clone from disk to disk.

Clonezilla LiveCD let us install Clonezilla as a service in our network. Problem? Clonezilla only works on Debian, CentOS, Fedora, Red Hat or Ubuntu. Gentoo not supported. And i don’t want to reinstall my server-router-firewall 🙂

So, my idea is install a TFTP service in that server, copy kernel, initrd and filesystem images from LiveCD to tftp directory and configure a PXE service using TFTP

Ok, let’s go. First, download Clonezilla LiveCD: http://clonezilla.org/download/sourceforge/

Mount ISO:

mount -o loop /home/user/clonezilla-livecd.iso /mnt/cdrom

We need to install DHCP and TFTP Services:

 # emerge -v dhcp tftp-hpa syslinux

Next, we’ve cofigure DHCP server:

authoritative;
default-lease-time 600;
max-lease-time 7200;
ddns-update-style interim;
allow booting;
allow bootp;
option domain-name "yourcompany.net";
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.1.255;
option domain-name-servers 192.168.1.1;
option routers 192.168.1.1;
subnet 192.168.1.0 netmask 255.255.255.0 {
   range 192.168.1.100 192.168.1.200;
   option broadcast-address        192.168.1.255;
   option netbios-name-servers     192.168.1.10;
   option routers                  192.168.1.1;
   # For bootp - pxe clients
   range dynamic-bootp 192.168.1.201 192.168.1.230;
   next-server 192.168.1.1;
   filename "/pxelinux.0";
}

For example, i configured my dhcp service next way:

  1. All my clients get dynamic IP from 192.168.1.100 to 192.168.1.200
  2. My gateway will be the same server, 192.168.1.1
  3. Configure PXE:
    1. range dynamic-bootp: We’ll give from 192.168.1.201 to 192.168.1.230 for all PXE clients.
    2. next-server: IP of server which have kernel images and tftp service, router
    3. filename: Path to PXE Loader, / by default.

Next, let’s configure tftpd service. First, edit /etc/conf.d/in.tftpd:

# /etc/init.d/in.tftpd

# Path to server files from
# Depending on your application you may have to change this.
# This is commented out to force you to look at the file!
INTFTPD_PATH="/images"
INTFTPD_USER="nobody"

# For more options, see in.tftpd(8)
# -R 4096:32767 solves problems with ARC firmware, and obsoletes
# the /proc/sys/net/ipv4/ip_local_port_range hack.
# -s causes $INTFTPD_PATH to be the root of the TFTP tree.
# -l is passed by the init script in addition to these options.
INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}"

Next, create /images directory:

mkdir -p /images

So next, copy pxelinux.0 loader from syslinux package.

cp  /usr/lib/syslinux/pxelinux.0 /images/

Create /images/pxelinux.cfg directory.

mkdir /images/pxelinux.cfg
chown nobody:nobody /images

Edit default configuration to load kernel and parameters. We could copy file from Clonezilla LiveCD, /isolinux/isolinux.cfg, but next you’ll see a simple configuration example, and it’s OK for starting:

vim /images/boot/pxelinux.cfg/default
default local
timeout 70
prompt 0
noescape 1
MENU MARGIN 5
MENU BACKGROUND bg.png

# Set the color for unselected menu item and timout message
MENU COLOR UNSEL 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT_MSG 7;32;41 #c0000090 #00000000
MENU COLOR TIMEOUT 7;32;41 #c0000090 #00000000
MENU COLOR HELP 7;32;41 #c0000090 #00000000

say **********************************************
say Welcome to Clonezilla.
say www.yourcompany.net
say **********************************************

# Do NOT allow client to edit the parameters
#ALLOWOPTIONS 0

# simple menu title
MENU TITLE YOUR_COMPANY_NAME (http://www.yourcompany.net)

label clonezilla
  MENU DEFAULT
  MENU LABEL Clonezilla live

  kernel vmlinuz
  append initrd=initrd.img boot=live union=aufs fetch=tftp://tftp_server_ip/filesystem.squashfs vga=791 noswap noprompt ocs_lang=en_US.UTF-8 ocs_live_keymap=NONE

label local
  # MENU DEFAULT
  MENU HIDE
  MENU LABEL Local operating system (if available)
  # MENU PASSWD
  # 2 method to boot local device:
  # (1) For localboot 0, it is decided by boot order in BIOS, so uncomment the follow 1 line if you want this method:
  # localboot 0
  # (2) For chain.c32, you can assign the boot device.
  # Ref: extlinux.doc from syslinux
  # Syntax: APPEND [hd|fd] []
  # [] is optional.
  # Ex:
  # Second partition (2) on the first hard disk (hd0);
  # Linux would *typically* call this /dev/hda2 or /dev/sda2, then it's "APPEND hd0 2"
  #
  kernel chain.c32
  append hd0
  TEXT HELP
  Boot local OS from first hard disk if it's available
  ENDTEXT

Next, we need copy kernel, initramfs filesystem images from LiveCD to /images/ on our server:

  cp /mnt/cdrom/live/vmlinuz /images/vmlinuz
  cp /mnt/cdrom/live/initrd.img /images/initrd.img
  cp /mnt/cdrom/live/filesystem.squashfs /images/filesystem.squashfs

Last, run services:

  /etc/init.d/in.tftp start
  /etc/init.d/dhcp start
  rc-update add in.tftp default
  rc-update add dhcp default

Uso de cookies

Este sitio web utiliza cookies para que usted tenga la mejor experiencia de usuario. Si continúa navegando está dando su consentimiento para la aceptación de las mencionadas cookies y la aceptación de nuestra política de cookies, pinche el enlace para mayor información. ACEPTAR

Aviso de cookies