logo{ :from => Delhi, :about => everything }


delete rails sessions on linux

Posted in ruby on rails, rails, unix by manik on the May 10th, 2006

By default Rails creates session files under {RAILS_ROOT}/tmp/session
Use this script to remove sessions more than a day old. You may add it to cron to automate.

find . -name “ruby_sess*” -ctime +1 -exec rm -f \{} \;

Tags: ,

sudo: giving previlige to non previliged users

Posted in linux, unix by manik on the February 11th, 2006

On *nix systems, there are certain tasks such as running servers, editing sensitive resource or configuration files that only privileged users can do.

During software development phase, many such tasks need to be repeated often, and the application developer needs to request the system administrator each time. Sudo is a perfect tool for such times. ( atleast that is how I came across it)

The root user can specify users or group, and command which they can execute in the /etc/sudoers file. The non previliged user can then use sudo to run commands as previliged users, without loggin in as one. (without the need to know the previliged user’s password that is). Root users should use visudo to edit the /etc/sudoers file. Visudo parses the file for any syntax error.

An additional benefit of using sudo is that it logs each time a user tries to run a sudo command.

You can read more about sudo here or do a man sudo.

Tags: , ,