Archive for 2004

Listing Interrupts

Friday, November 26th, 2004

To list the Interrupts/IRQ:

# dmesg | grep ‘[iI][rR][qQ]‘

$ dmesg | grep ‘[Ii][Rr][Qq]‘

ACPI: IRQ9 SCI: Edge set to Level Trigger.
ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 6 7 9 10 *11 12 14 15)
ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 9 *10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 9 10 11 *12 14 15)
ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 7 9 10 11 12 14 15)
ACPI: PCI Interrupt Link [LNKD] enabled at IRQ 5
ACPI: PCI Interrupt Link [LNKC] enabled at IRQ 12
ACPI: PCI Interrupt Link [LNKA] enabled at IRQ 11

genlop – parses portage logfiles for information

Tuesday, November 23rd, 2004

Detailed features include:

  • Nice colorful output.
  • Full Portage merge and unmerge history.
  • Display date, time and build time of every merge.
  • Display total and average build time of selected package[s].
  • Estimate upgrade time.
  • Watching current merge progress.
  • Use alternate portage logfile(s).
  • Match package names using regular expressions.
  • Log corruption detection.

To get complete detail of merged packages:

$ genlop –list
Sun Jul 11 23:22:16 2004 –> dev-util/ccache-2.3
Sun Jul 11 23:22:41 2004 –> sys-apps/portage-2.0.50-r9
Sun Jul 11 23:22:48 2004 –> sys-devel/gnuconfig-20040214
Sun Jul 11 23:24:57 2004 –> sys-devel/gettext-0.12.1
Sun Jul 11 23:25:20 2004 –> sys-apps/sed-4.0.9
Sun Jul 11 23:26:51 2004 –> sys-libs/ncurses-5.4-r1
Sun Jul 11 23:27:22 2004 –> sys-apps/texinfo-4.6
Sun Jul 11 23:29:47 2004 –> sys-devel/binutils-2.14.90.0.8-r1
Sun Jul 11 23:30:04 2004 –> sys-devel/m4-1.4.1
Sun Jul 11 23:30:31 2004 –> sys-devel/bison-1.875
Sun Jul 11 23:30:40 2004 –> sys-libs/zlib-1.2.1-r2
Sun Jul 11 23:44:16 2004 –> sys-devel/gcc-3.3.3-r6
Mon Jul 12 00:05:58 2004 –> sys-libs/glibc-2.3.3.20040420
Mon Jul 12 00:07:20 2004 –> sys-apps/baselayout-1.9.4-r3

To calculate merge time:

$genlop –time package_name

$genlop -t qt
* x11-libs/qt

Thu Oct 7 20:52:53 2004 –> x11-libs/qt-3.3.2
merge time: 25 seconds.

merged totally 1 ebuild in 25 seconds.

Search packages that match a regular expression:

genlop -s gen[lt]o

source: man genlop

Gentoo 2004.3 announced

Tuesday, November 16th, 2004

Gentoo Linux 2004.3 is now available!

Changing the look of your Linux

Tuesday, November 16th, 2004

To change your boot time grub background download a splash image and place it under /boot/grub and then edit grub.conf to add the following:

splashimage=(hd0,4)/grub/splash.xpm.gz


Note: (hd0,4) = /boot

To change gnome splash image get a splash image from GNOME-Look and place it under /usr/share/pixmaps/splash/ with the name gnome-splash.png.

To change gdm login manager get the gdm themes from GNOME-Look and use gdmsetup to install new login theme.

Creating portage packages

Tuesday, November 16th, 2004

In gentoo linux quickpkg can be utilized to quickly create a package (tbz2 format) for portage by utilizing the files already on your filesystem. This package then can be emerged on any system.

It comes with gentoolkit package.

emerge -pv gentoolkit
man quickpkg

You can do the same thing with ‘emerge’ command

emerge -B package_name

–buildpkgonly (-B) Creates binary packages for all ebuilds processed without actually merging the packages. This comes with the caveat that all build time dependencies must already be emerged on the system.

All generated packages will be stored in

${PKGDIR}/All
${PKGDIR}/

Quick backups with ssh and gzip

Wednesday, October 20th, 2004

As a SysAdmin I sometimes need to make quick backups of a filesystem to a remote machine. Unix provides easy and quick ways to do this task.

The following command line uses dd – destroy disk command ;-) – to copy the content of /dev/hda11 and send the output to gzip and copy the resulting compressed file to the remote machine through ssh. The syntax is as follows:

dd if=/dev/hda11 | gzip | ssh user@remote_server dd of=/dest/path/hda11.gz

Note that /dev/hda11 should not be mounted (not accessed while backing up).

To restore the backed up filesystem do the following:

dd if=hda11.gz | gzip -d | ssh user@remote_host dd of=/dev/hda11

And your done! Quick and dirty backup for you.

Basic control of the tape device

Sunday, September 26th, 2004

The mt command, magnetic tape control allows you to send commands to a magnetic tape. Next you’ll find some basic usage of this utility.

Print status information:

mt -f /dev/rmt/0n status

Rewind the tape:

mt -f /dev/rmt/0n rewind

Erase the entire tape. Be careful with this.

mt -f /dev/rmt/0n erase

Now suppose you want to back a directory called /var/backup:

tar -cvf /dev/rmt/0n /var/backup

And type the following to see its content:

tar tvf /dev/rmt/0n

Now dump a disk slice:

ufsdump 0cvf /dev/rmt/0 /dev/rdsk/c0t0d0s0

or a directory…

ufsdump 0cvf /dev/rmt/0 /var/backup

Now restore a dump:

ufsrestore rvf /dev/rmt/0

References:

Ports used by trojans and viruses

Thursday, September 23rd, 2004

Here goes a list of useful links to ports used by trojans and viruses…

If you are aware of new links, post a comment please.

grub: how to save current menu entry as default

Friday, September 3rd, 2004

If you have many grub menu options, grub can boot the previously booted option

default saved
timeout 15

title Gentoo(2.4)
root(hd0,0)
kernel /boot/bzImage-2.4 root=/dev/hda5
savedefault

title Gentoo(2.6) Qos
root(hd0,0)
kernel /boot/bzImage-2.4 root=/dev/hda5
savedefault

title Gentoo(2.6)
root(hd0,0)
kernel /boot/bzImage-2.6 root=/dev/hda5

Hiding boot time messages

Thursday, September 2nd, 2004

If you want to hide linux boot time messages or store them to a specific location then you could edit the /etc/inittab file and change it as follows:

rc::bootwait:/sbin/rc boot > /dev/null
l0:0:wait:/sbin/rc shutdown > /dev/null
l1:S1:wait:/sbin/rc single > /dev/null
l2:2:wait:/sbin/rc nonetwork > /dev/null
l3:3:wait:/sbin/rc default > /var/log/rl3
…..

Note that this example is taken from Gentoo Linux.