Monday, January 21, 2013

Devnagari Language on your computer Challange part 2

Now why did I choose this as a challenge post?

While I was having a discussion with this person , along with my uncles and cousin. A subject came to light where in my uncle wanted to replace the domain name with devnagari too. At this point , i had known that gangal's fonts allowed you to change the names of the folders to what ever you want.

So , with that logic being a computer man i assumed , that naming of the folders is possible. So i went of to take this as a challenge. And I soon realised there may be more to what i think and may be too much for me.

But then being a very stubborn i decided to try it out. So first thing i did is to name a folder श्याम
and proceeded to put it in my web folder in case of ubuntu , its /var/www/




and then test it out with a call to 

                                                      http://localhost/श्याम/ 


And wallah it worked , now i thought it could work the same way in case of domain name boy was i wrong. 
So while it allows the naming to happen but it started to change my domain name into something else 



                               श्याम.shyamjoshi.in became http://xn--r2bbu7aze.shyamjoshi.in/

Which still bugs me , so if ever a reader comes across the solution to this problem , please make a point to reply to this post. In the meantime , I found a work around which probably readers of the blog must have figured out too.

I registed the xn--r2bbu7aze as the sub domain name to name of shyam joshi and it works really good.


So readers i ask humbly , if you are marathi or konkani make sure to try the font and my website which can be visited at http://श्याम.shyamjoshi.in and or http://shyamjoshi.in/श्याम


For some to view the content you may have to turn on the unicode support.

To be able to see it in the web page properly


And please comment comment comment


Devnagari Language on your computer Challange part 1


Sorry for all those who visit this blog , this posting of todays is around 3 to 4months later than usual.


I visited a person , today , whose has created some special fonts for marathi and konkani format. Which is kinda of really great , but whats even greater is that this particular set of fonts are aesthetic and cool. Now that i have talked about these fonts , lets see where we can get them and install them on our computer.

They are available for Windows and on Linux . Then again if the font is in ttf , it should be runnable on linux anyway( well thats my belief and untill i am proved otherwise , this line sticks here)

Anyway lets see how to get them and then install them.
Here is the link where Shubhanan Gangal the creator of the fonts gives it away for free.

Here is the link for windows :

http://www.gangals.com/downlod/2-Soppi-Marathi-with-Complex-Script.rar
This one is for linux :
http://www.gangals.com/downlod/5-Gangal1Marathi-font-for-Linux.rar


Now how to install them is also very simple. If you are a windows user , and have not installed a software yet . Well for you mostly my directions would be extract using winrar available on rarlabs.com


Then simply double click exe and next next untill finish 

Linux person simply has to copy them over to /usr/share/fonts/
directory.


Now why gangal's fonts , 
1. They are phonetic in nature as in you type the words which kinda relate to sounds of the alphabets 
     A proper example would be my name which is shyam ( Sha(broken) Ya M) श्याम 
   This can be achieved by phonatic approach shown in various tutorials which he offers.
2. Hence they are easy to learn 
3. He also offers something called tutorial which can not only help you learn but teach to your marathi children who will have forgotten this language.




Part one concludes here , The challange is there in part 2.

Monday, August 13, 2012

Reverse Proxy Apache

In the world of servers its a known fact that web applications tend to slow when only one server performs everything , cost of moving to another servers tend to be great and downtime tends to become an over kill too.
    To fight with something like this people came up with the idea of reverse proxy , now reverse proxy could be imaging just like a proxy server , but unlike bywhat.com , or ninjacloak.com, reverse proxy actually grants anonymity the web application server making it impossible for user to detect which server is actually serving web applications and which one is serving static content.

Lets have a look at typical diagram:



Lets look at how it works :
 User types in something like say www.shyam.com and the code is hosted over server A1
 While Another user types something like www.techblog.com and the code is hosted over A2

Now anyone who knows anything about webserver and a little networking will tell us , that if i simply ping www.shyam.com I will get an IP belonging to A1 server and for techblog.com i will get the ip of A2 server. 

But what if i say you ping both the websites the ip will be from the proxy server ? 

Some of us have understood what i am talking about , Others are probably scratching head and going how can that happen ?

This happened because we implemented three things:
  1. pointed A name entry of both to proxy server
  2. Then set up virtual host configuration to www.shyam.com and www.techblog.com on proxy server 
  3. Made an entry in the proxy server list 
Now here is what I followed.

  1. I installed an Apache server  and put in the code in this server lets call it A1
    1. At this point , I set it up with a virtual-host configurations ( a little demostration meant for another post )
  2. I did a similar thing with A2 
  3. Then made entries in the /etc/hosts for the proxy server 
  4. Then I made a simple modification set on the server side for proxy server 

This is an entry meant for www.shyam.com

<Proxy "*">
    order deny,allow
    allow from all
</Proxy>

ProxyPass / http://www.shyam.com/
ProxyPassReverse / http://www.shyam.com/
# for IE hosts
SetEnv proxy-nokeepalive 1
ProxyPreserveHost on










Tuesday, June 5, 2012

Virtual Host: multiple domain names on a machine Part I

PIN code is an address identifier to your location , Similarly an IP address , is an address that identifies a machine , Most of the interaction of a user to any machine is based on IP address.

Domain name service lets you map a Domain Name with an IP address , which means one can use a simple to remember a domain name and not remember the IP address. A server is usually a costly resource so what a hosting company simply does is hosts multiple domains on one machine. This way they can simply give a slice of hard disk space of a machine to a single user. This way an expensive resource can be utilize to maximize profits.

Lets see how you can do it , with Apache Virtual host configuration. This is not a post on automatic virtual configurations.

There are two ways of doing this one is the hard way:
  1. Create a new file in folder 
    1. /etc/apache2/sites-enabled
    2. Paste in following code 
    3. <VirtualHost *:80>
        DocumentRoot /home/shyam/workone/
          ServerName workedhost
            <Directory "/home/shyam/workone/">
              allow from all
                Options +Indexes
                  </Directory>
                    </VirtualHost>

                  1. at this point simply do
                    sudo a2ensite nameofthefile or
                    simply do a symlink of this file in site-enabled folder in /etc/apache2
                    works in ubuntu this way
                  2. Lets analyse this perticular code 
                The first line virtualhost directive  with * which signifies the address on which this domain name will be processed , In this case its any address associated with the servers ip address

                Now the next thing is :80 , his signifiies the port on which the hosting is going to be done 


                After this you have a directive called the DocumentRoot

                This directive shows where the server files are going to be stored
                Now lets look at the directory directive :

                With this we have attribute thats showing a path to DocumentRoot directory , This is done so we could apply some rules to this directory ,
                Current rules are

                apply from all , this allows all host names to access this files
                Options +Indexes Means it will look for default index file in the perticular directory


                Now you are ready to have a virtual host in ubuntu


                In case of any other OS , you could try putting this in Apache.conf(windows) or httpd.conf(fedora) file

                Of you could simply write this in a file and load it  with
                 Include "relative or absolute path to file"


                This in the first , or what i call manual case , Lets cover how to do it easy using a tool called webmin , Make sure you keep and Eye out for that post , You will see lots of things that can be done easily with out any hassle

                Thursday, May 17, 2012

                Hosts file : DNS server for local machine

                In age of internet , one who does not have domain name , does not have existence. This was line i heard in a movie, Cool as it sounds not really true yet , but eventually may become true.

                DNS , Domain Name System , was introduced to identify as machine with a name that one can remember  , and not a machine readble  address like "127.0.0.1" . While its just set of 4 numbers , a name like google.com is always easier to remember than 173.194.36.49. See what I mean ?


                 Domain name system works for the whole internet  , But one can make such a thing just for one's computer , This is done by something called a hosts file. Every Operating system has it , usually in a folder called etc , Although this folder can be deep within in your system. but this file does exist.


                Lets us see how we can use this file to do things we want to do.


                Lets say you want to play a naughty joke on your friend , so when he types in www.yahoo.com , you want him to see google.com , Here is how you can do that.

                1. First you need access to the machine on which you want to play this joke.
                2. Find the hosts file locations are specified below 
                  1. Windows
                    usually located on C:\windows\System32\drivers\etc\
                  2. Mac and Linux
                    Usually located in /etc/ folder in root 
                3. Now open the file in administrator privilege
                  and now add entries to it so that you can stick yahoo to may be something like google.com
                4. Now save and watch the magic happen
                here is a pictographical walkthru

                1. Open hosts file using a text editor , In linux you may have to run this command with sudo

                2. Open the hosts file using the text editor

                3. Now edit the file to map the domain name





                4. Now for the result


                Please do comment :)

                Any suggestions to make this more easier to understand will be appreciated.









                Wednesday, May 16, 2012

                Junction : Symblink on windows

                Symbolic links are very nice thing with Linux , On windows on the other hand this is not really done so easily , but a tool i came across an year ago which makes things very easy.

                It called Junction and is available on this website 
                1. http://technet.microsoft.com/en-us/sysinternals/bb896768.aspx

                2. You have to download this to you machine , I downloaded and extracted it in my c:\Junction folder
                3. Use CMD to get to this directory


                   I lookup help on this tool by running /? as a wildcard
                4. Then simply run
                  Junction <target directory> <Junction target>



                  Now it will show you created and targeted as shown above
                5. Now test it out , by opening the directory

                Now you are ready to use the junctions and Symbolic links as per your need :) 

                Please do comment :)

                Tuesday, May 15, 2012

                Virtual Box disk resize



                We always run into deadlocks when we need extra space on virtual machines and since the hdd is already created it becomes a problem to re size a disk. lets walk through a fast way of doing so.Using VBoxManage and Gparted

                if you find reading as a boring habbit just follow the pictures :)




                1. Open a terminal and CD into your existing virtual disk, the location of the disk can be  found out by using step number
                2. Now create a new disk using
                  VBoxManage createhd --filename newone.vdi --size 3000
                   Where newone.vdi is the disk name if you see image above you can make anytype of supported image which means this method can also be used for vmware disks
                3. Now copy  contents of the disk which needs to be resize into this one using command
                  VBoxManage clonehd packed-disk2.vmdk newone.vdi --existing
                  where packed-disk2.vdmk is the original disk (10 gb )
                  newone.vdi is the new 30 gb disk
                4. Now open settings of virtual machine in question
                5. Now find the storage controller and the hdd

                  this can be used to locate the disk which needs to be resized

                  Now change this hdd


                  Remember your old disk still remains so if all this effort fails you can always switch back
                6. Now load the gparted iso file in the virtual machine

                  Same way the hdd was replaced , but this time choose the cd/dvd controller
                7. Now boot up the virtual machine

                  press f12 to get above screen then press c to select cd
                8. Now you will see gparted screen for booting

                  select 1st options and press enter
                9. Now gparted shows you some options like keyboard layout , screen resolution , type of card and how to start x server
                  my answers were 
                  1. Dont touch the keymap
                    1. Selected 33 us english
                  2. start of the x server automatically
                  3. resolution os 1024 X 768
                  4. depth 24 bit 
                  5. Vesa card
                10. Now you will see desktop , select Gparted icon

                  Will give you a screen like this , this point onwards you can right click the partition you want to resize or move and move then. Rules of using Gparted are kinda rigid , but are straightforward
                  1. you will have to adjust the partitions according to whats in front and behind the disk
                  2. and move them like a puzzle till you get what you want , the disks can be graphically resized
                11. Here is how it looked while processing
                12. Here is how it looked after the partitioning was done
                13. This is how the disk utility looked after i booted my virtual machine

                now after this you can either keep the earlier disk or delete it  , If the process goes wrong , then you can always restore you virtual hdd the way it was done in step 5 and you will have restored the hdd


                Please do comment :)