Sunday, January 28, 2007

Windows:


Network diagnostics tool.


Start --run-- netsh diag gui


Will open up the network diagnostics tool. You can set the parameters of what to check and then run the check. You can then save the output to a file and email the file to your admin or network guru to make it easier to troubleshoot a network problem.

Bonus Tip: (hey, I should charge extra for all the bonus tips)

To display a list of commands entered in a current DOS prompt (similar to the "history” command in Unix):

enter in the following command at the DOS prompt:

DOSKEY /history



Linux:


Did you ever ssh into a machine and then get stuck probably due to a break in the connectivity and your ssh client shell is still stuck? Ctrl C and Ctrl D does not seem to get you out of it.

You could open a new console, then ps –ef ¦grep ssh to find the PID of the ssh process and kill it but that is a bit complicated.

Instead, try to type “~.” (You may have to hit Enter). This should kill the ssh session on the client side.

Bonus tip:

nohup” command. (nohup = no hangup). If you need to run a script or command on a remote box but are worried that your ssh / telnet session will disconnect and disrupt your running process, use the nohup command and it will continue to run even if you get disconnected. Standard output is redirected to the “nohup.out "file.

Example: you want to find all files beginning with blabla on the remote box and write the list to the file /tmp/filelist.txt.

You could do

find / -name “blabla*” print >> /tmp/filelist.txt .

This will start a search and could take a long time. If your ssh / telnet session is disconnected, the "find" process will also die.

Instead, type:

nohup find / -name “blabla*” print >>/tmp/filelist.txt & (The & sign puts it in the background).

Now if your ssh / telnet session dies for any reason, your find process will continue. You can then reconnect and see the results in the /tmp/filelist.txt file.


Feel free to send me comments with any hints and tips to enlighten everyone with.

1 comment:

Steve Kroser said...

Cool! Now if you can stick to the commitment of EVERY week, that will be amazing!