Categories
Linux

Java: set JAVA_HOME env variable in mac os lion

cd

That will take you to your home directory

vi .bash_profile

And include:

export JAVA_HOME=/Library/Java/Home

Now every time a shell is open, you wil have that set

Categories
Linux

Linux: grep command to find stuff inside files

grep -r “the phrase or word you are looking for…” src/main/webapp/*

If you want to exclude certain string from the results:

(first grep here) | grep -v “error.log”

Categories
Linux

Linux search

# looking for an specific file name
find / -name foo

# looking for a string inside a file, excluding certain files:

grep –exclude=*.log -rnw ‘.’ -e “the_string_you_are_searching_here”

Categories
Linux

Troubleshooting: fedora 11 admin interface not working to setup sshd on startup

It’s weird, but running system / administration / services fedora UI interface is not really changing the services when I hit the restart or enable buttons.

I couldn’t find the answer to the bug, but a workaround to fix it (at least for sshd being run at startup) is to enable sshd through the command line, with the following commands:

/sbin/chkconfig –add sshd

/sbin/chkconfig sshd on

Hope it helps !

Categories
Linux

you want to run a virtual linux on a windows machine

Use Sun Virtualbox. It is open source, it is free, and it runs great. Here’s the link to the tutorial:

http://www.sitepoint.com/blogs/2009/04/20/virtualbox-review/

http://www.sitepoint.com/blogs/2009/10/27/build-your-own-dev-server-with-virtualbox/

Categories
Linux

Troubleshoot: unable to login as root on a newly fedora 11 installation

Fedora protect against this by default. The following lines / files need to be modified by commenting out the line that has the “root quiet” stuff with #:

# grep -e ‘ root’ /etc/pam.d/*
/etc/pam.d/gdm:#auth required pam_succeed_if.so user != root quiet
/etc/pam.d/gdm-fingerprint:#auth required pam_succeed_if.so user != root quiet
/etc/pam.d/gdm-password:#auth required pam_succeed_if.so user != root quiet
/etc/pam.d/xdm:#auth required pam_succeed_if.so user != root quiet