Monday, December 12, 2011

Soln: pDC->TextOut() error Visual Studio 2010 or Visual C++: cannot convert parameter3 from const char to const string

Ans: In pDC->TextOut(0,0,L"Hi");

Sunday, October 2, 2011

Eucalyptus: ssh cannot connect to host port 22

Solution
1.if u think u are using static setting in /etc/eucalyptus/eucalyptus.conf
2. if u have already used command: euca-authorize
3. start second instance and try to ping the second instance it will work

Thursday, September 1, 2011

Timezone incorrect ubuntu

In case the time zone value shown by ubuntu is incorrect, for example Aisa/Calcutta the correct value is UTC + 5.30 but if your system shows only UTC time then follow the step to correct the time of the timezone.

ln -sf /usr/share/zoneinfo/UTC /etc/localtime

here instead of UTC type the zone that is required.

Wednesday, August 17, 2011

How to have multiple versions of gcc and switch from one version to other

First download the gcc packages
for example: cpp-3.4_3.4.4-6ubuntu8_i386.deb (1707096 bytes)
gcc-3.4_3.4.4-6ubuntu8_i386.deb (484408 bytes)
gcc-3.4-base_3.4.4-6ubuntu8_i386.deb (163028 bytes)

mkdir ~/gcc-3.4

cd ~/gcc-3.4

sudo apt-get install build-essential

dpkg-scanpackages   .   /dev/null | gzip -9c > Packages.gz

sudo gedit /etc/apt/sources.list

add the following code to the file:
deb file:///home/username/gcc-3.4 ./

replace the username with your user name

sudo apt-get update
sudo apt-get install gcc-3.4


Now you have 2 versions of gcc

Now list all the gcc that is available
$ls /usr/bin/gcc* -l

Now type

$ sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-4.2 40
$ sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-3.4 30


this will set both the gcc versions

now to switch from one gcc version to another perform

sudo update-alternatives --config



 
Now enter the number of whichever gcc you want.

I believe this will work for other packages also.

Sunday, August 14, 2011

How to login to linux/windows without grub

grub> rootnoverify (hd0,0)
grub> chainloader +1
grub> boot


In case you want the grub screen from the grub command line
grub> configfile(hd0,7) /boot/grub/menu.lst

In case of grub 2.0 then
set root='(hd0, msdos1)'
chainloader +1
boot

Tuesday, July 12, 2011

Setting up a samba server

Used for sharing files from linux (ubuntu) to windows
1. sudo apt-get install samba

2. sudo gedit /etc/samba/smb.conf
in smb.conf
security = user
usernamemap = /etc/samba/smbusers

3. now it will take the username from the file mentioned
4. first create a password for the username in the file
sudo smbpasswd -a
Now add the username to the file using the commands
sudo gedit /etc/samba/smbusers
  = “

Now we have to create samba shares and give access (i.e) create some directory in the server and give access to the file so that the windows user can read the shared document


 1. open sudo gedit /etc/samba/smb.conf
[global]
 security = share
       client lanman auth = Yes
       lanman auth = Yes

[tmp]
 comment = Temporary file space
 path = /tmp
        read only = n
public = yes
(or)
in the smb.conf (default file)
#======================= Share Definitions =======================
# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user’s home directory as \\server\username
[homes]
comment = Home Directories
browseable = yes
# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only “username” can connect to \\server\username
valid users = %S
# By default, the home directories are exported read-only. Change next
# parameter to ‘yes’ if you want to be able to write to them.
writable = yes
 If you are using the first method then
create a directory named /tmp in ubuntu

Finally
In windows machine
go to run and type
//machinename/hostname
here machine name is the hostname of the ubuntu server

You can find the hostname by typing the command
hostname in terminal.


Once the server and client are setup find out if the directory is shared
1. smbclient -L localhost
 
This will display the name of the folder that is shared
2. How to check whether the folder sharing works properly
mount.cifs //192.168.0.2/tmp /mnt/smb
This command will mount the folder on the location /mnt/smb. If it gets mounted properly then the setup is working properly.

Saturday, May 28, 2011

How to install M5sim

M5 sim installation

1. nrs@nrs-OptiPlex-745:~$ sudo apt-get install g++ python-dev scons swig zlib1g-dev m4 mercurial patch subversion


2. hg clone http://repo.m5sim.org/m5

3. nrs@nrs-OptiPlex-745:~/m5$ scons build_opts/X86_SE/m5.opt
scons: Reading SConscript files ...

You're missing the M5 style hook.
Please install the hook so we can ensure that all code fits a common style.

All you'd need to do is add the following lines to your repository .hg/hgrc
or your personal .hgrc
----------------

[extensions]
style = ./util/style.py

[hooks]
pretxncommit.style = python:style.check_style
pre-qrefresh.style = python:style.check_style

4. The program 'style' is currently not installed.  You can install it by typing:
sudo apt-get install diction

during compilation  don't use sudo. Simply compile using scons in the given directory.

5. sudo apt-get install diction

6. scons build/ALPHA_FS/m5.debug

7. scons build/X86_FS/m5.debug

8. download the vmlinux files for the respective ISA

9. mkdir /dist/m5/system and extract the files there.

10. now for running the program use
cd ~/m5
sudo ./build/ALPHA_FS/m5.opt configs/example/fs.py

Monday, February 21, 2011

How to install R plot

Add the following line to /etc/sources.lst

deb http://cran.opensourceresources.org/bin/linux/ubuntu feisty/

or find the appropriate mirror from http://cran.r-project.org/mirrors.html and add replace the word cran.opensources.org




Powered By Blogger