Categories

Our Sponsors

Too many processes script

KSH script to check the number of processes on a system and send an email if there are too many.

I liked this as it was simple, but had some nice elements that could be used elsewhere.

#!/bin/ksh # # Script to check for run away ftp processes. # 04/08 – Mike Byers

HOST=`uname -n` [...]

Share

Command Line Search and Replace

So you want to change some text in many unix files.

Try the following.

perl -pi -e ‘s/find/replace/g’ *.txt

or to script it out. Find the TEXT in regular files and replace with NEWTEXT

for file in `find ./ -type f -exec grep -l TEXT {} \;` do perl -pi -e ‘s/TEXT/NEWTEXT/g’ $file done

[...]

Share

Unix Terminal Font Colors

You can set the font color on the command line if you so desire.

To start, type this on your console:

echo “^[[0;31;40m In Color”

In Color

The first character is an escape character, which looks like two characters, ^ and [. To be able to print this, you have to press CTRL+V [...]

Share

Unix, Web and Development Cheat Sheets

There is a very good list of cheat sheets located at

http://www.petefreitag.com/item/455.cfm

Share

Changing SUDO insults

The sudo command comes with some fun insulting messages when you mistype your password.

In you sshd.conf you need to have “insults” turned on for them to show up.

I started to think that there must be a way to change the insult messages. For instance at home I may want more, non-politically correct insults [...]

Share

SSH Tunneling How-To

First there are a couple scenarios for the tunnel.

Out_host -> Gateway -> Other_host

In this sense you want to get to the other host or to a port on another host.

Use: ssh -L local_listen_port:gateway:gateway_port Other_host

Remote forwarding is used to skip past systems to a destination. You can then use the ssh -p [...]

Share
Get Adobe Flash playerPlugin by wpburn.com wordpress themes