Tuesday, November 22, 2011

How to increase trial period of Windows 7 or Windows Server 2008

Usually Windows 7 comes with a default trial period of 30 days. People don't know that it can be extended upto 120 days. So I am going to discuss about that.

Windows manage the license of Windows 7 or Windows Server 2008 using a tool called "Software Licensing Management Tool". Its a vb script whose default location is "C:\Windows\System32" and is a file named "slmgr.vbs". SLMGR itself stands for Software Licensing Manager.

If you want to see the activation status of your machine, just run the following command either in command prompt or in Run and type the following words: "slmgr.vbs /dlv"


Now you will get the detailed description about your license.


If you want to see all the parameters accepted by slmgr.vbs, then  instead of /dlv, just type slmgr.vbs in RUN and you will get all the options listed in the prompt which will come.

How to increase the trial period to 120 days?

One thing is to be noted as seen on the above picture, there is something called "Windows rearm count" listed with some figure in front of it. This is the matter of interest.

Actually Windows provide you 3 rearm counts. When you perform fresh installation of windows, the rearm count is set to 3 and a trial period of 30 days is given to you. On the completion of trial period, you are asked to either activate or you can increase the trial period.

For increasing the trial period, you need to perform the following steps:-

1. Open Command Prompt in Administrative mode, i.e., "Run As Administrator"


2. Now type the following command in the command prompt:-    "slmgr -rearm"


On successfull run of the command, a dialog box will appear asking user to restart the machine. On restarting, you will see your trial period renewed by 30 days.

This command you can run for a max. of 3 times, ie 30 days(initial) + 30*3 = 120 days of trial period of windows.

If you want to know how many rearm counts are remaining, then run the command in RUN "slmgr.vbs /dlv" and you will get the rearm count in the information displayed as shown in the second diagram above. Note that there is gap in between "slmgr.vbs" and "/dlv".

Thanks for reading..... :)
If you have any queries, then do ask. I would be happy to help.

Monday, November 21, 2011

Installing and Configuring RSH on Linux

I installed and configured RSH on CentOS release 5.5 . The steps would be almost same for all the other linux distros.

First you need to have xinetd installed. For that fire the following command:-

user@centos# yum install xinetd

Once its installed, you need to install rsh-server onto your machine. For that enter the following command:-

user@centos# yum install rsh-server

Now you need to Edit /root/.rhosts to add lists of hosts that can access without password. If you want to allow access to everyone without password, you need to put '+' in the file. A '+' indicates allowing everyone.
To do this, you can either modify the file by opening it or just enter the following command:-

user@centos# echo + > /root/.rhosts

Now you need to modify the permissions of .rhosts file. Enter the following command:-

user@centos# chmod 600 /root/.rhosts


Now you need to allow RSH , RLogin and Rexec to be used. For that you need to modify the /etc/xinetd.d/rsh , /etc/xinetd.d/rlogin  and /etc/xinetd.d/rexec file. Open these files one by one and then set the "disable=no"

Here is an example for modifying the rsh file:-

user@centos# vi /etc/xinetd.d/rsh


Similarly do for the rlogin and rexec file.
Once these are done, now you need to modify the /etc/pam.d/rsh file to allow passwordless rsh to the machine.

You need to modify the following line:-

     BEFORE: auth    required        pam_rhosts_auth.so
     AFTER : auth    required        pam_rhosts_auth.so promiscuous
Now you are done. You need to restart the xinetd service.
 
user@centos# /etc/init.d/xinetd restart
Now run the rsh command with the other commands and you will be able to successfully
execute them.
 If there are any warnings or errors as you are trying to access using the root 
privileges, then you need to modify the /etc/securetty file. Add rsh and rlogin 
to the bottom of that file.
Now you would be able to successfully perform rsh to the machine. 

Monday, November 14, 2011

Package required to make calls from "Lua" to "C" and vice-versa

Lua provides the facility to make calls to C programs and also has the ability to be called from the C program.

I got a problem of being unable to get the required liblua5.1.so files which are essential for this type of communication to happen. So I finally found out what package I need to install to get this working.

One needs to install the "liblua5.1-dev" package and with this all the required files will be updated. You just need to fire this command:-

rahul@ubuntu32$ sudo apt-get install liblua5.1-dev

Once its installed, you can see the path of all the shared libraries "liblua5.1.so" by running the following commands:-

rahul@ubuntu32$ sudo updatedb
rahul@ubuntu32$ locate liblua | less

If you want to get the path of lua.h file, fire the command:-

rahul@ubuntu32$ sudo updatedb
rahul@ubuntu32$ locate /lua.h

Now you have the path of Include files and the shared libraries. Just create the shared library from the "C" program and then run the lua program. You would be able to call C program from the lua program.

A nice tutorial about this is given on the website "http://www.troubleshooters.com/codecorn/lua/lua_lua_calls_c.htm". Do have a look there for more details.


Wednesday, November 9, 2011

Installing Lua on Linux

For installation, download the binaries, build them and install them. The steps for building and installing are listed below.

Download the Lua binaries from the site:-
1. Download the source: http://www.lua.org/ftp/lua-5.1.4.tar.gz
2. Extract the tar ball
3. Run this command from lua-5.1.4 directory: "make linux test"
------------------------------------------------------------------------------------------------------------------------
If you get an error that readline or history.h not found, then try installing the following package:-

sudo apt-get install libreadline6-dev
------------------------------------------------------------------------------------------------------------------------
To check what files exist in a package, use the following command:-
dpkg-query -L <package name>
Like:-
dpkg-query -L libreadline6

If you don’t find any header files and only .so files, then it means you are having the shared libraries and not the source. So you need to install the source files as well.

------------------------------------------------------------------------------------------------------------------------
To get the list of packages and their names if you don’t know, then one can search using the following command:-
sudo apt-get cache search readline

This will give you the list of all the packages containing the name readline
------------------------------------------------------------------------------------------------------------------------

How to build and install binaries from the package:-
Once the binaries are downloaded and the command “make linux test” is run, you need to now install the generated files.

For that enter the following command:-
sudo make install

This will install the Lua binaries to the required path.

Now you can run the files using the terminal.
user@ubuntu32$ which lua
/usr/local/bin/lua
user@ubuntu32$ lua
>