20081202

Intrepid On Acer Aspire 4720

Previous day, I had setup the latest Ubuntu on my sister's laptop. I
was surprised of how cool & beautiful Linux these days. It is even
easier to setup comparing to old days. I also compared Ubuntu with
Fedora Core 10 on my VirtualBox. I have to agree, I like pre-installed
Ubuntu better. Picasa also works great.

Now, with VirtualBox, she keep a copy of an uninfected Windows. She
still need it I for her iPod because iTunes doesn't work well with
Wine. But still a few issue she face - USB & Shared Folder in
VirtualBox.

20081125

Installing NTFS-3G on your Mac OS X will render your Windows drives invisible from your "Startup Disk" preference pane. [1] They suggested disabling or uninstalling to bring the disappeared drive back. But I accidentally see a Windows partition in my VMWare Virtual Machine Library.

20081120

Wth with my sort?

$ ls -al | sort -n +4
sort: open failed: +4: No such file or directory

20081118

Convert plist binary to xml, back and forth.

plutil -convert xml1 some_file.plist

plutil -convert binary1 some_other_file.plist

To check, use file something.plist

Leopard Re Installation: Part 2

I reformat using the same filesystem my external hard drive uses. Then set UID to 1000 in the System Preferences > Accounts > Advanced Options (right click on username). After that chown whole home directory.

Leopard Re Installation: Backup & Restore Issue

I wanted to replace my OS X Server because of lack of Internet Sharing feature. So I do both Time Machine backup and manual backup before making a fresh OS X installation. These are the issue that I faced.

Restoring using Time Machine right after Leopard Installation is not as I expected. There will be folders like 'System (from old mac)', 'Applications (from old mac)'. For me, this is not neat.

Your OSX filesystem must have the same format as your Time Machine backup filesystem. I'm using HFS Journaled with Case Sensitive, but my external hard disk is using HFS Journaled NOT with Case Sensitive. I have to reformat either my OS X partition, or my external hard disk.

Restoring files from Time Machine is strict because of UID. My user uses 501 as UID but my last Server system was using 1000 as UID. So restoring could get complicated.

Right now I'm going to change my UID and reboot and see what will happen.

20080927

Phone Number Fix on iPhone (localization)

Problem is iPhone doesn't recognize callers. Although they exist in the address book, iPhone only show their number with extra country code prefix.

Replace PhoneNumberTemplates.plist
in the /System/Library/PrivateFrameworks/AppSupport.framework

*Best to just backup/rename than to remove.

Custom Ringtones on iPhone

Convert audio file to use AAC codec and change the extension to m4r. Must not exceed 40 seconds.

Fix Youtube on iPhone

Unzip unlock.zip
to /private/var/root/Library/Lockdown and remove pair_records folder.

*Best to just backup/rename than to remove.

Fix Youtube

unzip unlock.zip to /private/var/root/Library/Lockdown
remove pair_records

20080917

Shell Auto-completion

I feel it is too late for me to realize that auto-completion using ESCAPE ESCAPE is actually came from a shell variable, $EDITOR

EDITOR=`which vi`; export EDITOR

Few servers gave me hard times on stty important function. So I:

echo "stty erase ^H
stty kill ^U
stty intr ^C
TERM=vt100
EDITOR=`which vi`
export TERM EDITOR" >> ~/.profile

20080910

Use putty to access vnc using ssh tunnel

This is to overcome firewall which filter connection on the application layer. In putty:

Hostname: ssh_server
X display location: localhost:0
Source port: 5901
Destination: vnc_server:5900


On vnc, connect to localhost:1

20080822

16:06 < codept> is there any tool to ...like ...present logs in the /var/log
...in more simpler format, let say httpd-access.log, a tool
that can analyze it and gives number of connection for each
unique source, ...that is just an idea
16:10 < geek00l> codept, we call it - awk, sed, sort, uniq, grep and fuck

20080813

Be Gentle With Your Keyboard

I just learn that, (after years of facing terminal), the more you minimize your typing mistakes, lesser the potential of screwing up or end up your work dissatisfied. It helps me thinking better too.

Think before you type. Think again before you press enter. Avoid typing too fast (because there are kids who think typing fast shows that they're good). Type slow not too slow, sit back and relax. Enjoy the cleanliness of your terminal output.

p/s: Yeah, I've worked with business critical environment... and I did screw up a few times :-p And this came to my mind while I was watching a 'really good' but not sys admin guy, typing neatly.

20080812

Start postgresql, create database and access it

Platform:FreeBSD

# su - pgsql
$ initdb -D /usr/local/pgsql/data
(if only doesn't exist)
$ postgres -D /usr/local/pgsql/data >logfile 2>&1 &
$ createdb test
$ psql test


Install: using ports
Binary location: /usr/local/bin
Don't forget to modify rc.conf

20080807

httpd.conf | php module

beside LoadModule php5_module libexec/apache22/libphp5.so



Edit Aug 12 2008:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

20080725

Diriwayatkan dari Abu Hurairah r.a., ia berkata: Rasulullah bersabda:“Wanita dinikahi karena empat perkara; karena hartanya, karena kedudukannya/ keturunannya, karena kecantikannya dan keranan agamanya. Maka, pilihlah yang baik agamanya niscaya engkau beruntung.” (Diriwayatkan oleh al-Bukhari (3/242), Muslim (2/1086), Abu Dawud (2047), an—Nasaa’i (6/6 8) dan Ibnu Majah (1858))

20080720

Failed to enable the 'httpready' Accept Filter

[bambino@bambino ~]$ sudo apachectl start
[Mon Jul 21 14:42:39 2008] [warn] (2)No such file or directory: Failed to enable the 'httpready' Accept Filter
[bambino@bambino ~]$ sudo kldload accf_http
[bambino@bambino ~]$ sudo apachectl restart
[bambino@bambino ~]$

After 7 years of no telephone line...

FUCK Telekom.

20080719

streamyx settings for ADSL wireless router

  1. enter correct username and password
  2. vpi : 0 (zaro or 8 if you want)
  3. vci : 35

using command line mail

Simply mail to recipient,

$ mail RECIPIENT

Enter subject, press enter, and type mail content. Ctrl + D to finish.

To include content from a text file, for example, msg.txt, simply enter ~r ./msg.txt at the first line of the mail content.

$ mail RECIPIENT -c CCPERSON

To list mail headers in inbox

$ mail -H

To list mail saved msg headers in mailbox (~/mbox)

$ mail -F

Inside mail console (don't really know what to call exactly), you can use h to list again mail headers, and enter any number to read specific mail.

RCS | Revision Control System

For first time:
  1. mkdir RCS (ignore if folder already exists)
  2. rlog example.conf
  3. if rlog returns no file or dir, check in the file and enter description:
    ci -u example.conf
  4. if rlog returns information, check out the file to edit: 
    co -l example.conf
  5. if it's not locked, you may edit the file with your favorite editor and save it.
  6. check in the file and write a log:
    ci -u example.conf
  7. you may check the information using rlog again.

Please make sure you understand before doing it. Google for RCS.

20080718

Set mysql root password

To set password for the first time:
$ mysqladmin -u root password NEWPASSWORD


To change password:
$ mysqladmin -u root -p OLDPASSWORD NEWPASSWORD


To login with password:
$ mysql -u root -p PASSWORD


To change password mysql sql command:
mysql> use mysql;
mysql> update user set password=OLDPASSWORD("NEWPASSWORD") where User='USERNAME';
mysql> flush privileges;
mysql> quit

20080716

Unresponsive Dock and Finder

I can't access Dock just now. No respond. And I'm unable to go through Finder too, so I can't get a touch on Terminal. I forced quit some applications, but there's only TextEdit which I left because there's work which wasn't saved yet. Then how do I rescue this without force quitting the TextEdit which I'm not even sure if it is the cause of all this? But I'm pretty sure that it was about the hung Dock. I really wanted to avoid logging out or reboot.

But user fast switch is enabled. I logged in as administrator and used terminal to kill other's Dock process.

PS=`ps aux | awk '{if($1="amanyus") print}' | grep -i dock`; kill $PS

PS is temporary shell variable to hold a value. This value is coming from a ps command after few filtering with awk and grep. Awk only print lines that match the first column with user amanyus, which result in all amanyus' processes. Next with grep, only match insensitive case dock rather that all processes under user amanyus because we only want to find Dock process and put in the PS variable. Up to this point, PS variable will hold the process number of amanyus' Dock. After the semicolon, the process will be killed.

Silly is you just can simply use ps aux | grep amanyus | grep Dock and kill the Dock's process without bothering with awk command =p

p/s: Hey, I forgot about spotlight at the first time to search Terminal, but not sure if it would work.

20080604

20080603

20080526

Screwed Up: Open Directory Part 3

drwx------+ 6 diradmin staff 204 May 25 16:36 Desktop
drwx------+ 22 diradmin staff 748 May 19 09:45 Documents
drwx------+ 109 diradmin staff 3706 May 25 18:52 Downloads
drwx------+ 42 diradmin staff 1428 May 19 09:18 Library
drwx------+ 9 diradmin staff 306 May 25 17:13 Movies
drwx------+ 5 diradmin staff 170 May 13 13:00 Music
drwx------+ 11 diradmin staff 374 May 25 15:40 Pictures
drwxr-xr-x+ 5 diradmin staff 170 May 14 08:58 Public
drwxr-xr-x+ 11 diradmin staff 374 May 23 00:06 Sites
drwxr-xr-x@ 314 diradmin staff 10676 May 26 09:47 mp3


The owner of my original home folder gave me a clue. They are all owned by directory admin. And I remember last time when I changed the Open Directory role to the Directory Master, we need to set password and verified it. There is also a username already written there as diradmin. So what I did is I set the role to standalone and set it back again to Directory Master. This time I replace the diradmin as my original account name. I backed up before commit to prevent any loss or the potential of my home folder be overwritten. Fortunately it doesn't. No files affected. The owner also automatically changed. And once again, the day is saved thanks to the powerpuff mac :-P

drwx------+ 6 amanyus staff 204 May 25 16:36 Desktop
drwx------+ 22 amanyus staff 748 May 19 09:45 Documents
drwx------+ 109 amanyus staff 3706 May 25 18:52 Downloads
drwx------+ 42 amanyus staff 1428 May 19 09:18 Library
drwx------+ 9 amanyus staff 306 May 25 17:13 Movies
drwx------+ 5 amanyus staff 170 May 13 13:00 Music
drwx------+ 11 amanyus staff 374 May 25 15:40 Pictures
drwxr-xr-x+ 5 amanyus staff 170 May 14 08:58 Public
drwxr-xr-x+ 11 amanyus staff 374 May 23 00:06 Sites
drwxr-xr-x@ 314 amanyus staff 10676 May 26 09:47 mp3

Screwed Up: Open Directory Part 2

amanyus:log root# host amanyus.puj52
;; connection timed out; no servers could be reached


After few smacks on the head lol, I played around with DNS service on the Server. I created a zone, named it and added machine record in it. That solved my problem.

amanyus:log root# nslookup amanyus.puj52
Server: 127.0.0.1
Address: 127.0.0.1#53

Name: amanyus.puj52
Address: 192.168.1.14

amanyus:log root# host amanyus.puj52
amanyus.puj52 has address 192.168.1.14


Since the DNS is clean, Kerberos finally running. But the my usual login still doesn't show up :-(

20080525

Screwed Up: Open Directory

Server is sucks when waking up from sleep. I suck too. Coz I made Server run on portables. I'm not sure of this but I think Open Directory or Kerberos service is affected by wake and sleep mechanism. There was time when my password doesn't work if I typed in immediately after the Server woke up.

Tonight something went wrong which I don't have any clue why. Failed to login even after few reboots. So I suspect the authentication system - which I'm not sure LDAP or Kerberos - might not running or maybe not even started. So I logged in as root and check the System Preferences where I found out that my usual account is gone. Now that really bothers me. I checked my home directory and fortunately it's there.

Server Admin show LDAP and Kerberos stopped. I've checked through numerous posts on the internet. There's one instruction that says to set the Open Directory role as standalone. I followed without knowing what I'm doing. And that is where I screwed up. I can't change back to the original role.

Now I have to figure out what the heck is happening. A lot messages in the logs like has got something to do with DNS. Hope someone tells me how to make the changeip happy.

amanyus:etc root# sudo changeip -checkhostname
Primary address = 192.168.1.12
Current HostName = amanyus.puj52
The DNS hostname is not available, please repair DNS and re-run this tool.

20080523

PHP and Leopard Server : mach-o, but wrong architecture

May 22 19:33:34 amanyus org.apache.httpd[96895]: httpd: Syntax error on line 143 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture
May 22 19:33:34 amanyus com.apple.launchd[1] (org.apache.httpd[96895]): Exited with exit code: 1
May 22 19:33:34 amanyus com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds



Insert installation disc. Open up terminal.


$ cd /Volumes/Mac\ OS\ X\ Server\ Install\ Disc/System/Installation/Packages/
$ open .



Run Essentials.pkg and install it to an empty filesystem or empty folder. the libphp.so will be inside [install_dir]/usr/libexec/apache2 directory.

Screwed Up: Apache2 & PHP Part 2

I went through tough times figuring out how. Google tried to help me but the results are meant for Leopard, not Server. I can't find any pre-compiled php for Server. I also tried to set CFLAGS and LDFLAGS as intruction for Leopard and the compilation failed.

At last I solve it with the Server Installation disc. But you can't find it simply by Finder. Even if you use Finder to look into the package contents, still you won't find the packages used to install all the Server components. I spawned up my terminal and go through the installation disc. There are a lot of packages and I have to install one by one on an empty filesystem so that I will know what each package for. And I found what package installs the libphp.so - the fix is in the next post.

It is fixed. What a relief.

20080522

Screwed Up: Apache2 & PHP

I screwed up. I overwritten pre-installed PHP on Server that cause problem for Apache startup. God help me.

May 22 19:33:34 amanyus org.apache.httpd[96895]: httpd: Syntax error on line 143 of /private/etc/apache2/httpd.conf: Cannot load /usr/libexec/apache2/libphp5.so into server: dlopen(/usr/libexec/apache2/libphp5.so, 10): no suitable image found. Did find:\n\t/usr/libexec/apache2/libphp5.so: mach-o, but wrong architecture
May 22 19:33:34 amanyus com.apple.launchd[1] (org.apache.httpd[96895]): Exited with exit code: 1
May 22 19:33:34 amanyus com.apple.launchd[1] (org.apache.httpd): Throttling respawn: Will start in 10 seconds



Edit: I suspect that the libphp5.so not compiled to match the correctly architecture. So to make the apache running, I hashed out 2 lines that load php module inside /private/etc/apache2/httpd.conf. It runs but without php support. So localhost:80 show a nice Server webpage. I also notice that my computer automatically downloads a php source hehe. Because it is un-identifiable.

20080520

Keyboard Volume Control

Silent Volume Control: Shift + F4 or F5
Detailed Volume Control: Shift + Alt + F4 or F5


personal statement | i didn't know they could do this, I was surprised...

Size Comparison between TIFF, JPEG & PNG


These are file info for 3 images with different format. It occur to me when I was wondering which format have the best optimization for size, regardless of the quality. Grab application (in Utilities) save snapshots to a TIFF format. I agree Grab made for quality but in a web arena, size does matter. Bandwidth affect a lot of things. Web hosting limited bandwidth, download time and most importantly, our browser cache - performance. So why wait, create an automator plugin

For decoration only.


But it is a different case for screenshot shortcut key. By default it will automatically save to your Desktop as PNG format. Surprisingly, JPEG size is a lot better.


ps | view list of shortcuts key at the System Preferences > Keyboard & Mouse

20080519

Make Blogger Text Justified


By default, blogspot doesn't give you the option to justify text. It looks ugly if its not. So go to you blogger setting and edit the HTML. Insert this line under the Posts section.



Then you will get justified text like what you see on my every posts here. "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."

Access iPhone using Finder

First, make sure you have AFP installed on the iPhone - you need Installer. Turn on Airport on your Mac and create network from the airport icon menu. If the network is set, you'll see the airport icon changed. Set iPhone to join the network you just created. Take note of the iPhone IP address. On your mac, activate Finder. From the top menu, choose Go > Connect to Server. Type you iPhone IP address like this example. You will be prompt for login. Type 'root' as user, and 'alpine' for password. Choose Root's Home instead of Root Filesystem because the earlier has bigger disk space.

For what? iPhone as your wireless external disk drive.

Maxis 3G Information

Account Name: maxis, Password: 123, APN: unet




20080516

Get Automated

Automator has been there since Tiger. I had a lot of Automator plugins on Tiger last time. The main goal of Automator is it can simplify repetitive work thus save you a lot of time.


I take digital photo experience as an example. When we take pictures using the digital camera, it normally save the file using a combination of letters and sequential number, right?


Let say we want to rename all image files so they will be more meaningful. Automator lets you rename all of them once without you rename each file one by one.


You can save every workflow you created as a plugin. Plugin can help you run workflow directly from your Finder so that you don't have to create the same workflow each time you come to a same task.

Infrared Apple Remote Does Work, FrontRow Can't Find iTunes Songs


Infrared remote is disabled by default on Server. You can find the option under Security section in System Preferences. Then you will discover that FrontRow would not be able to find songs in your iTunes. Thanks to appleguru1, he repackaged the original update and made it available for download.

If you want to backup your original files before upgrading, copy your:
/System/Library/CoreServices/Front Row.app
/System/Library/PrivateFrameworks/BackRow.framework
/System/Library/LaunchAgents/com.apple.RemoteUI.plist


Window minimize disabled. I wonder when Apple will solve this. It's been bugging me since Tiger.

It intrigues people when...

May 16 15:13:59 amanyus ReportCrash[6560]: Formulating crash report for process Finder[226]
May 16 15:13:59 amanyus com.apple.launchd[207] ([0x0-0xb00b].com.apple.finder[226]): Exited abnormally: Segmentation fault
May 16 15:14:02 amanyus mDNSResponder[30]: SetupAddr invalid sa_family 0
May 16 15:14:03: --- last message repeated 1 time ---
May 16 15:14:03 amanyus ReportCrash[6560]: Saved crashreport to /Users/amanyus/Library/Logs/CrashReporter/Finder_2008-05-16-151352_amanyus.crash using uid: 1000 gid: 20, euid: 1000 egid: 20


...because it is rare. At least it didn't take any other application down. Just auto-relaunch Finder.

20080515

Shortcut : Empty Trash

shift + command + delete when your Finder is active.

I accidently discovered this few weeks ago. Sometimes we are in the mood of keeping the trash clean. But it is safe to keep trashed files before we realized our now-it-is-important thing gone.

Spotlight Doesn't Search a Thing

Open Terminal application (Application > Utilities > Terminal) and run this command:

sudo mdutil -a -i

This command will turn on indexing on all volumes except impossible volumes such as DVD volumes and unsupported filesystems volumes. mdutil command is a command to manage the metadata stores used by Spotlight. Every volumes are separated-ly managed. Means for example you can turn on indexing on /home only instead of all volumes.

You can check the status first before simply turning on by running this command:

sudo mdutil -a -s

There is a good side for enabling indexing on few Volumes. It will narrow down search with the area that we want. Definitely we don't have to go through / to search documents in /Volumes/ExternalDisk.

PS: Volumes is not mount points. Volumes can be seen on your desktop. The hard disk icon, Macintosh HD is a volume.

Once you turn on indexing, you can see a slow blinking dot at the spotlight button at the top right corner of your Mac.

20080514

Thank You



Since my girlfriend had the privilege to buy Apple product for cheaper price, I asked her a favor. She was very lucky to purchase a MacBook Pro at insanely good price. You'll dropped your jaw if I tell you :-D

I let my girl use it for a couple of days. She is so happy I can tell. She never really have the chance to really feel owning a laptop in her room. And for few days, we had wonderful time.

Yes, MacBook Pro is a sleek and beautiful machine. But when my girlfriend handed it to me, I did not turn it on right away. I had personal problem that day, and even the problem disappeared, the machines didn't really interest me. At that night, when I was so boring and my girlfriend seems a bit disappointed when she knows I didn't even take it out from the bag, I light it up. Yeah. It is Leopard. My mom have a MacBook and I've played with Leopard so looking at my MacBook Pro still nothing to me. The nice metallic machine didn't captivate me at all because I have experience my PowerBook for 5 years.

Until I started to USE it. Yes. I admit. Software captivates me a lot. Every button, every option and every menu I explore on Leopard, they sit perfectly. Apple programmer really knows how to balance the need and not need. They have added so much features and most of them I craved on when I use Tiger last time.

But that didn't fully satisfied me. With dual core, this machines wasn't really do much work. Guess, what is my attempt on my PowerBook last time? PowerBook running Leopard Server. Yes. It didn't work. My PowerBook can't read dual layer disc. There are few workaround I used, but no avail. The next day I went to my bachelor house - is this what people call? :-p - and grab the dual layer disc and install Leopard Server. Hehe. It feels like I'm rocketing to the sky! I have used all names of server - Solaris, HP-UX, Linux, FreeBSD - but this is the NEATEST UNIX SERVER EVER!

Since this post is not about Server, I will stop now. I'm sure I got a lot coming. Only software excites me. And only that excitement can lead me to blogging :-)

PS: I want to thank my girl. You are a wonderful person. Take a good care of my tiger, baby.

❖ Boot Camp : Ignore the Installation Guide


Yes, ignore it. You don't need it. What you need for boot camp setup is this post :-p which have I kindly made you a list. You need:

1. Windows Installation CD for installation of course.
2. Leopard Installation CD that will take care the drivers for you.
3. Gut. Which you don't really need because Boot Camp will cause you no pain.

During the journey you should:

1. Format the prepared partition named BOOTCAMP. Just choose (quick) because you can't wait to see Windows on your mac right? I choose FAT32 so that I can write files to it when I'm running Leopard. But if you want the more advance NTFS, no problem.
2. When Windows is installed, you may find that the eject button on your mac keyboard is not working. Simply go to My Computer and right click on the D: drive. Choose eject from there. Then insert your Leopard installation disc and you'll be surprise that the setup is just in one click.

I got a hiccup during my first and second attempt, so I advise you to use a good version of XP or Vista.

PS: I love mac. I have to use Windows because people pay me to.