Main

February 13, 2007

neat trick to find filesystem associated with a label

redhat.com | Red Hat Magazine

findfs LABEL=[label]

This command can also be used to locate filesystems with UUID (Universally Unique Identifier) by replacing LABEL with UUID:

findfs UUID=[uuid]

December 15, 2006

SSH mount

How to Mount a Remote Folder using SSH on Ubuntu :: the How-To Geek

December 14, 2006

How to extract an rpm files contents

How to extract an RPM package without installing it | nixCraft

Syntax is as follows:
rpm2cpio myrpmfile.rpm
rpm2cpio - < myrpmfile.rpm
rpm2cpio myrpmfile.rpm | cpio -idmv

Installing HP ILO firmware updates


Component for Linux - HP Integrated Lights-Out, 1.89
allows you to install the latest ILO firmware updates without having to unpack on Windows and create to stupid boot floppies.
you can either update from the command line, or extract the bin file and update in the ILO's web interface.

Continue reading "Installing HP ILO firmware updates" »

December 12, 2006

Cloning NTFS from linux.

I am working on a project for work. I am using NTFSCLONE to clone ntfs filesystems. It is an interesting command. ntfsclone is part of the ntfsprogs package and is available at:
http://www.linux-ntfs.org/content/view/19/37

December 04, 2006

Locale issues under linux

I was having a problem with locale errors. I am running Ubuntu Edgy.

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").

I tried to run

# dpkg-reconfigure locales
This didn't help. I then ran:

# locale-gen en_US
# locale-gen en_US.UTF-8

and that fixed it.

November 13, 2006

Bash programming methodology

IBM Developerworks had an article about bash functions. I found this little ditty tucked in the article and I liked it.



These basic steps and recommendations can be applied to many client/server applications that run in Linux.
Document the prerequisites and main sequence for running scripts
Divide actions into logical groups
Develop an execution sequence based on a common usage scenario
Provide comments and instructions in each shell script
Make an initial backup to create a baseline
Check for input parameters and environment variables
Try to provide "usage" feedback
Try to provide a "silent" running mode
Provide one function to terminate the script when there are errors
When possible, provide functions that do a single task well
Capture the output of each script, while watching the output being produced
Inside each script, capture the return code of each line command
Keep a count of the failed transactions
Highlight the error messages for easy identification in the output file
When possible, generate files "on the fly"
Provide feedback on the progress of the execution of the script
Provide a summary of the execution of the script
Try to provide an output file that is easy to interpret
When possible, provide cleanup scripts and a way to return to the baseline
  1. Document the prerequisites and main sequence for running scripts

  2. Divide actions into logical groups

  3. Develop an execution sequence based on a common usage scenario

  4. Provide comments and instructions in each shell script

  5. Make an initial backup to create a baseline

  6. Check for input parameters and environment variables

  7. Try to provide "usage" feedback

  8. Try to provide a "silent" running mode

  9. Provide one function to terminate the script when there are errors

  10. When possible, provide functions that do a single task well

  11. Capture the output of each script, while watching the output being produced

  12. Inside each script, capture the return code of each line command

  13. Keep a count of the failed transactions

  14. Highlight the error messages for easy identification in the output file

  15. When possible, generate files "on the fly"

  16. Provide feedback on the progress of the execution of the script

  17. Provide a summary of the execution of the script

  18. Try to provide an output file that is easy to interpret

  19. When possible, provide cleanup scripts and a way to return to the baseline

September 20, 2006

Using getopts with bash scripting

More Power with Bash Getopts - LinuxLaboratory

September 03, 2006

Bash gui programming

Shells scripting - How to create GUI dialogs for GNOME and KDE? | nixCraft

Read more at Linux.com

July 29, 2006

Using Imutability for disk backups

Protect harddisk-based backup from accidental removal

Use chattr command changes the file attributes on a Linux second extended file system so that you will stay away from accidentally removing your backup files with rm -rf.

Continue reading "Using Imutability for disk backups" »

apt utilities

Little-known APT utilities for Debian desktop users

Continue reading "apt utilities" »

July 27, 2006

A nice review

Book review: Linux® Troubleshooting for System Administrators and Power Users by David Carmichael, et al is a nice review of the book I co-wrote. Check it out..

July 18, 2006

Useradd fails

I was receiving an error on an NFS booted RH linux system.

# userdd -m foo
useradd: cannot rewrite password file.

The lock files in /etc looked ok. Specifically /etc/.pwd.lock was empty. I verified I was logged in as root, and I ran pwck and grpck to confirm that the passwd and grp files were FUBAR.

This turned out to be caused by SElinux. SElinux can't cope with ReiserFS, JFS, or NFS. I am sure there are probably others as well. It can handle ext2/3 and XFS. I would bet it works on GFS but I haven't tested. Look at the extended entry for more details.

You can see how to disable SElinux here.

Continue reading "Useradd fails" »

How to disable SElinux

Edit /etc/sysconfig/selinux
Change the SELINUX variable to disabled.

SELINUX=disabled

Now you can reboot and run:

# selinuxenabled ;echo $?
-256


Fromo the man page:
       selinuxenabled Indicates whether SELinux is enabled  or  disabled.  It
       exits  with  status  0  if  SELinux  is  enabled and -256 if it is not
       enabled.

VMplayer retreivable via apt-get

From VMTN Blog

...VMware Player is now available in Ubuntu Dapper repositories. Reading the comments, it looks like your mileage may vary, but for most, a sudo apt-get install vmware-player will do the trick. "No tarballs, no compiling kernel modules, no banging rocks together."

July 17, 2006

LinuxCOE

LinuxCOE SystemDesigner HOWTO

June 08, 2006

Backula

Detailed Bacula Network Backup Implementation Guide | Ubuntu Linux Ihav started using Mozy to backup my laptop, but backula looks pretty good as well.

May 24, 2006

SSH + Squid

SSH + Squid = Private Browsing This is handy for secure surfing at public wifi hotspots.

May 16, 2006

Bash keybindings

All about Linux: Bash Shell Shortcuts

May 15, 2006

Apache Load Balancing

How To Set Up A Loadbalanced High-Availability Apache Cluster | HowtoForge - Linux Howtos and Tutorials

May 05, 2006

Vmware router

nixCraft: Setup VMWARE Host as router for Solaris, Linux, FreeBSD, and Windows XP Guest OS

May 03, 2006

Bash Daemon

A Bourne Again Daemon This looks handy.

April 13, 2006

Static routes

nixCraft: Configuring static routes in Debian or Red Hat Linux systems is a great article about static routes. The syntax always drives me nuts.

April 09, 2006

k9copy

Flavor 8 » How To: Back up your DVDs in Ubuntu

April 06, 2006

Python pefr tips

PythonSpeed/PerformanceTips is a good guide to optimizing your python code to be more efficient.

March 29, 2006

How to backup dvd's with ubuntu

Flavor 8 » How To: Back up your DVDs in Ubuntu

Alternative rc script managers

I know it seems like there are a hundred rc script managers for linux. Here are the one I know about:

1. ntsysv and tksysv - RedHat / FC only
2. chkconf - Used a bit more widely (RedHat, FC, SuSE)
3. service - A RedHat/ FC only way to stop and start services
4. update-rc.d - debian / ubuntu utility
5. redhat-config / system-config - The RedHat / FC management GUI
6. yast - SuSE system management GUI
7. rcconf - debian based
8. insserv - SuSE based
9. BUM - debian based gui

Any others that you know of? Please comment

rc.local in Ubuntu

I am running Breezy Ubuntu and I don't have an rc.local on the system. I don't know if this is a concious decision or an oversite. Here are the steps I used to create one.

1. create /etc/init.d/rc.local
#!/bin/sh
#rc.local
echo 1024 > /proc/sys/dev/rtc/max-user-freq

2. run the following command:
# update-rc.d rc.local start 99 2 3 4 5 .

Hattip to Ubuntu Blog
for the starting point.

Top and Htop

I was reading an article on Using Top More Efficiently, and contemplating how much I dislike top. It is anti-user friendly. In the comments they mentioned htop

htop

I installed it and it ROCKS! It addresses a lot of the limitations of top. It is much more user friendly.

March 13, 2006

htaccess generator

.htaccess Generator :: Webmaster Toolkit

January 13, 2006

Must see Linux tool

Create a custom LinuxCOE 4 install image and see how awesome it makes system management. This tool makes installation, and provisioning systems so easy it is not even funny...

January 09, 2006

Ubuntu updates

I found a couple of interesting Ubuntu items. I found a nice script to update Firefox in Breezy to 1.5, and then I accidentally found a link to another auto configurator for Ubuntu. Automatix seems similar to Easy Breezy (nee Easy Ubuntu).

January 04, 2006

mkfs fails

I was getting the following error trying to mkfs a partition.

mkfs.ext2: No such device or address while trying to determine
filesystem size

After some plonking I realized that the fdisk I used to create the partition was the issue. Normally a reboot is needed, and I couldn't reboot at that time. I found this handy command to reread the partition table:

partprobe /dev/sda

December 20, 2005

Our Linux Troubleshooting book

Amazon.com: Linux Troubleshooting for System Administrators and Power Users: Books: James Kirkland,David Carmichael,Chris Tinker,Greg Tinker is now available for pre-order. This is he book I have cowritten. Please buy as many as you can. I will have more details on it shortly.

October 31, 2005

How to get linux version

To get the version information from ubuntu try "cat /etc/lsb-release".
To get the version information from Red Hat Enterprise Linux try "cat /etc/redhat-release"
To get the version information from Fedora Core try "cat /etc/fedora-release"
To get the version information from Suse try "cat /etc/SuSE-release"

October 18, 2005

Easy Ubuntu

Easy Ubuntu 2.3 - Bienvenue chez moi ! looks great. I have an Ubuntu install. This looks to simplify customizing it.

October 12, 2005

Using ssh-agent

Using ssh-agent with ssh is handy. I got tired of typing the passphrase in for my key. I love the .profile code to automate starting ssh-agent.

Continue reading "Using ssh-agent" »

October 11, 2005

Installing VMware 5.0 workstation on SUSE Linux 10.0

NOVELL: Cool Solutions: How to install VMware 5.0 workstation on SUSE Linux 10.0

September 20, 2005

LPIC 2 test prep

developerWorks : Linux Professional Institute (LPI) exam prep

September 08, 2005

htaccess cheatsheet

The the jackol’s den � htaccess Cheatsheet is a handy guide to setting up htacess protection with apache.

Continue reading "htaccess cheatsheet" »

September 07, 2005

Ext filesystem tools for windows

TinyApps.Org : Blog has a list of tools to access ext2/3 filesystems under windows.

June 27, 2005

Another SuSE annoyance

Editing scripts with Vim gives a good hint on enabling color in vim. SuSE has it disabled by default. I am not sure why. Annoying.

Continue reading "Another SuSE annoyance" »

June 25, 2005

How to install vmware 5 under Suse

After banging my head against the wall I found this from LinuxQuestions.org - Step by Step way to make SUSE 9.3 VMWARE ready ?? - where Linux users come for help

Continue reading "How to install vmware 5 under Suse" »

June 13, 2005

nc6000 debian howto

Installing Debian on a HP Compaq NC6000 Laptop is a good guide to installing Debian on this laptop. This is the laptop I have.

/dev/hda {
io32_support = 3
dma = on
mult_sect_io = 16
interrupt_unmask = on
transfer_mode = 69
}

Fedora Core 4 out

Well it looks like FC4 is out. There is a torrent available as well. One interesting idea is to update via yum. You can check it out at the YumUpgradeFaq - Fedora Project Wiki

Update: I found that this site actually had more detailed information.

June 07, 2005

World to end tomorrow. Linux hit hardest.

Why does it seem that a major development in the computer biz always leads John Dvorak to say it will hit Linux the hardest. He is definiately a playa hater. Those who can do.... I am so tired of these effite mac biggots.

March 29, 2005

How to run a 32 bit binary under 64 bit linux

Use the linux32 command as a prefix
Ie.
$ uname -m
X86_64
$ linux32 bash
$ uname -m
I686

March 15, 2005

WEP Key creator

WEP Key Creator | Linux Gazette

Continue reading "WEP Key creator" »

March 14, 2005

Grub tutorial

Grub From the Ground Up is a great GRUB tutorial. Lord knows I need GRUB help. I knew lilo pretty well. For some reason I use grub just enough to forget it between problems...

March 13, 2005

IMAP craziness

I use Cyrus-imapd for my imap server. It can be a bit fidgety at times. I have had to learn cyradm (which I always forget to su to cyrus to use) and administer it. It is much more complex than UW-IMAP which I used before.

Last week I suddenly started having this odd problem. No matter what I did the messages in my mail box would stay flagged as unread. It was driving me nuts. I found the following error in /var/log/maillog:

Mar 13 20:49:04 sanctus imaps[20910]: DBERROR: skiplist recovery /var/lib/imap/user/j/jtk.seen: ADD at 3FCC exists
Mar 13 20:49:04 sanctus imaps[20910]: DBERROR: opening /var/lib/imap/user/j/jtk.seen: cyrusdb error
Mar 13 20:49:04 sanctus imaps[20910]: Could not open seen state for jtk (System I/O error)

I then removed the /var/lib/imap/user/j/jtk.seen file. I then ran:

touch jtk.seen
chown cyrus.mail jtk.seen
chmod 600 jtk.seen

I restarted cyrus-imapd and that fixed it.

Prior to that I had tried running reconstruct on the mailbox to no avail. That was an odd one...

UPDATE: I found a nice cyrus site that has this fix and a few others. It also has the procedure to create a shared mailbox. Nice!

NeroLinux

Nero [NeroLINUX]

Nero now has a version of their great software free for Linux. Check it out.

March 03, 2005

New psp for RHEL 4.0

For those of you playing with RHEL4, here is where you can get the PSP for it.

March 01, 2005

Agressive paging instead of swapping

The 2.6 kernel allows you to tune this.

# echo 10 > /proc/sys/vm/swappiness

This will favor text/data pages rather than buffercache for RAM.

February 28, 2005

GPL Bios?

It looks like RMS is calling for more work to be done on a GPL'd free bios. I think this is a great idea. I have wondered why Phoenix and AMI etc. have had the monopoly on this while there are so many good engineers that could write great code. The one project I was aware of is LinuxBIOS.

January 30, 2005

Vim and vigor

An interesting article about the best way to use vim.

Vim: Seven habits of effective text editing

January 10, 2005

Linux system recovery solutions

I am looking at sys imaging and recovery solutions for Linux. So far I am looking at Mondo, Systemimager, Partimage, and G4L.

Anyone with any preferences please post. So far I am leaning to systemimager. It is easy and reliable.

January 07, 2005

Tech article of the day

An interesting SSH Port Forwarding article.

Continue reading "Tech article of the day" »

January 05, 2005

Verifying distribution isos

HOWTO: Using rsync to verify distribution media

December 21, 2004

How to install kernel source on Fedora Core 3

Do the following

In the past, the process of updating the kernel did not change the default kernel in the system's boot loader configuration.

Fedora Core 3 changes this behavior to set newly-installed kernels as the default. This behavior applies to all installation methods (including rpm -i).

This behavior is controlled by two lines in the /etc/sysconfig/kernel file:
o

UPGRADEDEFAULT — Controls whether new kernels will be booted by default (default value: yes)
o

DEFAULTKERNEL — kernel RPMs whose names match this value will be booted by default (default value: depends on hardware configuration)
*

In order to eliminate the redundancy inherent in providing a separate package for the kernel source code when that source code already exists in the kernel's .src.rpm file, Fedora Core 3 no longer includes the kernel-source package. Users that require access to the kernel sources can find them in the kernel .src.rpm file. To create an exploded source tree from this file, perform the following steps (note that refers to the version specification for your currently-running kernel):
1.

Obtain the kernel-.src.rpm file from one of the following sources:
o

The SRPMS directory on the appropriate "SRPMS" CD iso image
o

The FTP site where you got the kernel package
o

By running the following command:

up2date --get-source kernel
2.

Install kernel-.src.rpm (given the default RPM configuration, the files this package contains will be written to /usr/src/redhat/)
3.

Change directory to /usr/src/redhat/SPECS/, and issue the following command:

rpmbuild -bp --target= kernel.spec

(Where is the desired target architecture.)

On a default RPM configuration, the kernel tree will be located in /usr/src/redhat/BUILD/.
4.

In resulting tree, the configurations for the specific kernels shipped in Fedora Core 3 are in the /configs/ directory. For example, the i686 SMP configuration file is named /configs/kernel--i686-smp.config. Issue the following command to place the desired configuration file in the proper place for building:

cp ./.config
5.

Issue the following command:

make oldconfig

You can then proceed as usual.

http://fedora.redhat.com/docs/release-notes/fc3/x86_64/

Now to be honest, i"ve never seen up2date --get-source kernel work for the kernel, everything else it works but for some reason none of my box's work doing that, regardless you already have the .src.rpm and you have installed it. You can follow the rest thought.

cd /usr/src/redhat/SPECS
rpmbuild -bp kernel.spec

-bp Executes the "%prep" stage from the spec file. Normally this
involves unpacking the sources and applying any patches.

You can read "man rpmbuild" for more options.

-ba will build the binary and source package, ie. that is what people use after they create a spec file and build all the rpm/srpm(s) that are built in prereq's of the rpm.

Continue reading "How to install kernel source on Fedora Core 3" »

December 16, 2004

Xfce4 Goodies

Xfce is my lightweight desktop environment. I use KDE when I want full featured. Xfce goodies is a nice adjunct. It has lots of toys and fills gaps in the base Xfce installation.

Now and Xen

I have run across several stories of late about Xen. It is virtual machine software in a similar vein as Vmware. It doen't run Windows yet, due to license issues. It also appears to have much better performance than other VM software.

Hymn project information

From the web page:
The purpose of hymn is to allow you to exercise your fair-use rights under copyright law. It allows you to free your iTunes Music Store (protected AAC / m4p) purchases from their DRM restrictions with no sound quality loss. These songs can then be played outside of the iTunes environment, even on operating systems not supported by iTunes.

December 10, 2004

Using keychain to manage system logins

I have been using ssh key for system logins for awhile but I hadn't looked into using ssh-agent (ssh-agent bash or eval `ssh-agent` ) until recently. It has the drawback of needing one to run for each shell you have. A way around this is to use keychain. A good excerpt:

The idea behind keychain is simple: each user has a single perennial agent process instead of a per-session or per-login process.

keychain is a cross-platform shell script that can be included from any of your bash (or other sh-compatible shell) startup files. When executed, keychain starts an ssh-agent process running (if need be) or hooks into an existing ssh-agent. Once an ssh-agent is running, keychain loads all of your private keys into the agent.

With keychain you type your passphrase once and both ssh from an interactive shell and ssh from cron jobs are a painless experience.

December 01, 2004

ipcalc example

# ipcalc -h -m -p -n -b 64.236.24.4 255.255.248.0

NETMASK=255.255.248.0
PREFIX=21
BROADCAST=64.236.31.255
NETWORK=64.236.24.0
HOSTNAME=www1.cnn.com

November 22, 2004

Installing knoppix to your hard disk

A cool howto on installing knoppix to your system. I always keep a copy of 3.6 in my bag. you never know when you might need it.

Updated:
Another article on knoppix. This one on how to remaster a knoppix cd.

Another backup document

A good tutorial on using rsync for backups.

October 29, 2004

Log file mistakes

From Computerworld

A nice article that exposes the top five mistakes people make when watching log files for security issues.

No. 1: Not looking at the logs
No. 2: Storing logs for too short a time
No. 3: Not normalizing logs
No. 4: Failing to prioritize log records
No. 5: Looking for only the bad stuff

I find at a high level this would be true for watching for other things as well.

Continue reading "Log file mistakes" »

October 15, 2004

Recovering a lost root passwd

Linux Gazette has a helpful document on How to Reset forgotten Root passwords

Remember that as they say in this article:

Physical Access is Root Access. Meaning, if you give someone physical access to a system, then you are giving them a very good chance of getting root access on your box. This is true for Windows, Linux, or any other OS out there.

Continue reading "Recovering a lost root passwd" »

October 08, 2004

Linuxquestions wiki

http://wiki.linuxquestions.org/wiki/Main_Page

October 07, 2004

How do I list my linux firewall rules.

Assuming you are running either iptable or ipchains run:

'iptables -L' or 'ipchains -L'

Does SuSE have anything like an /etc/rc.local?

/etc/init.d/boot.local plus my SuSE 9.1 distro also has boot.localfs and boot.localnet.

Nmap example

nmap -sS -p 22 -oG /tmp/test 17.0.0.0/8 &

This looks for hosts on the 17 network with port 22 open.

October 06, 2004

Guide to using live cd to repair system

Repairing your linux system was never easier. ;-)

September 13, 2004

LSB 2.0 released

From linuxbase.org

LSB 2.0 was released on August 30, 2004. This major new version adds Pthreads support, C++ support, a modular specification, alignment with current standards (Posix 1003.1-2001 / SUSv3) and a large number of quality improvements to the LSB

August 31, 2004

Cyrus links

http://anfi.homeunix.net/cyrus/
http://tomster.org/geek/freebsdcookbook/ar01s03.html

mtsend.py

A neat tool to give you a command line interface to Movable Type.

Curious

I hadn't really looked at Open-Xchange before. I knew it case with SLES, but I hadn't paid it much attention. I saw a news article that stated that it released an open source version so I checked it out. Here is there description:

The Open-Xchange Collaboration and Integration Server Environment allows you to store appointments, contacts, tasks, emails, bookmarks, documents and many more elements and share them with other users. This environment can be accessed via any modern web browser and multiple fat clients like KDE Kontact, Ximian Evolution (announced), Konqueror, Mozilla Calendar and many more. Every 3rd party product can access this application over many different interfaces like the WebDAV interface (XML), LDAP, iCal and HTTP(S). This makes the Open-Xchange application to a powerful product which can be used in many of different business and private areas.

Tuning your hard drive

USALug has a nice article on hdparm.

Continue reading "Tuning your hard drive" »

August 29, 2004

Linux dvd authoring links

http://www.nongnu.org/dvdrtools/
http://fy.chalmers.se/~appro/linux/DVD+RW/
http://qdvdauthor.sourceforge.net/
http://dvd-create.sourceforge.net/
http://www.dvdshrink.org/what.html
http://savannah.nongnu.org/projects/tkdvd/
http://lwn.net/Articles/98487/
http://crashrecovery.org/oss-dvd.html
http://crashrecovery.org/oss-dvd/HOWTO-ossdvd.html

August 17, 2004

Knoppix hacks

Two neat knoppix hacks from O'Reillynet.

August 12, 2004

How do I read proliant hardware logs from the command line?

If hpasm is running then run:

hplog -v

It should return errors when there are things like disk, fan, etc. failures.

How do I find the smtp relay server for a subdomain?

An example:
host -t MX rose.foo.com

Handy grub related links

http://www.linuxforums.org/forum/viewtopic.php?t=6782
http://www.gnu.org/software/grub/manual/grub.html#GNU%2fLinux
http://tldp.org/HOWTO/Multiboot-with-GRUB-2.html#ss2.3
http://www.gnu.org/software/grub/manual/grub.html#Booting

July 30, 2004

qtparted

I just found out that there is a nice gui frontend to GNU parted. It is called qtparted.

July 12, 2004

Irc cheatsheet

An Irc Primer

July 11, 2004

False positives in chkrootkit

Checking `lkm'... You have 41 process hidden for readdir command
You have 41 process hidden for ps command
Warning: Possible LKM Trojan installed

./chkrootkit -x lkm

http://lists.samba.org/archive/linux/2004-March/010320.html
http://linux.cvf.net/installing_chkrootkit.html

There are some know false positives in chkrookit [1] and given the way it checks for some of the rookits it's bound to fail sometimes, also notice
that there are know issues with the latest kernel (2.6) and glibc (some processes will not show up no matter what). Also, nautilus and
mozilla-firebird seem to cause these false positives (as reported in bug #222179)

How do I change num lock on by default after boot?

From Linux tips"

When you boot Linux, the kernel turns off Num Lock by default. This isn't a problem if, for you, the numeric keypad is the no-man's-land between the cursor keys and the mouse. But if you're an accountant, or setting up a system for an accountant, you probably don't want to turn it on every single time.

Here's the easy way, if you're using KDE. Go to K --> Preferences --> Peripherals --> Keyboard and select the Advanced tab. Select the radio button of your choice under NumLock on KDE startup and click OK.

If you only run KDE and want Num Lock on when you start a KDE session, you're done.

Continue reading "How do I change num lock on by default after boot?" »

Resizing ext2 / ext3 filesystems

http://ext2resize.sourceforge.net/
http://linux.msede.com/ext2/
and of course resize2fs

Vnc for online classes

You can use vnc server if you're hosting a web conference or training class. Just tell the attendees to point their windows web browsers to http://hostname:5801

You can do -g 80% Rather than a specific geometry, it will just fill 80% of your screen.

July 01, 2004

Nice Screen (1) tutorial

I ran across a nice screen tutorial the other day. You can't beat screen for great session manager for terminal environments.

Continue reading "Nice Screen (1) tutorial" »

June 28, 2004

Naming conventions for RedHat Kernels

From otn.oracle.com of all places:

Upgrading from Red Hat Enterprise Linux 2.1 AS
To Red Hat Enterprise Linux 3

Author: Wim Coekaerts, Director of Linux Engineering
Date: January 2004

Numerous customers have started migrating from Red Hat Enterprise Linux 2.1 Advanced Server (RHAS2.1) to Red Hat Enterprise Linux 3 (RHEL3) or are deploying some new servers onto RHEL3 and have had several questions. Some of the known features have either changed behavior a little or have changed in naming or implementation. I will try to explain some of the more commonly used features of RHAS2.1 and how to make use of them in RHEL3.

In this technical note, I focus on the use of the Oracle VLM option to create a large database buffercache and on the use of hugetlb.

New Kernel Naming

RHAS2.1 for ia32
2.4.9-e.25—Uniprocessor kernel
2.4.9-e.25-smp—SMP kernel capable of handling up to 4GB of physical memory
2.4.9-e.25—enterprise-SMP kernel capable of handling up to about 16GB of physical memory

The userspace has access to about 3GB of the userspace segment; the kernel part lives in the other 1GB (4GB address space on 32-bit systems).

The default SGA can be up to 1.7GB (shared pool and buffercache). It is possible to create a larger SGA of up to 2.7GB, by using MAPPED_BASE and relinking the Oracle executable with a lower attach address.

RHEL3 for ia32
2.4.21-4.EL—Uniprocessor kernel
2.4.21-4.ELsmp—SMP kernel capable of handling up to 16GB of physical memory
2.4.21-4.ELhugemem—SMP kernel capable of handling beyond 16GB, up to 64GB

The other difference with the hugemem kernel is that the kernel and userspace address spaces are split 4GB/4GB, meaning that with the hugemem kernel, a userspace program has access to its 4GB.

With the smp kernel, the default SGA size is the same as in RHAS2.1. However, using the hugemem kernel allows you to create an SGA of up to 3.6GB without having to use the VLM option.

bigpages vs. hugetlb

A typical big server deployment in RHAS2.1 would use bigpages as a bootup parameter to preallocate a large chunk of memory to be used solely for shared memory. These pages have a 2MB or 4MB TLB entry that reduces the number of TLB misses and hence increases performance by a few percent.

The other advantage of using bigpages in RHAS2.1 was that it allowed the kernel VM not to worry too much about bookkeeping for that part of virtual memory. And these pages are not pageable or swappable, so one can guarantee that the Oracle SGA remains in main physical memory.

Enterprise Linux 3 has replaced bigpages with a feature called hugetlb, a backport of what is also in Linux kernel 2.6. There are a few differences in how hugetlb works. Hugetlb behavior is similar to that of bigpages; the pages are backed by large TLB entries, are not pageable, and are preallocated, which means that once you allocate x megabytes of hugetlb pages, that amount of physical memory can be used only through hugetlbfs or shm allocated with SHM_HUGETLB.

RHEL3 no longer requires a bootup parameter; it is dynamically adjustable. After the system has booted, you can echo a value to /proc/sys/vm/hugetlb_pool or you can put the value you want in /etc/sysctl.conf. The value is in megabytes, and it allocates several 2MB pages. You can see the values in /proc/meminfo:

Hugepages_Total: 500
Hugepages_Free: 500
Hugepagesize: 2048K

Note, however, that the kernel needs to find 2MB contiguous physical pages for allocating the hugetlb pool. It does its best to get as many pages as possible, but if there is a lot of fragmentation due to existing binaries running, the pool allocation will probably fail.

A program that wants to allocate shared memory has to add a flag, SHM_HUGETLB, to the shmget() flags. (Oracle Database 10g will do this by default; for Oracle9i Database, a patch is required.) This approach ensures that the Oracle shared memory segments will be allocated out of this pool.

VLM Option

For RHEL3 to use the VLM option to create a very large buffercache, you have two options:

* Use shmfs much as you would in RHAS2.1: mount a shmfs with a certain size to /dev/shm, and set the correct permissions. Keep in mind that in RHEL3, shmfs allocate memory is pageable.

* Use ramfs: ramfs is similar to shmfs, except that pages are not pageable/swappable. This approach provides the commonly desired effect. Ramfs is created by mount -t ramfs ramfs /dev/shm (unmount /dev/shm first). The only difference here is that the ramfs pages are not backed by big pages.

The parameter use_indirect_data_buffers=true remains the same; the settings on the Oracle side should not have to change.

June 21, 2004

Suse 9.1 mirrors and RH Transition service

Suse 9.1 mirrors
Red Hat transition patches for 7.X - 9.X

June 16, 2004

More on enscript

We can control the margins with enscript as well.

enscript --no-header --fontFont --margin=7:7:21:21 --word-wrap

--fontFont is the name and size of the font to use. By default, GNU enscript uses 12 point Courier to format the file. You specify the font name and size like this: Courier10 (10 point Courier). GNU enscript can use any Postscript font on your system, but it's usually safe to stick with the following ones: Helvetica, Times-Roman, and Courier.

--margins=left:right:top:bottom
Adjust page marginals to be exact left, right, top and bottom PostScript points. Any of arguments can be left empty in which case the default value is used.

The man page enscript(1) has details on these and other options.

Changing font in cups with enscript

Because of changes to the texttops filter the Courier font is hardcoded for any mime type that uses that filter.

/etc/cups/mime.convs contains the following lines that show the mime types using this filter:
application/x-cshell application/postscript 33 texttops
application/x-perl application/postscript 33 texttops
application/x-shell application/postscript 33 texttops
text/plain application/postscript 33 texttops
text/html application/postscript 33 texttops

Create a file called "difffont" in /usr/lib/cups/filters and put this text in it:

#!/bin/sh
/usr/bin/enscript -B -f Courier-Bold10 $6

Make the script executable, and make sure it is owned by root. Replace Courier-Bold10 with the font you want to use. A list of available fonts is found in /usr/share/enscript/font.map

To print font.map in 14 point Palatino-Bold with no header lines:

enscript -B -f Palatino-Bold14 font.map

Then edit /etc/cups/mime.convs and replace "texttops" with "difffont" on the lines refering to the mime types you want to replace the texttopts filter.

Intro to lpoptions

http://www.cs.brown.edu/system/printing.html is a good starting place to using the cups command lpoptions.

You can set these values in ~/.lpoptions - for user defaults and instances created by non-root users or /etc/cups/lpoptions sets system-wide defaults.

For Example, In the file place the line :
cpi=12 lpi=7

You will have to experiment with the values of course.

June 15, 2004

Changing fonts in cups with enscript

Because of changes to the texttops filter the Courier font is hardcoded for any mime type that uses that filter.

/etc/cups/mime.convs contains the following lines that show the mime types using this filter:
application/x-cshell application/postscript 33 texttops
application/x-perl application/postscript 33 texttops
application/x-shell application/postscript 33 texttops
text/plain application/postscript 33 texttops
text/html application/postscript 33 texttops

Create a file called "difffont" in /usr/lib/cups/filters and put this text in it:

#!/bin/sh
/usr/bin/enscript -B -f Courier-Bold10 $6

Make the script executable, and that it is owned by root. Replace Courier-Bold10 with the font you want to use. A list of available fonts is found in /usr/share/enscript/font.map

To print font.map in 14 point Palatino-Bold with no header lines:

enscript -B -f Palatino-Bold14 font.map

Then edit /etc/cups/mime.conv and replace "texttops" with "difffont" on the lines refering to the mime types you want to replace the texttopts filter.

Alternative to disabling ACPI

Instead of completely disabling ACPI at boot time (with acpi=off), I only disable ACPI for PCI : the kernel boot parameter I use is pci=noacpi .

June 13, 2004

More rpm tips

To list the contents of an rpm package file you would run:
rpm -ql -p afile.rpm

The -p or --package tells rpm to look in afile.rpm rather than looking in the installed rpm database.
Adding the -p works for other query options as well.

Example:

# rpm -qlp cdrecord-ProDVD-2.01a27-1.i386.rpm
/usr/lib/xcdroast-0.98/bin/cdrecord-prodvd-2.01a27-i686-pc-linux-gnu
/usr/lib/xcdroast-0.98/bin/cdrecord-wrapper.sh
/usr/lib/xcdroast-0.98/bin/cdrecord.prodvd
/usr/lib/xcdroast-0.98/bin/prodvd
/usr/local/bin/cdrecord-ProDVD
/usr/local/bin/cdrecord-wrapper.sh
/usr/local/bin/prodvd
/usr/share/doc/cdrecord-ProDVD-2.01a27
/usr/share/doc/cdrecord-ProDVD-2.01a27/README.cdrecord-ProDVD.txt
/usr/share/doc/cdrecord-ProDVD-2.01a27/README.xcdroast-ProDVD.txt

February 03, 2004

new linux certification

A new certification from Novell/Suse. I now have LPIC level1. I need to decide if I want to do LPIC level 2, Redhat, or the Suse cert.

February 01, 2004

Kernel comparasion

January 28, 2004

troubleshooting nfs issues

Here are some tips to troubleshooting nfs perfomance / availability issues from the client:

rpcinfo -u nfs
rpcinfo -t nfs
nfsstat -c

January 27, 2004

Kernel level security mods

I think the three big projects around kernel-level security mods are LIDS, GRSecurity, and NSA SE Linux. Does anyone know of any others?

backing up mysql

/usr/local/bin/mysqldump --complete-insert --add-drop-table --lock-tables --user=USERNAME --password=PASSWORD DATABASE_NAME > FILENAME.sql

Replace USERNAME, PASSWORD, DATABASE_NAME, and FILENAME with the system specific values.

from http://www.mysql.com/doc/en/mysqldump.html:

shell> mysqldump [OPTIONS] database [tables]
OR mysqldump [OPTIONS] --databases [OPTIONS] DB1 [DB2 DB3...]
OR mysqldump [OPTIONS] --all-databases [OPTIONS]

... and ...

The most normal use of mysqldump is probably for making a backup of whole databases. See section 5.5.1 Database Backups.

mysqldump --opt database > backup-file.sql

You can read this back into MySQL with:

mysql database < backup-file.sql

or:

mysql -e "source /path-to-backup/backup-file.sql" database

However, it's also very useful to populate another MySQL server with information from a database:

mysqldump --opt database | mysql --host=remote-host -C database

It is possible to dump several databases with one command:

mysqldump --databases database1 [database2 ...] > my_databases.sql

If all the databases are wanted, one can use:

mysqldump --all-databases > all_databases.sql

January 22, 2004

eclipse ide rpms

I found precompiled binaries in rpm format for Eclipse. I am installing and testing them now. I run Fedora Core 1 these days.

Update: I had to install three packages to get Eclipse to install:

error: Failed dependencies:
ctags is needed by eclipse-2.1.0-12
libgcj-ssa is needed by eclipse-2.1.0-12
oprofile >= 0.5 is needed by eclipse-2.1.0-12

ctags and oprofile are easily installable from rpmfind.net. libgcj-ssa I found at http://mirror.dulug.duke.edu/pub/fedora/linux/core/development/i386/Fedora/RPMS/

January 14, 2004

Tech talk

I spoke to the Atlanta Unix Users Group last week. It went well. There was a good crowd, and lots of questions. My topic was Samba/CIFS installing, configuring, and troubleshooting. This is the same paper I gave at hpworld. I somehow lost the presentation and had to recreate it.

torrent to get fedora core 1 dvd iso image

http://torrent.dulug.duke.edu/

rpmdb repair FAQ

I have been bit by rpm hangs intermittently. Typically the answer I had always used was to run:

rm -f /var/lib/rpm/__db*
rpm -vv --rebuilddb

This faq from rpm.org deals with it in a less intrusive way.

Mutt Cheatsheet

Both index and pager allow you to perform common mail operations - delete, forward, reply, save - and use standard keys for navigation. Here's a quick list of the default navigation keys (you can change these if they don't work for you, keep reading for details):

Key What it does Where it does it
---------------------------------------------------------
j Move one line up Index
k Move one line down Index
z Move one page up Index
Z Move one page down Index
Open message Index
- Move one page up Pager
Move one page down Pager
q Close message Pager

In addition to these navigation keys, Mutt also allows you to perform commonly-used functions just by tapping the appropriate key. Here's what you need to get started:

Key What it does Where it does it
---------------------------------------------------------
m Compose new message Index, pager
r Reply to current message Index, pager
f Forward current message Index, pager
d Delete current message Index, pager
b Bounce current message Index, pager
c View different mailbox Index, pager
v View attachment Index, pager
a Create alias Index, pager
q Quit Index, pager

You can obtain a complete list from the Mutt manual, or by tapping the

You already know that the

a

key is used to capture email addresses and create aliases for them. You can specify the location of the file which stores these aliases:

Note, however, that I can still view the complete headers of any message by hitting

h

in the pager.

You can customize the message display in the index with the "index_format" variable, which allows you to specify which elements to display in each message index line. The default setting is

set index_format="%4C %Z %{%b %d} %-15.15L (%4l) %s" # format index

which translates to

set index_format="number status date sender lines subject"

Want a no-frills version? This one only displays the date, sender and subject:

set index_format="%{%b %d} %F (%s)" # format index

November 14, 2003

YAL. Is this really needed

Is another linux distro. needed? I am not sure this is a good thing. I know RedHat specifically has irritated the opensource community, but firther splintering is not good. I would like to know if this will be a fork of Debian or if it will ride on top.