On my work systems, the root account can be accessed by three system administrators, including myself. I like zsh (for interactive use) and bash for scripting. The other admins do not share my interest in zsh. So, I place a small piece of code such as the following in root@<host>:~/.bashrc
if [ $( /usr/bin/who am i | /bin/awk '{print $1}' ) = "kevin" ]; then
[[ ! -L ~/.zshrc ]] && /bin/ln -s ~kevin/.zshrc ~/.zshrc
exec /usr/local/bin/zsh -l
fi
Then, in root@<host>:~/.zlogout, I add the following:
if [ $( /usr/bin/who am i | /bin/awk '{print $1}' ) = "kevin" ]; then
[[ -L ~/.zshrc ]] && {
echo "removing .zshrc"
/bin/rm -f ~/.zshrc
}
fi
This enables me to enjoy zsh, without upsetting anyone else. I have root-specific code in my .zshrc to tailor the environment to my liking. It has the added benefit of not affecting console logins (unless I log in as myself from the console, and then su - to root).
Cheers,
Kevin
Migrated my Getting Started with Solaris Containers article over from the old zazzybob.com site.
Cheers,
Kevin
I’ve migrated the SecCheck security auditing tool for Solaris 10 over to the new zazzybob.com site. You can view the Project page here.
Cheers,
Kevin
First, perform a w or a who to find out which pseudo-terminal the user is using:
# w | grep "oracle"
oracle pts/12 Fri 3pm 3days -bash
Now, we can find out the PID of the shell they’re using:
# ps -ef | grep '[p]ts/12'
oracle 11918 11916 0 May 18 pts/12 0:00 -bash
Finally, use the pwdx command to find the pwd of the process:
# pwdx 11918
11918: /var/opt/oracle
Cheers,
Kevin
If you are attempting to pipe the output of find to another command
such as xargs, and your files have quotes, spaces, or other “nonstandard”
characters in them, you can null terminate (rather than newline terminate) your
find output with -print0. You can then use the -0 option
to xargs to read the NUL delimeted output.
For example, I had a bunch of 1252 byte files in a directory with spaces in their
filenames. So…
# find . -size 1252c -print0 | xargs -0 rm
Too easy!
Cheers,
Kevin
I use logwatch on all of my RHEL/CentOS hosts to mail daily digests of important log activity for eyeballing.
However, on my mail server, I run freshclam from cron, and this appears to confuse the clam-update logwatch script plugin. So, this leaves the question – how do you disable a specific plugin?
First, you can list the available script plugins:
# ls /usr/share/logwatch/scripts/services
In my case, the plugin I wanted to disable was clam-update (the script name will match the appropriate headed block within your logwatch output).
To disable, I added the following to /etc/logwatch/conf/logwatch.conf
1
2
| # Added 05/11/2009 - KW
Service = "-clam-update" |
Once done, re-run logwatch. You should see the offending log block removed from your email.
# /etc/cron.daily/0logwatch
Cheers,
Kevin