11
Feb/10
0

Reformat and reindent an XML file

This is easy to accomplish with xmllint and a shell one-liner:

xmllint --format inputfile.xml > outputfile.xml
Tagged as:
9
Feb/10
0

xinetd per_source limit issues

Issue:
Users note availability issues when accessing services backed by xinetd (subversion, rsync, etc.)

Identification:
Syslog on the affected server will present multiple lines containing daemon per_source_limit for 0.0.0.0.

Cause:
You have exceeded per_source_limit defaults imposed by your xinetd configuration. Many distributions include per_source limits that may not be suitable for your use case. Evaluate your needs carefully.

Resolution:
Modify the default setting for per_source in /etc/xinetd.conf or modify the service specific configuration (recommended) under /etc/xinet.d. per_source limits may be set as follows:

per_source = 10

per_source may be set to an integer or UNLIMITED (the number represents the number of connections allowed per host). A sensible fixed value is always better than UNLIMITED.

Reference: xinetd.conf(5)

Tagged as:
5
Jan/10
0

Reset HP Integrated Lights Out Board to Factory Defaults

Issue:
Cannot login to HP Integrated Lights Out Board (bad credentials).

Cause:
Someone failed to record the configuration.

Solution:
If an operating system supported by HP Proliant Essentials is installed along with a recent Proliant Support Pack, you may reset the Integrated Lights Out board to its factory defaults. Use the HP Lights-Out Online Configuration utility.

C:\Program Files\HP\hponcfg\hponcfg.exe /reset
7
Dec/09
0

Honor Guest IDE/SATA Flush Requests

Issue:
VirtualBox ignores IDE/SATA disk flush requests.

Cause:
This is by design. To improve performance VirtualBox ignores these requests. This can create an issue with filesystems that do not have fsck-like tools (ZFS is an example) create a situation where the on disk information is inconsistent due to data held in RAM.

Solution:
To enable flushing for IDE disks, issue the following command:

VBoxManage setextradata VMNAME
      "VBoxInternal/Devices/piix3ide/0/LUN#[x]/Config/IgnoreFlush" 0

The value [x] that selects the disk is 0 for the master device on the first channel, 1 for the slave device on the first channel, 2 for the master device on the second channel or 3 for the master device on the second channel.

To enable flushing for SATA disks, issue the following command:

VBoxManage setextradata VMNAME
      "VBoxInternal/Devices/ahci/0/LUN#[x]/Config/IgnoreFlush" 0

The value [x] that selects the disk can be a value between 0 and 29.

Reference: http://www.virtualbox.org/manual/UserManual.html#id2499944

4
Dec/09
0

Replace Pipes with Tabs in a Delimited File

Issue:
It is often necessary to replace delimiters in a file with a form the receiving party expects. sed is my favorite method of meeting the need.

Solution:
Replace double pipes with tabs

sed 's/||/           /g' file.in > file.out

Note: If you find the tab key simply does not work, try CTRL+V+I from your terminal.
Reference: http://forums.devshed.com/unix-help-35/replacing-tabs-with-spaces-372623.html

Caveats:
Special consideration (and a regex) will be required for data where delimiters are present in the data itself. Consider your use case and apply appropriately.

25
Nov/09
0

Remove a Range of Unwanted ZFS Snapshots from the Command Line

Remove a range of unwanted snapshots, from the command line, if necessary.
In the following example, all automatic snapshots in the bash shell are removed.

for s in $(zfs list -H -o name -t snapshot | grep @zfs-auto-snap); do zfs destroy $s; done

One could add a secondary pipe and grep statement to filter on individual file systems.

Reference: How to Manage the Automatic ZFS Snapshot Service

9
Oct/09
0

Disable X in OpenSolaris

From the shell

pfexec svcadm disable gdm
7
Oct/09
0

Create a pidof command to find PID numbers easily

Most UNIX environments include the pidof command which is put to use whenever one needs to quickly determine, by name, the pid of a running program. Apple’s Mac OS X lacks the pidof command, however, one may approximate its function with the following shell script:

#!/bin/sh
ps axc|awk "{if (\$5==\"$1\") print \$1}";

Save the script as /bin/pidof and be sure to set its executable bit:

chmod a+x /bin/pidof
Tagged as: ,
27
Aug/09
0

Disable disk checking during boot on Linux systems

Issue:
Linux (appropriately) checks filesystems after a number of boot cycles.

Cause:
This is by design. By default, ext[2,3,4] filesystems are automatically checked every 34 mounts or 180 days (whichever comes first).

Resolution:
In some cases (ephemeral machine instances in a cloud) this behavior is undesirable. It may be tuned with the following:

To disable it use the following at the terminal:

tune2fs -c 0 -i 0 /dev/hdXY

Set it to check after 30 system boots

tune2fs -c 30 -i 0 /dev/hdXY

Also ensure that your /etc/fstab file reflects a similar setting. The sixth column should contain a 0 (never check) rather than a 1 (check at boot).

25
Aug/09
0

Convert a .dmg to a .iso

Issue:
Mac formatted disk image (.dmg) cannot be directly burned on Windows or Linux systems.

Resolution:
One can convert a .dmg to a CD master via the Disk Utility application embedded in OS X, or by opening a terminal window and issuing the following command:

hdiutil convert /path/to/filename.dmg -format UDTO -o /path/to/savefile.iso

The output file will be named savefile.iso.cdr — you may strip the .cdr and burn the .iso with any standard utility for doing so.

Tagged as: , ,