Thursday, August 30, 2012

Upload files to Google Drive from other website

If you want to upload file, example a pdf file that resides on another website, you will have to download the file into your local PC before you can upload it to Google drive. To speed up this process, actually you can directly paste the link into open file dialog box and let the Windows OS do the work for you.

When you are in Google Drive, just select upload Files...


In the File Open dialog, just paste the url link directly into File name: box


After you click Open, the File Open box will grey out for a while (depend on your file size and connection speed as Windows is taking time to download the file). Once the File Open box disappear, you will see your file get uploaded to Google Drive.




Wednesday, August 29, 2012

Get Singapore Stock Market Quotes in Google Docs

*20 August 2018 update: Due to data unavailability for both Google Finance and Yahoo finance, i had created a new Google Apps Script to download and import SGX daily price list data to Google sheets. Please refer to this link for details.

* 24 Feb 2014 update: Recently, i have had some problem with getting the result from Yahoo finance and the cell always show #VALUE! with error - "The data could not be retrieved. Please check the URL". I tried to use GoogleFinance again and it seems like they finally start to support SGX stocks. So to get the price of stock like Keppel Land, just type the following in the cell

=GoogleFinance("SGX:K17")

So the syntax is quite easy, just type in the stock quote name with SGX: precede in front. The only problem is the limitation of 2 decimal points...

For more information on what data can be retrieved, please refer to this link.

=====================================================================

If you are using Google Docs to keep track of your stocks statistics, this will be something very useful to you. By having the ability to import stock market quotes directly, you can manipulate this data further, example - to calculate paper gain/loss quickly.

Google actually provide a useful tool which is GoogleFinance* for this purpose but unfortunately, Singapore stock is not supported. Luckily, there is still this tool call ImportData which we can use to import structured data from other website like Yahoo Finance.

To do this, first,  you need to know your stock symbol. You can get this easily by typing the stock name in the get quotes field. Screenshot shows the list of possible stocks after i type in Keppel Land.


After you know your stock symbol, you just need to type the following in the cell of your spreadsheet document and replace the italic word with your own options. You can go to the following link for all the special tag options.

=ImportData("http://finance.yahoo.com/d/quotes.csv?s=stock symbol&f=special tag")

For example, if you want to get last trade price for Keppel Land, i just type the following:

=ImportData("http://finance.yahoo.com/d/quotes.csv?s=k17.si&f=l1")

and that's it, you can see that Google Docs will load the last trade price in the cell as shown below:




Thursday, August 2, 2012

Configure ramdisk for Openfiler


Create a new file under /etc/bootloader.d directory. In this new file, type add_options ramdisk_size=32000. Please note that the unit is in kilobytes. The example below shows the new file is called ramdisk.conf and the content of this file.

[root@abc ~]# cd /etc/bootloader.d
[root@abc bootloader.d]# ls
distro-defaults.conf  plymouth-bootloader.conf  ramdisk.conf  syslinux_bg.png
[root@abc bootloader.d]# more ramdisk.conf
add_options ramdisk_size=32000


After the file is created, type bootman to apply the configuration as shown below

[root@abc ~]#bootman


Restart your machine and you can check whether is it successful by typing cat /proc/cmdline as shown below:

[root@abc ~]# cat /proc/cmdline
mce=dont_decode cciss.cciss_allow_any=1 splash quiet ramdisk_size=32000 ro root=LABEL=/ initrd=/initrd-2.6.32-71.18.1.el6-0.20.smp.gcc4.1.x86_64.img BOOT_IMAGE=/vmlinuz-2.6.32-71.18.1.el6-0.20.smp.gcc4.1.x86_64


Create a filesystem on /dev/ram0 and mount it up and you will have a 32MB ramdisk.