Sunday, 25 July 2010

An @ Symbol in OS X File Permissions and the Problems That Came

Today I was deploying some software updates in our Solaris 10 servers and, since such updates are distributed in files archived with the GNU tar utility (not shipped by default in Solaris 10), I had to convert them before moving them to our servers. I'm quite accustomed to such a procedure: that's why (amongst other more important reasons) I always have an OpenSolaris virtual machine running in my other desktops (thanks to VirtualBox).

Today, notwithstanding the fact the I had a gut feeling that I was not doing the correct thing, I decided to open a Mac OS X terminal and do the job from there. GNU tar and pax are there, aren't they? There should not be any problem, thought I.

Well, I should have paid attention to that gut feeling of mine: to spare the required OpenSolaris boot, I lost much more than what I had planned. I learned something new but... what was it worth? A bunch of non portable behaviours of Mac OS X? Just the confirmation I needed, once again (I realize I'm a stubborn fellow): if you can, do not rely on a Mac to do your UNIX-ish tasks. Chances are you're going to waste more than you believed.

This is what happened.

Making a pax File for a Solaris Host

This was meant to be a quick task. I copied the archive from a Solaris NFS mount where, some days ago, I had stored the file. I ran gunzip to decompress the file, ran tar to unpack the files, ran pax to store the resulting directory in a pax file and used rsync to quickly transfer the resulting archive back to the target Solaris machine:

$ gunzip [file.tar.gz]
$ tar xf [file.tar]
$ pax -w -f ./[file.pax] [dir]
$ rsync -vz --inline [file.pax] [myserver]

I then connected to the target server and used pax to explode the transferred archive. Since one of the things I feared was Mac OS X messing around with file permissions, I quickly checked the results on the Solaris side and everything looked fine. Well, sort of...

The next thing I usually do with such bundles is checking the differences between the running version and the soon-to-be-deployed one to be sure I won't miss any customization I made in the instance to be patched. It usually is another easy job since very few XML files are usually involved. Great was my surprise when diff began to write out hundreds of differences between one version and another.

Doh! It seemed as though somewhere in between somebody had decided to duplicate each file following a naming pattern; if the expected file was named x, I was seeing two files in Solaris: x and ._x. Where did these file came out from?

Back to the Mac

The original directory had been deleted just after producing the pax file so that the first I did was using pax to unpack the archive in the Mac. As I told you, everything looked fine. Except for an @ character that should not be there:

drwxr-xr-x@ [...snip...]

Maybe you don't know about it but that means that such a file has extended attributes set. Extended attributes are basically metadata: the file system does not interpret them and the ls command uses the @ symbol after the file permissions to inform you that they are there.

Strange Things Are Happening

There's nothing strange about extended attributes: it's very important to be aware of their existence to correctly handle them when, for example, you need to do a backup or move files from one file system to another (unless you don't mind losing them.) Solaris' pax and tar, for example, both support archival of extended attributes even if, by default, they ignore them. Since I know that my original archive had no extended attribute set in any of its file, I just ran a plain pax to build my archive. Maybe OS X pax defaults to a different behaviour so that I checked pax man page.

Doh! Oddly, OS X pax man page makes no mention at all of extended attributes, notwithstanding the fact that, undoubtedly, it was in fact managing some. Which? In OS X, just run xattr -l to find out.

Quarantine

A xattr told me that the com.apple.quarantine extended attribute was set in the culprit and a quick script confirmed that every file in that directory had that attribute set. According to Apple's documentation, that attribute is set by recent versions of OS X to mark the file as a potential threat. Do you remember when finder kindly asks you if you're really sure you want to open a downloaded file? The quarantine extended attribute is the mechanism OS X programs use to store that information.

How did it make it there?

But wait! I downloaded a tar.gz file and stored in an NFS 4 mounted file system for later processing. The question is:
  • How did that attribute was stored in the NFS 4 file system where I stored the file?
  • How did that attribute make it into every file stored into the pax archive?

As far as it concerns the first question, NFS 4 does support extended attributes. But again, should it be there, I would have known because I checked it directly in the Solaris host and, moreover, the box that acts as a NFS server runs some cron scripts that checks (and fixes to my taste) ACLs and extended attributes in some of the exported NFS file systems. It was very easy to find out that OS X, when storing such a file in a remote NFS share, instead of using NFS 4 extended attributes it stores them in a separate file named with the pattern mentioned above. I then discovered that the shared NFS file system in question is plagued by ._* files. Everywhere.

As far as it concerns the second question, well... I copied once again the file using the finder and performed the same operations I did before. The resulting files all had the quarantine extended attribute set. Who's the culprit, I do not know. I don't even care. The fact is that OS X is performing this operation with tools such as pax and tar without informing the user and, what's even worse, without even mentioning it in such commands' man pages.

Conclusion

The reasoning above explains why, even if Solaris pax (such as NFS) aren't managing any extended attribute, I did end up with duplicated files which were inserted into the pax file produced with Mac OS X. Probably they aren't going to hurt my deployment but surely they should not be there.

For the sake of curiosity, I checked that removing the ._* files in the NFS share made everything go back to normal.

Nevertheless, since I feel there are many OS X dark corners left for me to discover, I won't be making such an error again. Instead of waiting a couple of minutes for a virtual machine to bootstrap, I ended up wasting an entire hour for a (yet another...) bad documented and non-portable idiosyncrasy of an operating system that brings no added value with it.

Sunday, 18 July 2010

openSUSE 11.3 Released - Comes With Superior Support For Netbooks

openSUSE 11.3 - the latest version of Linux distribution from Novell has been released. One of the highlights of openSUSE 11.3 is its enhanced support for netbooks.

openSUSE 11.3 provides improved hardware support for netbook users. It also bundles with it two netbook desktop environments namely - KDE's "Plasma netbook workspace", and MeeGO - A visually rich netbook user interface developed by Intel and Nokia.

Read more »

Sunday, 11 July 2010

Spain Wins the 2010 FIFA World Cup

As a permanent guest in this fantastic country, I cannot but congratulate the Spanish National Football Team for its performance during this World Championship. You really deserved it.




Friday, 9 July 2010

kode warna







































































































































































































Kode warna yang terpilih :


Get it

Cara Menambah Emoticon Di Shoutbox Cbox
By yusron

Sebelumnya, kita belajar bagaimana [Cara Menambah Emoticon Di Shoutbox Shoutmix] . Cbox n Shoutmix berbeda, kalau menurutku, lebih bagus memakai yang shoutbox Cbox karena fasilitasnya lebih daripada shoutbox dari shoutmix. Salah satu fasilitas lebihnya adalah penambahan emoticon. Shoutbox Cbox dapat ditambahkan emoticon yang banyak, sedangkan Shoutbox Shoutmix hanya bisa menambahkan 10 emoticon saja. Tapi pilihan ada ditangan anda :D

Berikut langkah-langkahnya:

1. Pertama, login ke www.cbox.ws

2. Lalu klik Options

3. Pilih yang Smilies

4. Pada kolom URL, isi dengan URL gambarmu. Kolom kode, isi kode emoticon. Contoh gambar dibawah ini kodenya adalah :D, jika orang memposting :D dishoutboxmu, akan muncul gambar dibawah ini.

http://i469.photobucket.com/albums/rr51/lukmannoerdkv/smiley_18.jpg

Untuk alt. kode adalah alternatif kode lainnya, tidak diisi juga tidak apa-apa.

5. Untuk menambah baris baru untuk menambahkan emoticon, klik saja New Row

6. Klo sudah semuanya, klik Save

Sekarang coba check dishoutboxmu, tinggal klik Smilies !!!

SEMOGA BERMANFAAT !!
Berbagai Trik (Style) Penulisan Pesan di CBox

cbox
Begitu tahu hal ini, Saya lantas berfikir CBOX Bisa Lebih baik dari Shoutmix. Beberapa hari terakhir, saya muter-muter di berbagai blog yang kini memang kebanyakan memakai CBOX, setelah shoutmix free bermasalah (baca: Solusi Shoutmix yang Error). Ternyata penulisan pesan di cbox bisa sangat beragam style nya dengan penggunaan berbagai kode. Ini sangat menarik! Saya pun tertarik dan berharap shoutmix premium segera bisa juga...

Cara Penulisan Berbagai Style di CBOX

Berikut adalah berbagai macam style yang bisa diaplikasikan di cbox dan cara penulisannya. Ini akan membuat pesan Anda lebih menarik dan orang lebih tertarik untuk kunjungi Anda.

* Cara Membuat Teks Miring (Italic Style) di CBOX

Apit kata-kata yang ingin dicetak miring dengan [i] dan [/i]
Contoh: [i]teks miring[/i] hasilnya teks miring


* Cara Membuat Teks Tebal (Bold Style) di CBOX

Apit kata-kata yang ingin dicetak tebal dengan [b] dan [/b]
Contoh: [b]teks tebal[/b] hasilnya teks tebal

* Cara Membuat Teks Bergaris Bawah (Underline Style) di CBOX

Apit kata-kata yang ingin digaris bawah dengan [u] dan [/u]
Contoh: [u]teks bergaris bawah[/u] hasilnya teks bergaris bawah


* Cara Membuat Teks Bergaris Tengah (Strike Style) di CBOX

Apit kata-kata yang ingin di garis tengah atau dicoret dengan [s] dan [/s]
Contoh: [s]teks dicoret[/s] hasilnya teks dicoret


* Cara Membuat Teks Berukuran Besar (Big) di CBOX

Apit kata-kata yang ingin dicetak besar dengan [big] dan [/big]
Contoh: [big]tulisan besar[/big] hasilnya tulisan besar

* Cara Membuat Tulisan Berukuran Kecil (Small) di CBOX

Apit kata-kata yang ingin dicetak kecil dengan [small] dan [/small]
Contoh: [small]tulisan kecil[/small] hasilnya tulisan kecil

* Cara Membuat Tulisan Rata Tengah (Center) di CBOX

Apit kata-kata yang ingin dibuat rata tengah dengan [center] dan [/center]
Contoh: [center]rata tengah[/center]

* Cara Membuat Tulisan Berwarna (Color) di CBOX

Apit kata-kata yang ingin diberi warna dengan [color=warna] dan [/color]
Contoh: [color=blue]teks biru[/color] hasilnya teks biru

Kode-kode warna:
[color=red] [/color]
[color=blue] [/color]
[color=green] [/color]
[color=yellow] [/color]
[color=pink] [/color]
[color=purple] [/color]
[color=brown] [/color]
[color=bronze] [/color]
[color=orange] [/color]
[color=black] [/color]
[color=white] [/color]
[color=gold] [/color]
[color=silver] [/color]
[color=violet] [/color]
[color=hotpink] [/color]
[color=navyblue] [/color]
[color=tan] [/color]
[color=aqua] [/color]
[color=teal] [/color]
[color=lime] [/color]

* Cara Membuat Teks Berjalan (Marquee) di CBOX

Apit kata-kata yang ingin dibuat bergerak dengan [scroll] dan [/scroll]
Contoh: [scroll]teks berjalan[/scroll]


* Cara Membuat Teks Ber Link di CBOX

Apit kata-kata yang ingin diberi link dengan [url=alamattujuan] dan [/url]
Contoh: [url=http://ucuhasasuke.blogspot.com]forantum[/url]
hasilnya adalah ucuhasasuke


Penggunaan Beberapa Macam Kode Sekaligus
Selalu letakkan teks paling tengah. Kode yang dibuka terlebih dahulu, ditutup paling akhir. Misalkan kita akan aplikasikan teks tebal dan berwarna, maka kodenya:

[b][color=red]teks merah tebal[/color][/b] hasilnya teks merah tebal

* teks merah tebal letakkan paling tengah

* kode tebal dibuka terlebih dahulu [b] maka penutup [/b] letakkan paling akhir.

Silahkan mencoba beberapa trik di atas, semoga bermanfaat....
Cara Menghapus Komentar di Blogspot

Menghapus Komentar
Sebuah blog tidak lengkap tanpa adanya komentar dari pengunjung, dengan komentar kita juga dapat berinteraksi dengan pengunjung. Tapi ada kalanya pengunjung memberikan komantar yang kurang baik, yang perlu kita lakukan adalah manyikapinya dengan bijaksana. Bagaimana apabila ada komentar dari pengunjung yang bersifat menjatuhkan? Kita harus berusaha menjawabnya dengan baik, akan tetapi apabila tidak pantas di tampilkan ya di hapus saja. Entah kenapa sekarang komentar yang berbau spam semakin banyak, oleh karena itu saya menerapkan sistem moderasi komentar pada blog ini. Mungkin sistem mmoderasi komentar ini kurang nyaman bagi pengunjung karena komentar tidak langsung muncul, akan tetapi apa boleh buat karena saya jarang online sehingga tidak setiap waktu dapat mengecek komentar-komentar yang masuk. Sebenarnya cara menghapus komentar di blogspot sangat mudah, yaitu sebagai berikut:

1. Menghapus Komentar di Blogspot dengan Fitur Blogger
Seperti yang sobat ketahui, blogger memberikan kemudahan untuk menghapus komentar yaitu dengan cara mengeklik icon tong kecil pada komentar. Apabila kita mengekliknya kita akan disuguhi dua pilihan menghapus secara permanen atau tidak, kalau saya sih biasanya memilih menghapus komatar secara permanen.

Menghapus Komentar
2. Mengapus Komentar di Blogspot dengan Tools
Mengapus komantar di blogspot dengan tools atau web lain sebagai pihak ketiga juga mudah, dan bisa sobat pertimbangkan. Caranya sebagai berikut:

* 1. Pertama-tama buka Delete a Blogger Comment

* 2. Silakan mengisi blog url dengan alamat blog sobat, contoh http://forantum.blogspot.com/

* 3. Klik Get Comments


Menghapus Komentar

* 4. Akan muncul jendela kecil dan tunggu sebentar, lalu klik Show All. Untuk melihat isi komentar, klik saja icon plus dan klik icon tong sampah untuk menghapus komentar.


Menghapus Komentar
Silakan mencoba.....Di tunggu komentarnya yah ^_^

Saturday, 3 July 2010

VirtualBox: Using Differencing Disks and Immutable Images

As I promised some time ago, I'm now writing an introductory blog post about a subject that some VirtualBox desktop users probably aren't aware of: differencing disks.

When you configure your guest's storage, you might have noticed a Differencing Disks checkbox in the configuration panel. If you tried to check it, chances are that nothing seems to happen. The VirtualBox GUI, indeed, provides no way to configure disks types and, consequently, not even differencing disks. The only clue that differencing disks are there can be seen if you made a snapshot of a virtual machine disk image. In that case, if you inspect the Storage settings of your virtual machine, you will notice that the attached disk is a "Normal (VDI)" disk type, as shown in the following screenshot:


If you now click the Differencing Disks checkbox, you will see that the attached disk actually is a differencing disk:


If you inspect the Hard Disk list box you will notice that what's really attached to your virtual machine is a differencing disk by UUID:


It won't be difficult to discover that UUID corresponds to the disk that stores the "differencing information" of the snapshot I took:


as can be seen in the file system:


There's a chance, then, that differencing disks are already part of your VirtualBox experience as a hidden "side effect" of taking virtual machine snapshots.

In this blog post we'll discover that immutable images (and differencing disks) are disk image types with its own advantages and we'll explore some use cases you can benefit from them.

Image Write Modes

Every virtual disk image you're using in your guests has a property callled image write mode. The mode can be:
  • Normal.
  • Write-through.
  • Immutable.

Normal Images

The default normal images are what you're accustomed to when running your typical guest. The guest instance can read and write to the image without restrictions and the image can be snapshotted. Snapshot data are written to a differencing image that receives the differences to the original image (or to its parent snapshot.) Normal  images can only be attached to one running guest at a time.

Write-through Images

Write-through images, with respect to normal images, aren't affected by snapshots.

Immutable Images

An immutable images, as its name implies, does not permanently record changes: changes are available only while the machine is running. As soon as it's power cycled, changes are lost and the image its reverted to its original state. As in the case of snapshots, VirtualBox will use a differencing image to record changes to an immutable image. The differencing image is then reset to its original state at guest power cycle. The auto-reset feature of a differencing disk can also be turned off. Immutable images can be attached to as many running hosts as you wish: each guest they'll be attached to will create a new differencing image to store their changes.

Use Cases

Each image type has its own pros and cons:
  • Normal images can be easily snapshotted but can't be used by more than a guest at a time.
  • Write-through images aren't affected by snapshots: they're ideal to host critical data that won't be compromised by a snapshot restore.
  • Immutable images won't ever be compromised: a power-cycle will restore them to their initial state. They can be used by multiple host at a time and are the quickest way to deploy multiple (initially) identical guest instances.

Immutable Image with a Differencing Disk

Using immutable images with differencing disks is one of the quickest way to deploy multiple instances of the "same" virtual machine. Since more than one virtual machine will be sharing the same underlying image you'll also spare a good amount of storage space.

I, for example, had to deploy more than ten instances of a proprietary database: all of the instances could share the same immutable image since all of the instance would use the very same operating system and the same initial data base configuration.

Creating A Virtual Machine

The first step to build your own immutable image is creating a virtual machine. This step is the same as usual:
  • I created a virtual machine (with a normal image).
  • Installed the operating system.
  • Installed the data base.
  • Finished to configure the environment with most of the configurations all instances would share.

Cloning the Disk

To clone your hard disk image you've got to use VirtualBox command line interface. Open your favorite shell and use the VBoxManage command to clone your hard disk:

$ VBoxManage clonehd <uid>|<file> <output>


You may check with either VirtualBox GUI, adding your newly created image or with the command line interface, as shown in the following images:


Marking the Image as Immutable

Once you're finished with your virtual machine you've got to mark the image as immutable. Once again, this step can only be performed using VirtualBox command line interface. Open your favorite shell and use the VBoxManage command to mark to change the image type:

$ VBoxManage modifyhd <file> \
  --type immutable


Both VirtualBox GUI and the VBoxManage command may be used to check an image type:



Attaching the Immutable Image to a Virtual Machine

Now you can attach your immutable image to a virtual machine. Every time you attach an immutable image to a virtual machine, VirtualBox will create a differencing disk for you that will store the changes recorded for a specific virtual machine.

As explained in the previous sections, the default differencing disks created by VirtualBox will be reset every time a virtual machine is stopped and restarted. Depending on your use case, you might want changes to be permanent.

Setting an Image Auto Reset Flag to Off

Every differencing disk has got an autoreset flag which, by default, is set to on. To set it to off you have to use the VBoxManage command:

$ VBoxManage modifyhd <uuid>|<filename> \
  --autoreset off

Your differencing disk won't "forget" any more the changes it records.

Conclusion

I hope that this quick walkthrough helps you discover some lesser known functionality of VirtualBox, either if you're using it as a desktop or as a server virtualization platform. Either if you're deploying many images or if you're simply installing a couple of virtual machines for your family, immutable images and differencing disk will help you spare a lot of storage space and, above all, a lot of your precious time.

Further Readings

If you're a Solaris user (at least Solaris 10, OpenSolaris, OpenIndiana, etc.) you will notice that the basic benefit of using immutable images can be achieved using native Solaris technologies such as ZFS snapshots and clones or ZFS deduplication. Using ZFS instead of VirtualBox immutable images is leaner and reduces VirtualBox administration times.

Although not related to VirtualBox, if you're interested at the advantages that the Solaris' ZFS file system can bring even in a deployment of a virtualized desktop environment, these are interesting reads:









Letter From Apple: iPhone's Signal Strength Algorithm Is Flawed.

Yesterday Apple published an open letter regarding the problems that are affecting iPhone 4 and the supposed flaw in the antenna design. Just to quote the “interesting” part of it (trimming down iPhone eulogies and Apple’s declarations of love toward its newly born child):

We have discovered the cause of this dramatic drop in bars, and it is both simple and surprising.

Upon investigation, we were stunned to find that the formula we use to calculate how many bars of signal strength to display is totally wrong. Our formula, in many instances, mistakenly displays 2 more bars than it should for a given signal strength. For example, we sometimes display 4 bars when we should be displaying as few as 2 bars. Users observing a drop of several bars when they grip their iPhone in a certain way are most likely in an area with very weak signal strength, but they don’t know it because we are erroneously displaying 4 or 5 bars. Their big drop in bars is because their high bars were never real in the first place.

Totally wrong”. I wonder what does that mean.

Anyway, Since I own an iPhone I always complained about dropped calls and pretty inaccurate signal strength estimations shown by the phone. Either I had at least 4 bars or I had none. Even at maximum strength, the phone was dropping some calls. Simple cross checks with other phones I own (connected to the same operator) made me suspect that the iPhone was making way too optimistic signal strength estimations.

I’m glad to hear that they finally found the “solution” to this problem although I believe that such a flaw shouldn't have been discovered years after the first iPhone release. Too few of us were complaining? Many of us were blinded by the supposedly Apple’s infallibility? Apple wasn’t listening?

I don’t know. After the next software update, although signal won’t improve, at least the iPhone won’t be lying to us any longer.