The Ruby on Rails web application framework got lots of buzz in last year. Apple has just posted very nice and easy to follow tutorial on Ruby On Rails for web development on Mac OS X.
According to apple it is no surprise that Mac OS X is a favored platform for Rails development. Rails and its supporting cast of web servers and databases thrive on the rich Mac OS X environment.
* This tutorial covers
* Installing Rails
* Creating a New Rails Application
* Jump-Starting the Application
* Creating the Database Schema
* And other related stuff etc
Overall an excellent tutorial and highly recommend for all newbie’s out there.
You may use many macros under office packages. However, your ftp client also supports macros. You can use ~/.netrc – user configuration file. The .netrc file contains login and initialization information used by the auto-login process and stores macros information. It resides in the user’s home directory.
Turn on FTP client auto login
You need to add username and password to file ~/.netrc. Open config file using a text editor such as vi:
$ vi ~/.netrc
Append or add following lines to it:
machine ftp.myserver.com login USERNAME password PASSWORD
Save file and exit to shell prompt. Make sure, only owner can read the file:
$ chmod 0600 ~/.netrc
To connect type command:
$ ftp ftp.myserver.com
Now let us say every time you connected to ftp server you would like to switch to binary mode and turn off prompt as well as go to directory /pub/data/backup/rdbms/dump/. You can create a macro to automate all these three steps:
i) Open ~/.netrc ftp configuration file:
$ vi ~/.netrc
ii) Define a macro
You need to use the following syntax:
Please note that each macro definition ends with a null line (consecutive new line characters in a file or carriage returns from the terminal). There is a limit of 16 macros and 4096 total characters in all defined macros. Macros remain defined until a close command is executed.
Append following text to .netrc file:
Save and close the file. Now connect to ftp server:
$ ftp ftp.myserver.com
Connected to ftp.myserver.com
220 ftp.myserver.com NcFTPd Server (licensed copy) ready.
Remote system type is UNIX.
Using binary mode to transfer files.
To execute a macro FOO type the command:
ftp> $ FOO
200 Type okay.
Interactive mode off.
250 "/pub/data/backup/rdbms/dump/" is new cwd.
=> ftp command man page
Almost all Linux distribution comes with its own set of GUI tools to manage users and groups. For example:
* Red Hat comes with redhat-config-user
* Suse comes with Yast
* Debian Linux and other distro come with users-admin GUI tool set
* FreeBSD with sysinstall
* Solaris comes with Solaris Management Centre (SMC)
However, I recommend managing user accounts from command line. It offers following benefits over GUI tools:
- Using commands from command line is faster
- Automation is possible as per your requirements (use of Perl or shell scripting)
- If you are going to use LDAP or NIS then command line provides best solution as compare to GUI tools
The best way to edit /etc/passwd, or shadow or group file is to use vipw command. Traditionally (under UNIX and Linux) if you use vi to edit /etc/passwd file and same time a user try to change a password while root editing file, then the user’s change will not entered into file. To avoid this problem and to put a lock while editing file, use vipw and vigr command which will edit the files /etc/passwd and /etc/group respectively. If you pass -s option to these command, then they will edit the shadow versions of those files i.e. /etc/shadow and /etc/gshadow, respectively.
The main purpose of locks is to prevent file corruption. Do not use vi or other text editor to edit password file. Syntax:
- vipw -s : Edit /etc/passwd file
- vigr -s : Edit /etc/group file
Login as a root user:
# vipw -s
On other terminal login as normal user (for example vivek) and issue command passwd to change vivekâ€™s password:
(current) UNIX password:
Enter new UNIX password:
Retype new UNIX password:
passwd: Authentication token lock busy
As you see it returned with an error “passwd: Authentication token lock busy”
This will avoid /etc/shadow file corruption.
You need to use the sudo command to grant a permission to other users to shutdown your server. The sudo command allows a permitted user to execute a command as the superuser or another user, as specified in the /etc/sudoers file. Login as a root user and type the visudo command to edit the sudoers file.
One of my friend installed Oracle first time. After installation, he just wants to make sure everything is working fine so he called me. If you are installing oracle for Unix/Linux oses first time then it will confuse you. He wanted to know how to start oracle service and test it. He emailed me the following error:
ORA-27101: shared memory realm does not exist
ORA-01034: ORACLE not available
You need to add following line to oracle userâ€™s .bash_profile file for testing purpose (once it is tested, you can give control to Oracle DBA) (login as a oracle user):
$ cd;vi .bash_profile
Append following lines:
Save file. Just load the above settings:
$ . .bash_profile
Start oracle Net listing service:
$ lsnrctl start
ALTERNATIVELY use full path:
$ /home/oracle/oracle/product/10.2.0/db_1/bin/lsnrctl start
Start oracle database:
ALTERNATIVELY, use full path:
Connect to Oracle database with sqlplus client (test it with scott username):
$ sqlplus "scott/tiger"
sql> select * from tab;
To shutdown Oracle database:
$ lsnrctl stop
If you are new to Oracle try out Oracle Database 10g Documentation library, especially 2 Day DBA is fantastic document. Do not forget check out John Smiley’s “Installing Oracle Database 10g Release 2 on Linux x86” article. It will teach you the basics of installing Oracle Database 10g Release 2 on Red Hat Enterprise Linux or Novell SUSE Enterprise Linux, from the bare metal up.
If you have, a password protected grub boot loader and you forgot both root and grub password, then you can recover grub-boot loader password using the following method/procedure:
* Use Knoppix cd
* Remove the password from Grub configuration file
* Reboot the system
* Change the root password
* Setup new Grub password if required (optional)