Mac Os X Unresponsive Dock, Exposé and Dashboard

Posted October 23rd, 2009. Filed under Sharing elmu

Sometimes in Mac Os X you will experienced this error, even you cannot use ‘command + tab’ function to move between applications. Luckily I have quicksilver installed, so I still can move or open another apps. There is a quick fix for this actually, just open terminal type this command : killall Dock. This will restart dock and fix the errors. If you start to experienced this several times then you need to do Repair Disk from Disk Utility when booted from the install DVD that comes with your mac package (note: this is different with Repair Disk Permissions!).

Change CD Key for Office 2008 Mac

Posted July 17th, 2009. Filed under Sharing elmu

Niche feature in Microsoft Office for mac is it not allowed a serial number (for personal license) installed in more than 1 computer in the same network. If that already happen you need to change your serial number, here is some tricks to do that :

  1. Quit all open Microsoft Office applications
  2. Go to directory /Applications/Microsoft Office 2008/Office/
  3. rm OfficePID.plist
  4. Go to directory ~/Library/Preferences/Microsoft/Office 2008/
  5. rm Microsoft Office 2008 Settings.plist
  6. Launch one of the Office applications to go through the Setup Assistant and enter the new license key :)

Upper, Lower Case and Trim

Posted March 3rd, 2009. Filed under Sharing elmu

Here is simple example how to set upper and lower case in shell script :

var="sAmplE teST"
var_ucase=`echo ${var} | tr [a-z] [A-Z]`
var_lcase=`echo ${var} | tr [A-Z] [a-z]`
echo "Upper Case : ${var_ucase}"
echo "Lower Case : ${var_lcase}"

Here is example how to trim variable in shell script :

var=" 322245 "
var_trim=`echo ${var} | sed 's/^ *\(.*\) *$/\1/'`
echo "Trimmed var : ${var_trim}"

Grant All Tables

Posted February 8th, 2009. Filed under Sharing elmu

This is simple example how to grant all tables in specific schema for Postgresql or its similar like Greenplum.

See this command :

psql -t -c "\dt schema_name.*" | awk '{ if ($1!="") print "GRANT privileges ON public."$3" TO user;"}'

You need to spool command above to a file and run it as follows:

grant.jpg

Routing Table In Mac

Posted February 7th, 2009. Filed under My Job Sharing elmu

Sometimes we need to have multiple network connection in one time. Yep,,, I really need it right now. Because have no internet connection when work on site at client. So I brought my 3G modem for solving this problem. But make sure you route the connection between 2 network so it will runs both at the same time.I decide to set my modem priority higher than ethernet because I only need to connected to specific IP class. First thing to do is set modem network priority in System Preferences.

set_prior1.jpg

set_prior2.jpg

After that connect your first priority network, in my case is the 3G modem and plug the ethernet cable. After connected you can use internet connection but can’t work since it hasn’t routed yet. Open your terminal and logon as root (not user with root privileges) and type

netstat -nr

to show your routing table, you will get result similar like this :

netstat.jpg

If you see default interface used is ppp0 which is my 3G modem instead of ethernet. To make ethernet network connected you need to route it like this :

route add 172.16.xx.xx -netmask 255.255.255.0 172.16.xx.xx

After that check routing table again to make sure new routing information added. Now I can work by connected to ethernet network and still have internet connection from my modem :)

0204092432.JPG

Mailx on Solaris

Posted September 7th, 2008. Filed under Sharing elmu

Need to send email from Solaris box? It’s very easy…

Just configure SMTP server on

/etc/mail/sendmail.cf

or

/etc/mail/local.cf

depend on your sendmail conf will be use. And then edit DS part into DS[your smtp hotname or IP] like

DS192.168.1.1

*without space*

After that restart sendmail service using command :

svcadm restart sendmail

Now we can use mailx…

echo "This is test email" | mailx -s "Test Email" test@test.com

or

cat file_name | mailx -s "Test Email" test@test.com

Solaris Cron

Posted August 17th, 2008. Filed under Sharing elmu

Have you experienced problem with Solaris cron when crontab -e command doesn’t work as usual? Cannot edit your crontab file? Things always different on Solaris, try to do:

export EDITOR=vi

and then run:

crontab -e

don’t forget to run crontab -l to see if the changes are applied. That’s will solved the problem.

Greenplum Database

Posted December 8th, 2007. Filed under Sharing elmu

Database enterprise dengan MPP (Massive Parallel Processing) yang berbasis PostgreSQL yang open source. Database ini di design untuk men-support aplikasi Business Intelligence dalam skala besar dengan multi terabyte data untuk solusi data warehouse.

Kelebihan-kelebihannya antara lain :

Open Source

Berbasis PostgreSQL, salah satu database open source yang sudah terbukti kehandalannya. Selain itu menawarkan banyak kelebihan lainnya yang tidak ada pada software enterprise komersial.

Commodity Hardware

Dapat berjalan optimal pada server yang tidak terlalu mahal. Di desain dapat berjalan pada hardware HP, Dell, Sun standar sehingga biaya utuk setiap terabyte’nya lebih murah.

Shared Nothing Architecture

Menggunakan pendekatan shared nothing architecture dimana membagi penyimpanan menjadi beberapa unit kecil dengan proses independen sehingga mempercepat koneksi ke local-disk secara parallel tidak seperti arsitektur pada umumnya yang menggunakan OLTP sehingga membutuhkan resources yang besar pada setiap prosesnya karena menggunakan single processing.

High Availability

Mempunyai pengaturan yang baik sehingga tidak terjadi redundancy pada pemrosesan datanya. Setiap segmen data mempunyai cadangan (mirror) pada host yang lain yang otomatis me-redirect koneksi pada alternative host cadangan. Hal ini membuktikan bahwa Greenplum mempunyai sistem fail-over yang baik. Paralel prosesnya juga memungkinkan untuk load data 2 terabyte dalam waktu satu jam.

Workload Management

Membatasi jumlah queri aktif di dalam sistem untuk mencegah overload memori, CPU dan I/O disk. Queri-queri diatur dalam antrian dan diproses secara parallel sehingga waktu yang dibutuhkan tidak banyak dengan menggunakan minimum resources.

Scalability and Flexibility

Greenplum memiliki pengaturan ekspansi host, penambahan database baru yang mengimplementasikan arsitektur sebelumnya untuk pengembangan data warehouse.

Performance and Price

Dapat menghemat sampai 80% cost dibandingkan dengan solusi data warehouse lainnya seperti Oracle, Teradata dan Netezza. Performancenya tidak kalah dengan solusi lainnya karena arsitektur MPP dapat membuat queri 10 – 100 kali lebih cepat.

Regular Expression

Posted December 1st, 2007. Filed under Java Sharing elmu

Regular Expression ato regex itu digunakan untuk parsing file yang memiliki format tertentu yang sama sehingga bisa di definisikan satu kali saja dan tidak perlu mendefinisikan ulang untuk format yang sudah ada (kira2 menurut gw sih begitu).

Misalkan kita punya file csv/txt berisi data karyawan (nama,telp,tgl lahir, dll) sebanyak 1 juta records/ line. Format penulisan telp bermacam-macam dikarenakan tukang entri datanya beda2, cth : (0251)-345677, 6281243095, +62234134 ato yang laennya. Nah, bos kita kan biasanya pengen yang macem2 tuh kaya misalkan format harus di seragamkan semuanya. Weks…! 1 juta records…? mati aja kali. Di sini regex bakalan kepake n’ terasa manfaatnya (banget…!).

Solusi :

public String toNumericOnly(String input) throws RESyntaxException {
      String pattern = "[^0123456789]";
      RE r = new RE(pattern);
      String alphabetOnly = r.subst(input, "");    return alphabetOnly;
}

Thats all, ntr karakter-karakter yang gak di define di pattern bakal di ilangin. Anyway, lib regex’nya bisa di download di Jakarta Apache.

MySQL Stress Test

Posted October 24th, 2007. Filed under My Job Sharing elmu

Sebelum lebaran gw di suruh tes mysql, sanggup ampe gimana tuh… sama tes cara insert mass data ke mysql n’ this is the results :

Using Stored Procedure in MySQL GUI (SQLyog) 100msg/sec
insert 60000 record
start 09:26:59
end 09:54:36
time –> 27:37
max memory usage 1.57gb

Using Stored Procedure in Command Prompt 100msg/sec
insert 60000 record
start 10:11:26
end 10:37:33
time –> 26:07
max memory usage 385mb
Using Load File
Generated 1.000.000 records using script –> BulkLoad.java
Start 09:32:46
End 09:34:09
Elapsed 1 minute 23 seconds
Load file into database (using navicat)
Elapsed 566.688sec or 9 minutes 45 seconds
max memory usage 350mb

Gila, load file tuh cepet banget gak ada duanya… cuma perlu bikin script buat generated load filenya aja (yang bagus tentunya…!)