Friday, January 14, 2011

Google Docs on Google Sites

My friend and I are making a game together, but we dont live close by. So mostly we use Google docs to write the storyline and other simple documentation. So because Google made it easy to use we also put together a Google Site Page for our project. But when we wanted to put our documents onto our site we noticed that it felt less profesional (even though using google sites in the first place is less profecssional). Regardless I wanted a way to view specific documents while not leaving the site. So I tried publishing the documents but that was even worse becasue the width of the page was the 100% width of the browser window. From that i wondered if I could embed the document within the site page, and that worked like a charm. the only problem was that we have lots of different documents and we dont want to create a seperate page for all of them. So I created Gdoc Display gadget. It lets you dynamically load published Google docs into your web page, and resized the web page so that the entire document fits without having to put in an extra scroll bar. The way it work is by looking at the url of the page for the document ID number. For example if your site was called "gamesite", the URL would look something like http://sites.google.com/~/gamesite/. so you would make a page called docs and put the gadget on the page, and the url for that page would be ~/gamesite/docs so in order to actually load a document you need to put the ID on the url so in order to do that wherever your hyperlink is you put ~/gamesite/docs?DOCID where DOCID is the ID number of the document. In order to find the document ID number you look at the URL for the published document. At the end of it there is a ?id= and then a long number copy that number and there you go. Now, in order to add the gadget to the page you need to add a gadget by URL and use: http://hosting.gmodules.com/ig/gadgets/file/116731940771101949147/gdocdisplay1-0.xml once you have done that you are good to go. Any update to the gadget will be automatically applied to your web page as well.

Thursday, May 27, 2010

Making a programming Blog

First you need to set up what you want the site to look like. For code it is better to have blocks that are separated from the rest of the text
like this block here
This block can be created by using the following HTML/CSS code
<div style="border: 1px solid rgb(51, 51, 51); background-color: rgb(204, 204, 204); padding: 2px; margin: 5px 20px; color: rgb(0, 0, 0);"><tt>
code here
</tt></div>
The <tt> tag is used to make the text inside teletype making it look more like code. By changing the values inside style you can change how the box looks.

Next things are tabs, if you know anything about HTML, tabs and other white space are ignored so you cannot use tabs, what you can do is use div tags with left margins

so you can
do something like this
with multiple indented lines
To do this you use the code
<div style="margin-left: 25px;">
indented code here
</div>

The last thing you need to know is what do do if you are trying to display a tag like <tag> because HTML will think that it is a tag and not something that you want to display
<
>
&
 
"
®
©
&lt;
&gt;
&amp;
&nbsp;
&quot;
&reg;
&copy;
less than
greater than
ampersand
non breaking space
double quote
registered trade mark
copyright

Setting a static IP address on Debian 5.0

To give debian a static IP address change the file
/etc/network/interfaces
Find the line that reads
iface eth0 inet dhcp
and change it to
iface eth0 inet static
address 192.168.1.xxx
netmask 255.255.240.0
gateway 192.168.1.xxx
Where the IP addresses are whichever addresses you need to put in. If the computer was hooked up as DHCP and it connected to the server then the DNS server values are already set (they are contained in a different file) when you are done you can restart the network configurations but the cleanest way is just to restart the computer