Sunday, April 18, 2010

Learning PostgreSQL

What is PosgreSQL?
PostgreSQL is a powerful, open source object-relational database system. It has more than 15 years of active development and a proven architecture that has earned it a strong reputation for reliability, data integrity, and correctness. It runs on all major operating systems, including Linux, UNIX (AIX, BSD, HP-UX, SGI IRIX, Mac OS X, Solaris, Tru64), and Windows. It is fully ACID compliant, has full support for foreign keys, joins, views, triggers, and stored procedures (in multiple languages). It includes most SQL:2008 data types, including INTEGER, NUMERIC, BOOLEAN, CHAR, VARCHAR, DATE, INTERVAL, and TIMESTAMP. It also supports storage of binary large objects, including pictures, sounds, or video. It has native programming interfaces for C/C++, Java, .Net, Perl, Python, Ruby, Tcl, ODBC, among others, and exceptional documentation.

Friday, April 16, 2010

Create auto post plurk message status

What is plurk?
A really snazzy site that allows you to showcase the events that make up your life, and follow the events of the people that matter to you, in deliciously digestible short messages called plurks.

(http://www.plurk.com/faq)

To create auto post script you just need two tools:

  1. Cron job

  2. Wget orl curl


These tools is come with most any linux distribution as default  tools.

In this tutorials I will try to explain and focus in wget only.

1. Create very simple script

- Generate and save plurk cookies in file
tnto@ubuntu-linux:~$ wget --save-cookies cookies-plurk.txt --post-data 'nick_name=tnto&password=my_plurk_password_is_weak' https://www.plurk.com/Users/login

- Create single file (auto-post.sh) to load cookies file and send your plurk status message
waktu="Sekarang "$(date)
waktu2=${waktu// /%20}
wget --load-cookies cookies-plurk.txt --post-data "content= "$waktu2" (auto post)〈=en&location=&no_comments=0&qualifier=&uid=5758685" http://www.plurk.com/TimeLine/addPlurk

2. Create scheduling to run your script above

I will create a simple scheduling to running the above simple script every 15 minutes.

tnto@ubuntu-linux#crontab -e

# m h  dom mon dow   command
*/15 * * * * * /home/tnto/auto-post.sh
~
~
~
~
~

Thursday, April 15, 2010

Waiting for new ubuntu release

Todays GNU/Linux has become familiar operating system for everyone. It's can run in various machine. Linux comes with hundreds of good and useful free software. In open source software not only free to use the computer software, but you can get the source code too. You can modify or customize it. Ubuntu is one of hundreds (may be thousand) of linux distributions.
Ubuntu is a complete Linux-based operating system containing the very best free and open source software applications you need to work and play. With Ubuntu you can surf the web, read email, create documents, presentations and spreadsheets, edit images and more.

http://www.ubuntu.com/aboutus/faq

The image bellow is chart of linux distribution schema:

Linux Timeline

In thirteen days again, new version of ubuntu will come. I hope will come with new useful features.

Tuesday, April 13, 2010

Reinstalling Grub

Grub is a program which used to manage operating system if you install more than one operating system in single computer, for example you install Windows 7 and Ubuntu or another Linux Operating system.
GNU GRUB (short for GNU GRand Unified Bootloader) is a boot loader package from the GNU Project. GRUB (shortened form of GNU GRUB) is the reference implementation of the Multiboot Specification, which enables a user to have multiple operating systems on their computer, and choose which one to run when the computer starts. GRUB can be used to select from different kernel images available on a particular operating system's partitions, as well as pass boot-time parameters to such kernels. (http://en.wikipedia.org/wiki/GNU_GRUB)

The conditions grub problem appear:

Install GNU/Linux operating system and then install Windows family operating system although  in different partition from existing GNU/Linux operating system.

The conditions grub problem doesn't appear:

Install any Windows family operating system and then install any GNU/Linux operating system. GNU/Linux operating system will automatically detect another existing operating system.

If the second condition happen for any reason or condition you must, the existing GNU/Linux operating system will disapper from your computer. You must reinstall the grub (if you want to use grub), these steps will lead you reinstalling your grub:

  1. You need bootable CD of GNU/Linux operating system

  2. Insert the CD into your computer optic

  3. If live CD of GNU/Linux operating system ready open terminal program

  4. Mount existing partition which installed GNU/Linux operating system
    root@linux#mount /dev/sda1 /mnt


  5. Install grub
    root@linux#grub-install --root-directory=/mnt /dev/sda


  6. Reboot


Assumption:

The existing GNU/Linux operating system installed on /dev/sda1

Thursday, April 1, 2010

Quicksort Algorithm

Quicksort is a well-known sorting algorithm developed by C. A. R. Hoare that, on average, makes Θ(nlogn) (big O notation) comparisons to sort n items. In the worst case, it makes Θ(n2) comparisons, though if implemented correctly this behavior is rare. Typically, quicksort is significantly faster in practice than other Θ(nlogn) algorithms, because its inner loop can be efficiently implemented on most architectures, and in most real-world data, it is possible to make design choices which minimize the probability of requiring quadratic time. Additionally, quicksort tends to make excellent usage of the memory hierarchy, taking perfect advantage of virtual memory and available caches. Coupled with the fact that quicksort is an in-place sort and uses no temporary memory, it is very well suited to modern computer architectures. (en.wikipedia.org)