Category — Programming

Crontab & Mail Blogging

November 1, 2007 No Comments

Crontab

Apa itu crontab?, crontab (cron table) adalah suatu service di unix yang dapat menjalankan perintah secara berkala, jika anda menggunakan operating system windows mungkin anda terbiasa dengan scheduleSaya tuliskan definisi dari crontab yang aku ambil dari sini, sumber lain bisa dilihat di wikipedia.org

Definisi CronTab

crontab (cron table)

Schedule a command to run at a later time

Syntax
crontab [ -u user ] file
crontab [ -u user ] { -l | -r | -e }

Key

  • -l List - display the current crontab entries.
  • -r Remove the current crontab.
  • -e Edit the current crontab using the editor specified by theVISUAL or EDITOR environment variables.

Ada 3 argumen (perintah) dalam menjalankan crontab (lihat Syntax diatas) yaitu -l, -r dan -e masing2 digunakan untuk:

  • -l : melihat crontab yang terinstal
  • -r : remove crontab
  • -e : menampilkan editor default

untuk memilih editor bisa dilakukan dengan perintah

$ EDITOR=pico crontab -e

selain pico, ada beberapa editor lain seperti nano, emacs, vim. Tapi sebaiknya menggunakan default yang telah diset oleh webhosting kita, karena belum tentu editor lainnya terinstall di web server.

note: $ jangan di ketik. itu adalah default prompt.

[Read more →]

 

(Plogger Integration) Image Gallery

October 15, 2007 4 Comments

Pendahuluan
Sudah beberapa lama aku mencari aplikasi untuk web foto gallery, cari sana-sini tanya sana-sini
akhirnya dapat juga plogger, ringan, ukuran-nya yang kecil (tidak begitu membebani space web hosting ku :D ) dan semoga saja (berharap) bisa integrasi dengan Wordpress. Akhirnya selama liburan kemaren aku melalui beberapa malam buat integrasiin dengan Wordpress, menarik!.

Integrasi

Untuk melakukan integrasi ini ada beberapa hal yang aku perhatiin yaitu sebisa mungkin gak nyentuh core dari Plogger, tapi kenyataan nya ada juga yang tersentuh tapi sepertinya memang mau gak mau harus disentuh (pembelaan :D ). Oke ini list perubahan nya :

Pada Plogger:

1. File plog-globals.php (Core)

Perubahan yang ada di line 23

orignal :

[source:php]
require_once("lib/gettext/streams.php");
require_once("lib/gettext/gettext.php");

change to :

global $is_wp_embedded;

$is_wp_embedded = 0;

// Run dari root gallery
if (!class_exists('StreamReader'))
{
$is_wp_embedded = 0;
require_once("lib/gettext/streams.php");
require_once("lib/gettext/gettext.php");
} else {
$is_wp_embedded = 1;
}

Tujuan dari perubahan ini adalah memberi tahu ke engine plogger kapan dia diakses langsung dari web site gallery -nya atau dari Wordpress (embedded)

[Read more →]

 

Ten of the Biggest Mistakes Developers Make With Databases

June 5, 2007 No Comments

Ten of the Biggest Mistakes Developers Make With Databases
By Mike Gunderloy
March 6, 2006

Although fashions come and go in software development, some things stay remarkably constant. One of these is the use of databases. You may be wonderfully up-to-date with an AJAX Web interface or the latest whizbang Windows user interface, but under the covers, you’re probably still pumping data in and out of a database, just as we all did a decade or more ago. That makes it all the more surprising that developers are still making the same database mistakes that date back to those good old days of Windows 95 and before. Perhaps it’s just that most of us learn to use databases on the side, rather than really studying them. In any case, here are my nominations for the biggest mistakes that I see over and over again.

Choosing the Wrong Database

Not all databases are created equal — which means before you do anything with a database, you have to pick the appropriate database. Time and again I’ve seen Access databases groaning to bear the load of huge data sets that would have been child’s play for SQL Server, or harried users trying to pay for and set up SQL Server to hold a few hundred rows of data. Broadly speaking, there are three tiers of databases in the market these days: desktop and embedded databases suitable for smaller tasks, “Express” versions of the major players that are good up to a few gigabytes of data, and the truly enterprise databases like SQL Server, Oracle, and DB2 that can handle just about anything you can throw at them. Before you do anything else, you need to make some realistic estimates about the amount of data that you’ll be storing and pick the appropriate product to do the storage.

Choosing Too Many Databases

APIs such as ODBC, JDBC, and OLE DB have promoted the notion of database independence - the idea that you can write your application code in such a manner that you can plug any database at all in for data storage. Well, yes, but there are compromises. I’ve seen a lot of teams go down the rat hole of database independence, writing layers to translate all of their SQL statements to some lowest common denominator dialect that every conceivable database will support, and at the same time giving up on advanced features available in any particular database. The notion seems to be that some client in the future might want to switch to Oracle or DB2 or FoxPro or whatever, so it’s best to be prepared now. On the contrary: when you’re starting out with a new product, pick your storage engine and write to it. If your product is good, people will install the database you specify, and you won’t be wasting untold man-hours supporting “just in case” scenarios that you’ll probably never need.

[Read more →]

 

Sorting IP Address

May 24, 2007 No Comments

Ada pertanyaan tentang Query SQL di salah satu milis, pertanyaan nya seperti ini

Bagaimana cara mengurutkan IP Address, seperti berikut

192.168.11.10
192.168.3.19
192.9.1.55
22.1.164.22
22.212.8.39
22.76.32.47
3.77.202.225
3.77.202.6
3.8.137.98

Aku memberikan solusi sebagai berikut :

[Read more →]