Friday, July 3, 2009

partisi yang perlu ada ketika install linux

tadi ngerjain server yang maunya diisi sama linux.
cmn gara2 dah lama ndak nginstall linux, ku lupa buat partisinya apa aja yang perlu dibikin.
mana buku dapet dari pelatihan dasar administrasi linuxku pun tak ada.

untungnya ada temen satu ruangan yang punya buku instalasi fedora..
ni cocok banget .. soalnya ku emang mo nginstal fedora 10

so berikut yang harus dibuat partisinya:
1./boot, tipe : ext3, jumlah : <-- make yg default (200MB)
2. tipe : swap, jumlah : 2xRAM
3. /, tipe :ext3, jumlah terserah


ok yg laennya pilihannya cukup jelas ..

Tuesday, February 24, 2009

deklarasi kelas di c++

barusan aku bikin deklarasi kelas kek gini

class ServerReconet{
public :
ServerReconet();
~ServerReconet();

int initServerReconet();


private:
int no_port;
wxIPV4address addr; // default adalah localhost = 127.0.0.1
wxSocketServer *sr_server;
wxString *sr_text;
bool sr_busy;
int sr_numClients;
}
/** konstruktor
***
**/
ServerReconet::ServerReconet()
{
no_port = 3000;

//addr =
}

/** destruktor
***
**/
ServerReconet::~ServerReconet()
{
delete sr_server;
}

turn out pas aku build keluar error
error: new types may not be defined in a return type
dimana ntu error nunjuk ke line-nya konstruktor

binun kan
??
masak kontruktor ada return valuenya
???

akhirnya gugle
n i bump to this link --> http://www.daniweb.com/forums/thread90475.html
=="

ternyata oh ternyata

kurang semicolon setelah deklarasi class
so the class declaration should be like this
class ServerReconet{
// /bla bla

};

problem solved deh :d

Wednesday, October 22, 2008

parsing di java

ni lagi nyoba string tokenizer...

aku ada methods spt ini ..

int getNumWordInASentence()//String varString
{
String varString = "ini adalah testing. gitu loh";
StringTokenizer st = new StringTokenizer(varString);

System.out.println(st.countTokens());
while (st.hasMoreTokens())
{
System.out.println(st.nextToken());
}

System.out.println(st.countTokens());
return st.countTokens();
}


ternyata kalo nextToken dijalanin .. jumlah token akan berkurang .. ni aku coba sebelum n sesudah .. hasil countTokens nggak sami .. so bcareful when you used nextToken n countTokens.

aku ada methods spt ini ..

Monday, August 20, 2007

Install Excell lib di linux

[root@localhost package_install_frsource_batulayang]# /usr/local/apache2/php/bin/pear install OLE-0.5.tar
PHP Warning: PHP Startup: Unable to load dynamic library './/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so' - .//usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so: cannot open shared object file: No such file or directory in Unknown on line 0
install ok: channel://pear.php.net/OLE-0.5
[root@localhost package_install_frsource_batulayang]# /usr/local/apache2/php/bin/pear install Spreadsheet_Excel_Writer-0.9.1.tar
PHP Warning: PHP Startup: Unable to load dynamic library './/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so' - .//usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so: cannot open shared object file: No such file or directory in Unknown on line 0
install ok: channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.1
[root@localhost package_install_frsource_batulayang]#

Tuesday, January 23, 2007

Catatan Pada php.ini

Berikut ini adalah sedikit catatan pada php.ini yang saya peroleh ketika mencoba menyiapkan sebuah http daemon.

1. Ketika akan menggunakan tanda pembuka code buka kurung lancip '<' dan tanda tanya '?' alih-alih buka kurung lancip '<' dan tanda tanya '?' dan php [*ternyata blogspot tidak membolehkan tag pada input posting :) ], pastikan untuk membuka variabel short_open_tag
.
.
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
.
.
; Allow the tags are recognized.
; NOTE: Using short tags should be avoided when developing applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = On
.
.

2. Ketika menggunakan variabel global, pastikan untuk membuka variabel register_long_arrays dan register_arc_arv agar anda dapat memakai variabel array gaya lama (misal $HTTP_*_VARS dll
.
.
;;;;;;;;;;;;;;;;;
; Data Handling ;
;;;;;;;;;;;;;;;;;
.
.
; Whether or not to register the EGPCS variables as global variables. You may
; want to turn this off if you don't want to clutter your scripts' global scope
; with user data. This makes most sense when coupled with track_vars - in which
; case you can access all of the GPC variables through the $HTTP_*_VARS[],
; variables.
;
; You should do your best to write your scripts so that they do not require
; register_globals to be on; Using form variables as globals can easily lead
; to possible security problems, if the code is not very well thought of.
register_globals = On

; Whether or not to register the old-style input arrays, HTTP_GET_VARS
; and friends. If you're not using them, it's recommended to turn them off,
; for performance reasons.
register_long_arrays = On

; This directive tells PHP whether to declare the argv&argc variables (that
; would contain the GET information). If you don't use these variables, you
; should turn it off for increased performance.
register_argc_argv = On
.
.

3. Untuk server yang digunakan untuk pengembangan sistem sebaiknya semua error message dibuka agar diketahui semua kesalahan yang mungkin terjadi
.
.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Error handling and logging ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

.
.
error_reporting = E_ALL

; Print out errors (as a part of the output). For production web sites,
; you're strongly encouraged to turn this feature off, and use error logging
; instead (see below). Keeping display_errors enabled on a production web site
; may reveal security information to end users, such as file paths on your Web
; server, your database schema or other information.
display_errors = On
.
.
; Disable the inclusion of HTML tags in error messages.
; Note: Never use this feature for production boxes.
html_errors = On
.
.

4. Jika ingin menggunakan ASP, maka variabel asp_tags harus dibuka terlebih dahulu
.
.
;;;;;;;;;;;;;;;;;;;;
; Language Options ;
;;;;;;;;;;;;;;;;;;;;
.
.
; Allow ASP-style <% %> tags.
asp_tags = Off
.
.

5. Pastikan untuk me-restart http daemon agar perubahan yang telah dilakukan terhadap php.ini bisa dieksekusi.

Monday, January 22, 2007

Log Instalasi PDFLib-Lite

Posting ini merupakan rangkaian log instalasi terakhir, yaitu menginstal pdflib-lite.
Untuk lebih jelasnya silahkan membaca posting-posting sebelumnya.

Untuk menginstal pdflib-lite diperlukan dua file, yaitu:
> PDFlib-Lite : http://www.pdflib.com/en/products/pdflib-family/pdflib-6/pdflib-lite/
> pecl-php pdflib : http://pecl.php.net/package/pdflib

1. Ekstrak PDFlib-lite
[root@localhost package_install_frsource]# tar -xzvf PDFlib-Lite-6.0.3.tar.tar


2. Konfigurasi PDFlib-Lite dengan sebelumnya masuk ke folder PDFlib-Lite
[root@localhost package_install_frsource]# cd PDFlib-Lite-6.0.3
[root@localhost PDFlib-Lite-6.0.3]# ./configure --prefix=/usr/local
checking whether g++ accepts -g... yes
checking whether the previously found C++ compiler works... yes
configure: creating ./config.status
config.status: creating config/mkcommon.inc
config.status: creating pdflib-config
config.status: executing default commands
_____________________________________________________________
For your convenience, here's a summary of configure's results:

Support for shared libraries: yes
C++ language binding for PDFlib: yes
Java language binding for PDFlib: yes
Perl language binding for PDFlib: yes
Python language binding for PDFlib: yes
Ruby language binding for PDFlib: no
Tcl language binding for PDFlib: no
PDF import library (PDI): no
Large file support: yes
Note: if you purchase the additional PDF import library (PDI)
you can also manipulate existing PDF documents with PDFlib.
The additional block feature can be used to personalize PDF.
See http://www.pdflib.com for details.

Please observe the licensing terms for commercial PDFlib usage.
PDFlib license agreement and purchase order can be found in the doc directory.

[root@localhost PDFlib-Lite-6.0.3]#

3. Compiling
[root@localhost PDFlib-Lite-6.0.3]# make
.
.
make[1]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind'
make[1]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs'
make[2]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs/pdflib'
../../libtool --silent --mode=link gcc -static -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -g -O2 -D__NO_CTYPE -DPDC_PF_LINUX_IA32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPDF_PLATFORM=\""Linux"\" -I../../libs/pdflib -o pdfimpose pdfimpose.c getopt.c ../../libs/pdflib/libs_libpdf.la -lm
../../libtool --silent --mode=link gcc -static -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -g -O2 -D__NO_CTYPE -DPDC_PF_LINUX_IA32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPDF_PLATFORM=\""Linux"\" -I../../libs/pdflib -o pdfimage pdfimage.c getopt.c ../../libs/pdflib/libs_libpdf.la -lm
../../libtool --silent --mode=link gcc -static -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -g -O2 -D__NO_CTYPE -DPDC_PF_LINUX_IA32 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPDF_PLATFORM=\""Linux"\" -I../../libs/pdflib -o text2pdf text2pdf.c getopt.c ../../libs/pdflib/libs_libpdf.la -lm
make[2]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs/pdflib'
make[1]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs'
[root@localhost PDFlib-Lite-6.0.3]#

4. Installing
[root@localhost PDFlib-Lite-6.0.3]# make install
.
.
ake[3]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib/java'
make[3]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib/perl'
../../../libtool --silent --mode=install \
../../../config/install-sh -c -m 644 pdflib_pl.la /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
../../../config/install-sh -c -m 644 pdflib_pl.pm /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi
make[3]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib/perl'
make[3]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib/python'
make[3]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib/python'
make[2]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind/pdflib'
make[1]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/bind'
make[1]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs'
make[2]: Entering directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs/pdflib'
mkdir -p /usr/local/bin
../../config/install-sh -c pdfimage text2pdf /usr/local/bin
make[2]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs/pdflib'
make[1]: Leaving directory `/usr/local/package_install_frsource/PDFlib-Lite-6.0.3/progs'
mkdir -p /usr/local/bin
./config/install-sh -c pdflib-config /usr/local/bin
[root@localhost PDFlib-Lite-6.0.3]#

5. Instal pecl pdflib menggunakan pear, dan masukkan /usr/local/ (sesuai dengan konfigurasi pada langkah2)
[root@localhost PDFlib-Lite-6.0.3]# pear install pecl/pdflib
-bash: pear: command not found
[root@localhost PDFlib-Lite-6.0.3]# /usr/local/apache2/php/bin/pe
pear peardev pecl
[root@localhost PDFlib-Lite-6.0.3]# /usr/local/apache2/php/bin/pear install pdflib-2\[1\].1.2.tgz
.
.

651038 4 drwxr-xr-x 3 root root 4096 Dec 30 18:21 /var/tmp/pear-build-root/install-pdflib-2.1.2/usr/local/apache2/php/lib/php/extensions
651039 4 drwxr-xr-x 2 root root 4096 Dec 30 18:21 /var/tmp/pear-build-root/install-pdflib-2.1.2/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613
651031 264 -rwxr-xr-x 1 root root 264370 Dec 30 18:21 /var/tmp/pear-build-root/install-pdflib-2.1.2/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so

Build process completed successfully
Installing '/var/tmp/pear-build-root/install-pdflib-2.1.2//usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so'
install ok: channel://pear.php.net/pdflib-2.1.2

6. Edit php.ini dan tambahkan baris yang berhuruf miring (sesuai dengan hasil langkah 5) pada bagian Dynamic Extensions
[root@localhost PDFlib-Lite-6.0.3]# vi /usr/local/apache2/php/php.ini
.
.
extension=/usr/local/apache2/php/lib/php/extensions/no-debug-non-zts-20060613/pdf.so
.
.

7. Untuk testing-nya Copy file contoh Hello world untuk php5 (php yang diinstal sebelumnya adalah php5) dari http://id2.php.net/manual/en/ref.pdf.php. Letakkan di /usr/local/apache2/htdocs/. Kemudian panggil melalui browser

Monitor Frequency Over Range

Kejadiannya ketika saya mencoba install fedora, pada monitor muncul pesan seperti dari bios yang menyebutkan "frequency over range" dan setelah itu tidak ada tampilan pada monitor walaupun pc running normal. Setelah banyak bertanya, ternyata hal ini terjadi karena frequency yang kita setting pada saat instalasi bisa jadi melebihi kapasitas monitor. Atau bisa saja karena kemungkinan video card bentrok dengan monitor.

Berikut adalah langkah-langkah troubleshootingnya:
1. Gunakan monitor lain dan reboot pc (monitor keluaran sekarang seharusnya memiliki frequency yang cukup tinggi).

2. Login ke fedora dan ganti resolusi ke yang paling rendah (640x480) dan refresh rate menjadi 60 atau 50
(*di fedora5 : System > Preference > Screen Resolution

3. Reboot pc menggunakan monitor yang over range.

Jika ketiga langkah tersebut tetap tidak berhasil
1. Gunakan monitor lain dan reboot pc

2. Login ke fedora dan edit file xorg.conf yang berada di /etc/X11/, ganti driver dengan 'vesa' seperti baris yang berhuruf miring
[@localhost]#cd /etc/X11/
[@localhost]#vi xorg.conf
.
.
#sekitar line 84
Section "Device"
Identifier "Videocard0"
Driver "vesa"
VendorName "Videocard vendor"
BoardName "ATI Technologies Inc ES1000"
EndSection
.
.
:wq

3. reboot pc menggunakan monitor yang over range