Analytics


Google
Showing posts with label Unix. Show all posts
Showing posts with label Unix. Show all posts

Friday, October 19, 2012

sudo: /etc/sudoers is mode 0640, should be 0440

If you encounter the following error, it is likely because you ran the su command while your current folder is /etc and the sudo is in the same folder.

Reference:

http://askubuntu.com/questions/189818/how-to-repair-sudo-etc-sudoers-is-mode-0640-should-be-0440

Wednesday, July 18, 2012

Sendmail vs Mailx

sendmail has the 'intelligence' to figure out how to send the mail to a recipient not on the local machine - provided the machine has access/can route to the network where recipient is located. In order for mailx to do this, you need to use /etc/aliases ( /etc/mail/aliases ) 







 Reference
 https://forums.oracle.com/forums/thread.jspa?messageID=8258664

Monday, June 18, 2012

Sendmail Daemon Port Option

Having the following option in sendmail.cf will restrict receiving of mail only within the same host:

DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA

Further information of this option is found in the following page.

Note on default options are as follow:
  • Address= specifies the address to listen on (default: all)
  • Port= specifies the port to listen on (default: smtp (25))
  • Family= specifies the protocol family (e.g., inet (IPv4) or inet6 (IPv6)) (default: both)


The proper way to configure the sendmail is not to edit the sendmail.cf directly but to change it in the sendmail.mc and then generate the cf file by issuing the command:

m4 sendmail.mc > /etc/sendmail.cf

The sendmail daemon will need to be restarted for the changes to take effect. Information on this can be found in the following

























Wednesday, September 15, 2010

Unix Utilities for Windows

The following are utilities ported from Unix into Windows:

http://sourceforge.net/projects/unxutils/

Unlike other ports, it provides Unix functionalities natively in Windows.  One of the tools touch is used to update the date of the file is useful for those encrypted containers like OFTE so that the backup utilities detect a change and will perform backup.

Friday, September 3, 2010

Setting path in Unix and Windows

Display path
In order to check on existing path, do the following:

in Windows, just type:
echo %path%

in Unix, just type 
echo $PATH

Set path
To add additional folder to the path, do the following:

in Windows, 
for example, to add c:\t2 to front of the path, just do type the following:

set path=c:\t2;%path%

in Unix, if we want to add /usr/sfw/bin to the front of the path, it is a two step process, type:

PATH=/usr/sfw/bin:$PATH
export PATH

to verify type the display path shown above.

Additional Note
A reminder, the paths are evaluated from left to write.  In both Windows and Unix, when we try to execute any program, it will first search for the application in the current folder, then it will traverse the path from left to right.

Friday, September 25, 2009

Daemonize a process in Unix

In unix when we run a command, it will usually run in the foreground and take over our terminal.

For long running processes, we can add & to create a child process to run the background. This will allow you to continue to use the terminal while waiting for the process to finish. However, for that process is still tied to the parent process and will terminate if you exit from your terminal.

Sometimes we want to start a process and let it continue to run even after we exit out of our terminal. This can be done using the nohup command.

For example, if we want to start the WebLogic server and have it continue serving out our web application even after we log out of the server. To do that just type:

nohup ./startWebLogic.sh &

All output will be redirected to a file called nohup.out but the WebLogic server process will continue to run even after we have logged out of the server.

Sunday, May 3, 2009

Polarhome

I found that there is a site which allows people to get access to different O/S for free.  I think this is an excellent idea.  I have not tried it but it looks genuine.  Why don't you just try it?  The url is as follows:

Sunday, April 5, 2009

Changing Backspace to Delete

When we telnet into some of the unix servers, we need to either press delete or control backspace to delete characters. This is sometimes very inconvenient. The trick to change the backspace to delete is to type the following command:

stty erase ^H

Note that when you set the stty, press the backspace (which is represented by ^H here - on windows telnet command prompt, it will appear as ^?

This works for Sun Solaris and HP-UX - in korn shell. I found that Linux already knows backspace is delete.

Here is an article talking about this.

Thursday, December 25, 2008

Shell Scripting on Unix

Ideally to learn how to do scripting, we need to have a unix environment to try out the scripts and this can be easily done by setting up Linux or Open Solaris on your computer. However, what happens if you don't have a spare computer to do that?

You could use a live CD. Problem with that is you need to reconfigure it each time which is troublesome. Alternatively, you can setup Cygwin. There are two version - Cygwin which is purely command prompt and Cygwin/X which provides a X Windows environment.

Given that you can then use the various tutorials on Internet to learn scripts like bash:

Linux Config org
Bash Programming How To
Advanced Bash Tutorial

Alternatively, you can use perl, php or even java to automate your unix scripts.