Bash: Input from multiple files.

exec 3<$1 4<$2

while read file1 <&3 && read file2 <&4
do
code
done

Rsyslog: remote logging

On the client you want to log from:
vi /etc/rsyslog.conf

*.* @RemoteSyslogIPAddress:Port

Example:
*.* @172.18.1.50:514

On the remote logging server:
vi /etc/rsyslog.conf

# Begin – Allow remote logging
$ModLoad imudp.so
$UDPServerRun 514
# End – Allow remote logging

Need to send a HUP to the rsyslogd process or

service rsyslog reload

Protected: MacOSX: Connecting to a Cisco router/switch.

This content is password protected. To view it please enter your password below:

Usefull lsof options

Various useful lsof options:

To view files open by a particular PID:
lsof -p pidnumber

To show processes and the port they are running on. This is a great command to find out not only process and port, but also the command and the PID.:
lsof -i -nP # The -n does not resolve the IP addresses and ports to names.

Source: http://sial.org/howto/debug/unix/lsof/

Windows Terminal License unavailable

Sometimes you can get an out of Terminal licenses message when connecting from a client, even if there are still plenty of licenses available. This can be due to some corruption in the client registry. You just need to delete the following key, and try connecting again. You should get the same license from the Terminal server.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSLicensing\Store\LICENSE000\ClientLicense

Postfix max message and mailbox size settings.

To check the current settings for postifx:

postconf mailbox_size_limit
The default mailbox size is 51200000.

postconf message_size_limit
The default message size is 10240000.

To change it:

vi /etc/postfix/main.cf

mailbox_size_limit = newmailboxsize
message_size_limit = newmessagesize

Restart postfix

Redhat RHEL5 – build kernel from src.rpm

Download the kernel-2.6.xx-x.*.src.rpm from http://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/.

rpm -ivh kernel-2.6.xx-x.*.src.rpm

cd /usr/src/redhat/SPECS

rpmbuild -bb –target=i686 kernel-2.6.spec

cd /usr/src/redhat/RPMS

rpm -ivh kernel-2.6.xx-x.*.rpm

MacOS keyboard shortcuts.

Here are some common keyboard commands used in other operating systems.

Page Up = Fn+UpArrow
Page Down = Fn+DownArrow
Home = Fn+LeftArrow
End = Fn+RightArrow
Del = fn+delete

Linux – procmail to delete mail from a user.

# ls -la .procmailrc
-rw-r–r– 1 username users 129 Mar 13 15:08 .procmailrc

# cat .procmailrc
SHELL=/bin/sh
MAILDIR=$HOME/Mail
DOMAIN=mydomain.com
LOGFILE=$HOME/.procmailrc.log

:0
* ^From email@address.com
/dev/null

Microsoft SQL – Rebuild Indexes

You can use the following command to simply rebuild all the indexes on a table.

DBCC DBREINDEX(tablename, “”,0)

Return top

INFORMATION