I laughed because I expected that he will send me a pink cable, as I commented about pink in the post:
Thank you, this made my day.
I laughed because I expected that he will send me a pink cable, as I commented about pink in the post:
Thank you, this made my day.
After about 60 days using my MacBook Pro running Mac OS X Lion (10.7.3), I saw some sluggishness in some apps. At first, it was Messages (iChat replacement for Mountain Lion). It went unresponsive and displays the rainbow wheel for a few seconds, enough to annoy an impatient user.
Then, the same behavior happened in Terminal. This is where I realize the common behavior. You know, when you press delete on an empty prompt, you get a bell. The default is the audible bell. When I change it to the visual bell, sluggishness disappeared.
On Messages, I had the default sound effect setting when messages are received or sent.
Boy was I right. In the log /var/log/system.log there were a bunch of these:
May 3 22:30:57 ADYMAC iChat: [Warning] Actions: Couldn't create SystemSound from /Applications/iChat.app/Contents/Resources/Received Message.aiff May 3 22:31:07 ADYMAC iChat: [Warning] Unable to find a sound action ID for /Applications/iChat.app/Contents/Resources/Received Message.aiff errorResult: 268435460 May 3 22:31:07 ADYMAC iChat: [Warning] Actions: Couldn't create SystemSound from /Applications/iChat.app/Contents/Resources/Received Message.aiff May 3 22:31:17 ADYMAC iChat: [Warning] Unable to find a sound action ID for /Applications/iChat.app/Contents/Resources/Received Message.aiff errorResult: 268435460
These are when I tried to change the system bell using the System Preferences application.
May 11 01:45:55 adymac System Preferences: Error 268435460 setting AlertSound May 11 01:53:22 adymac System Preferences: Error 268435460 setting AlertSound May 11 01:58:20 adymac System Preferences: Error 268435460 setting AlertSound May 11 01:58:25 adymac System Preferences: Error 268435460 setting AlertSound
And so I tried a lot of things, including logging out then in, inspecting the file permissions, and also ran the verify permission utility on the hard disk using Disk Utility. Nothing worked.
Finally, I saw that there was one process called coreaudiod
_coreaudiod 45197 0.0 0.1 2453172 5228 ?? Ss Fri02AM 0:10.52 /usr/sbin/coreaudiod
And so I tried killing it:
$ sudo killall coreaudiod
And as expected, it respawned itself and all audio effects were now working. Sluggishness and the dreaded rainbow wheel are gone.
Googling after, I saw that people mentioned that this may be a bug, and killing coreaudiod is only a workaround not the solution.
Come to think of it, it also caused unnecessary delay when making screen shots using the Command-Shift-4 key combination.
I hope this can save you some time.
If you’re a seasoned Linux SysAdmin, you’ll miss LFTP. It’s a really powerful FTP client. Yes, you can also install it using MacPorts or Fink but right now, this is much quicker for me.
Here’s how I built LFTP 4.3.6 on my MacBook Pro. For the record, I’m on 10.7.3
Prerequisite: Apple developer tools (Xcode)
1. Download The GNU Readline Library (The library that came with OS X will not work). This is how I built Readline 6.2:
$ cd /where/readline/was/extracted $ ./configure --prefix="/usr/local" --disable-shared && make && sudo make install
This will build a static library and install in it /usr/local
2. Make sure the library (libreadline.a) was built successfully in /usr/local/lib
3. Download LFTP and build it:
$ cd /where/lftp/was/extracted $ CXXFLAGS="-O0 -Wall -fno-exceptions -fno-rtti -fno-implement-inlines" \ LDFLAGS="-Xlinker -search_paths_first -L/usr/local/lib" \ CPPFLAGS="-I/usr/local/include" \ ./configure --with-openssl --disable-shared --disable-nls $ make && sudo make install
In the lftp configure line, the “-Xlinker -search_paths_first” is necessary so that the linker will not prefer the system shared /usr/lib/libreadline.dylib to the static libreadline.a we just compiled.
The final binary will be installed into your /usr/local/bin/lftp and if your build was successful you should be able to run “lftp” and get the prompt:
My LFTP version:
LFTP | Version 4.3.6 | Copyright (c) 1996-2012 Alexander V. Lukyanov LFTP is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with LFTP. If not, see <http: //www.gnu.org/licenses/>. Send bug reports and questions to the mailing list lftp at uniyar.ac.ru. Libraries used: Readline 6.2, Expat 2.0.1, OpenSSL 0.9.8r 8 Feb 2011, libiconv 1.11, zlib 1.2.5
Perhaps some of you arrived by searching for “error: â€˜rl_kill_full_lineâ€™ was not declared in this scope”. Yep, the above steps should help you.
If you’re here to look for the way to forward the phone that comes to UniFi to another phone number, I apologize. I don’t know how. I tried asking TM call center but they told me to call UniFi support for UniFi phone.
For the record every time I try *61*XXXXXXXXXX# the automated voice response is “harap maaf, anda tidak mempunyai akses ke nombor ini”. I think it’s related to a protection so that users can’t simply forward to any number. Protection is good only if there are procedures to follow to make a feature useful. Not in this case.
I created a ticket in the My Support section in myUniFi only to be closed by X1012121 – it’s not even a real name. The ticket was closed without any explanation whatsoever. Nada. Nothing. Nil.
So what they put in their Microsoft SharePoint website Phone (Voice Features) page doesn’t work. At least for me. If you can see any instructions on adding custom phone numbers to the forward list, do let me know. I might need new spectacles.
As a matter of fact, I created a ticket a week earlier about something else and although I specifically asked to be emailed, they called. Maybe the text on their system is too small to read especially the “Preferred communication” field. I don’t know. The annoying thing was that the person kept calling and calling and calling when the call was not picked up.
When the call is not picked up, please call later.
If you’re not going to fully support your value added services, you might as well not offer them at all. I am fully satisfied with the Internet service, but since there are “FREE” added service I thought I might utilize it. Now that I know they don’t work, I’m unhappy.
One thing that really bothers me is that I think they don’t really have an SLA with customers, and KPI to fulfill. Closing tickets without any reason is unacceptable by any standard, not even in inter organization support services.
I will never understand why TM work like this… and I know this post will not mean anything to them. I am just disappointed. Having some exposure on how they do stuff, I think they can do better and generate more profit than now but the mentality is just beyond me.
Installation is straight forward but you will be warned that the machine will need to be restarted. After installation, the spanking new icon will appear in the dock. The rightmost icon in the screenshot, not the middle one.
After installation (and configuration with your iCloud account), the familiar iChat UI will appear. Alongside with a new “iPad inspired” message list. Messages will continue to work with the existing accounts, just with additional features. As you can see in my screenshot my Google Talk (Jabber) account works fine.
I really wanted to know whether old messages from the iPhone will be imported. They were not. Which is no big deal. I’m not sure whether some background sync will happen while I use it. I’ll update if it does that.
I sent a test message to a buddy, Nazham:
At the same moment, my message and his reply appeared in both Messages for Mac and the iPhone. This is what Apple meant by “Start an iMessage conversation on your Mac and continue it on your iPad, iPhone, or iPod touch.”.
I love it.
Knowing Apple, Mountain Lion might be the only OS X I can upgrade my 2010 MacBook Pro with and I hope the price will be more or less like Lion.
Until next time, happy computing.
Here’s a short article on making a simple module to include on your Joomla! pages that displays login / logout links. I’m a Joomla! newbie so there might be better ways to accomplish this.
I was helping a friend-client to accomplish redirection to the same page after logout.
Here’s the basic code that you need to have in a module with the Jumi extension:
< ?php $user=& JFactory::getUser(); if (!$user->guest) echo '<a href="index.php?option=com_user&task=logout&return=Lw">Logout</a>'; else echo '<a href="index.php?page=account.index&option=com_virtuemart">Login</a>'; ?>
The code above will redirect users to the root or uppermost level of the website.
Let’s say that your website is http://www.yourwebsite.com/ and your shopping page with VirtueMart is installed at a subfolder http://www.yourwebsite.com/shop/
The question is simply where you want your user to end up after logging out. If you need your users to end up at http://www.yourwebsite.com/ then you’re good to go. If you want your users to be redirected to the shop or a thank you page, here’s where you need to be a little creative.
You need to replace that “Lw” in the logout link to a different string. “Lw” is the base 64 representation of the character “/”. So this means that the user will be redirected to / which is http://www.yourwebsite.com/
A solution I came out with:
1 2 3 4 5 6 7 8
< ?php $redirect_to = '/shop/'; $user=& JFactory::getUser(); if (!$user->guest) echo '<a href="index.php?option=com_user&task=logout&return=' . base64_encode($redirect_to) . '">Logout</a>'; else echo '<a href="index.php?page=account.index&option=com_virtuemart">Login</a>'; ?>
So only line 2 needs to be changed. Let’s say you want users to be redirected to http://www.yourwebsite.com/thankyou.html here’s how you will change line 2:
$redirect_to = '/thankyou.html';
If you’d like your users to simply be redirected to the same page where they clicked the logout link, here’s what you should do to line 2:
$redirect_to = $_SERVER['REQUEST_URI'];
That’s simply it. At first, I totally forgot that I can use PHP’s base64_encode so I ended up confusing my friend with an online encoder so that he can replace the “Lw”.
One annoying thing that I wasn’t able to solve is the login page always displays the error message:
Error: You do not have permission to access the requested module.
I think Joomla! is trying to load VirtueMart too early and I can’t make it go away. Looking at the Internet a lot of other websites has this message displayed. If you know how this message can be removed without hacking the CSS or source code, please let me know and I’ll give you credit.
I have always been a fan of Crocs shoes because of their lightness, durability and the airy design. As someone who suffers from athlete’s foot since the teen years, airy means better air circulation and dryer feet.
Back in 2009 or 2010 we went to a Crocs warehouse sale in Ikano Power Center in Damansara. It was held in an empty unit next to the IT hypermarket at the top floor. We bought 5 pairs – two for myself and three for my son.
For other models than the Baya, links are from other websites as they no longer exist on the official website. Maybe they have been taken off production or something.
The purpose of this post is to make sure that if there is any more warehouse sale in the future, and if you’re going, you better thoroughly check the shoes you’re buying.
A few days back, my son was having trouble to put on the Crocs Electro on his left foot. That was weird, and at first I had a silly thought that his left foot has grown more than his right foot. I was surprised to see that the shoes, although marked with the same size, had the left one smaller than the other.
I don’t know how this happened but I’m not happy. Lucky for us we realize this before his feet were bruised more. It is not my intention to accuse anything at anyone but I have to admit that I am disappointed. Knowing Malaysia, we can’t return the shoes especially since it was bought in a warehouse sale. Heck, we can’t even return them if we buy them at retail price.
And of course, living in Malaysia I’m not excluding the possibilities of foul play. It’s how most businesses make maximum profit anyway…
In the previous post I wrote about enabling compression for your pages so that they would load faster to the visitor. Today I’m going to write about how you can make use of browser caching to save some bandwidth.
Some people told me that their ISP or hosting provider requested that they upgrade the hosting plan or subscribe for more bandwidth. Since this site doesn’t have that much traffic, I wouldn’t know.
However recently I was able to help on a website which has a lot of visitors compared to this site. Around 14-18 visitors per minute on a working day and the bandwidth usage was very high, more than a gigabyte per day.
For the website, I saw that there were many requests for images (photos). The images aren’t that big anyway, around 100KB each but the amount of request made it significant.
Armed with knowledge of mod_expires, I added the following clauses to .htaccess while hoping that the server has the module installed. The following configuration is minimal, and Google Pagespeed actually suggests for 1 week.
Although I know why Google Analytics set its expiry to 2 hours, it’s kind of amusing since the suggestion comes from another Google product. Oh well I am allowed to be amused right?
So let’s get to the results. Here are the bandwidth graphs from both days. I enabled mod_expires at around 6PM on 5 January 2012.
We can’t really see the difference by looking at the graphs. Google Analytics shows that there are at least 200 more visits on 6 January 2012. The numbers? Here you go:
At least 400MB were saved by this technique. You can actually put specific settings for each folder in your website. For example 2 hours is nice for cosmetic images which may need to be changed frequently but not for photos. For example if you run a photography website, you can even make your photos to expire in 1 year!
What mod_expires does is actually telling the browser that the resource (images) will expire on a specific date. It’s flexible enough to set the date from the access time. Here is the link to the official manual page for mod_expires.
Please be careful to note that this is not a quick solution for the lazy. You must think hard enough to set the proper amount of time before the images expire otherwise normal users will not see your changes or updates to the image until the cache on their browsers expire!
Website speed is one of the most important factor to make people like to visit more. In 2008, I wrote Compressing WordPress Output and this is done by adding one line to index.php
The problem with that approach is that when you upgrade WordPress you have to manually add the line into index.php, and the technique does not improve loading time for administration pages.
Compressing is done on the fly by Apache, and it helps improve loading time because your browser receives smaller files. While some browsers were broken (they do not know how to handle compressed content), today’s browsers are much more efficient.
If your webhost allows you to add your own .htaccess then you can use this technique. Please note that you can do this for any type of website, not limited to WordPress.
You can use Firebug or Chrome to actually verify whether your content is now zipped. You might have to clear your browser cache first otherwise the files will not be requested from the server. You should look for the content-encoding header and it should say “gzip”. To satisfy yourself, you might want to capture the size of the page (there should be a column for that) before and after you add the directives into .htaccess and you should be able to see a significant reduction in size.
If you don’t see gzip then the possibilities are either your webhost does not allow .htaccess or mod_deflate is not installed on the server. To see whether or not mod_deflate is installed on the server you can remove the 1st and 3rd line in .htaccess and refresh the page. If it’s not installed then you will see an error.
For Joomla! users, there’s an easier way to do it in the Global Configuration section:
For WordPress, one might argue that they can change the parameter gzipcompression in the semi hidden configuration page http://www.yourblog.com/wp-admin/options.php but I tried it in WordPress 3.2.1 and it did not work. I read in WordPress forums, they removed this feature because Apache can handle it much better.
Go ahead and try it out. Your visitors will be thankful.
I’ve been pushing the limits of my mid-2010 13″ MacBook Pro lately, running all sort of applications and leaving them running. There has been occasions where the machine will freeze while it struggles to schedule the CPU time to all of the applications.
I use a lot of email, and by a lot I don’t mean 10 emails per day. No joke. The features of Apple Mail 5.0 are actually enough for my daily use but it does feel a little bit sluggish with 5 IMAP accounts.
Recently, I signed up to Shortmail via my Twitter account. The idea is nice. 500 characters max per email, straight to the point.
I was thinking, Shortmail is short, Sparrow is light. Combining them together should be nice… and since all of my email accounts are now running via IMAP, why not give Sparrow a try with Shortmail before using it for serious communications.
I downloaded Sparrow through the website to try it out, instead of buying it from the Mac App Store for $9.99
I was pleased that it only asked for my email address and password so I entered my Shortmail account details. It was nice. Shortmail’s logo was displayed on the screen. But it took ten minutes to sync my 3 messages. I don’t know what it was doing and I’m not sure whether the waiting time is caused by Shortmail servers or Sparrow itself.
One thing I hate the most is how markup is displayed in the preview lines in Sparrow. It’s not in Facebook’s email but markup are there for the first 2 emails.
I can understand if there are glitches in Shortmail as it’s still fresh but I don’t expect glitches from Sparrow. I wonder how long it would take for it to sync my gigs of emails from other email accounts. I can’t even imagine and I can’t afford to waste so much time.
Looks likes it’s going to be a while before I am convinced to try Sparrow again. I am glad I didn’t rush to buy the app for $9.99 in the Mac App Store. For now, I’m leaving it to AppZapper to cleanup!
Less than an hour ago, I received a shortmail from Shortmail telling me that they are working on a new version of their IMAP service that should make a difference. This is great news for those who prefer using Shortmail service via regular email clients. From @Shortmail‘s timeline I can see that they are responding to many users about improving the IMAP service.
Keep up the good work! By the way, my Shortmail address is romantikaname [at] shortmail [dot] com
Thanks for the shortmail! This is nice, and it shows that you are serious about what you do!
For the record, I was more disappointed with Sparrow displaying ugly markup on the preview pane.
I was looking for a simple utility that will work like dos2unix tool on Linux to convert endlines from DOS to UNIX. I was scraping some contents from a server running .NET and those ugly ^M characters appeared in vim.
I found this https://ccrma.stanford.edu/~craig/utility/flip/, downloaded the PPC binary and used it happily for a while.
That is until I upgraded to Lion. I am not an expert in Mac OS X yet, but since Lion took away Rosetta and PPC codes away I got this:
Launch of "flip" failed: the PowerPC architecture is no longer supported.
The “file” utility gave me this:
flip: Mach-O executable ppc
Since I have the old Xcode installed on my machine, I thought I’d try and build it since the source code (a single .cpp file) is provided at the URL above.
Here’s how I was able to build it:
g++ -ansi -O3 -o flip flip.cpp \ -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1 \ -I/Developer/SDKs/MacOSX10.6.sdk/usr/include \ -I/Developer/SDKs/MacOSX10.6.sdk/usr/include/c++/4.2.1/x86_64-apple-darwin10 \ -L/Developer/SDKs/MacOSX10.6.sdk/usr/lib && strip flip
The three -I provided it with the include paths, and the -L provided the libraries for the binary to link to. To run the compilers, you need to add them to your PATH: /Developer/usr/bin
Now flip runs well:
Usage: ./flip [-t|-u|-d|-m] filename[s] Converts ASCII files between Unix, MS-DOS/Windows, or Macintosh newline formats Options: -u = convert file(s) to Unix newline format (newline) -d = convert file(s) to MS-DOS/Windows newline format (linefeed + newline) -m = convert file(s) to Macintosh newline format (linefeed) -t = display current file type, no file modifications
And “file” recognizes it as:
flip: Mach-O 64-bit executable x86_64
If you have the new Xcode 4.1 (the one that Apple just released for free in App Store), you might need to change certain paths. You’ll have to look at the errors and adjust your parameters.
I am not sure whether my development tool paths were removed as a result of Lion upgrade, but I am currently downloading Xcode 4.1 to the machine. Let’s see whether it’ll automatically set the INCLUDE, LIB, and add the development tools into my PATH.
If it does, then compiling might even be as easy as:
g++ -ansi -O3 -o flip flip.cpp && strip flip
Since Mudah.my has decided to be Susah.my (again) I have decided to post this item here, on my own blog. This is my old DSLR, fully functioning and very much loved. It’s for sale as I have upgraded to a faster camera suitable for shooting children in normal and low lighting conditions.
Here’s the same text I posted in Facebook and Mudah:
Nikon D50 kit (with 18-55mm lens)
Shutter Count: ~17636
Purchased on 1 August 2006
Great camera for beginners, and 2nd body for slow moving or static subjects. Tough body, no defect in function. Complete box, including *expired* warranty card and manuals.
Reason for selling: upgrade.
I love this camera but I am unable to bring 2 bodies out, and it has been sitting in the dry box for more than a month. Such a waste for a such beautiful body.
COD/view in Cyberjaya/Putrajaya only. You may request other areas if reasonable.
Serious buyers only please. Send me an email: ady at romantika dot name
Sorry, I don’t dare to ship internationally. If you want it shipped to other states, I might be able to consider it but you’ll need to cover the shipping cost.
Here’s a link to the public Facebook album (visible to everyone) containing this camera and other used items for sale.
Let’s face it. iPhone/iPad “new mail” alerts sucks and if you have multiple email accounts set up you’ll never know which account received the new email.
When you’re driving or having a meal, it’s convenient to know whether the email is from your boss, is an important alert from a system dying somewhere, or just your friend saying hi.
I’m not saying that you should procrastinate replying emails from friends, but those kinds of emails are just not worth crashing into the road divider or choke on chicken bone or something. Joking.
There might be some other tweaks or tools but I decided on MyProfiles. That’s the best I can find.
It works fine until one night I turned the phone into silent mode (via hardware switch) and the alert sound still played! I was surprised. At first I thought that I forgot to disable the alert override (Override Silent) item but I was wrong. It’s stuck at ON no matter how many times you try.
Override silent is a useful feature, trust me but I don’t want all of my alerts to sound all night long.
The quickest way I found was to edit the configuration directly. The configuration file is at: /var/mobile/Library/Preferences/com.intelliborn.myprofiles.plist
< ?xml version="1.0" encoding="UTF-8"?> < !DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>allAlerts</key> <array> <dict> <key>alertDuration</key> <integer>1800</integer> <key>alertId</key> <integer>1</integer> <key>alertInterval</key> <integer>300</integer> <key>alertVolume</key> <integer>0</integer> <key>displaySummary</key> <integer>1</integer> <key>filterMailboxesArray</key> <array> <string>EmailAccount1</string> </array> <key>global</key> <integer>1</integer> <key>ignoreRingerState</key> <integer>0</integer> <key>mailToMeOnly</key> <integer>0</integer> <key>name</key> <string>COMPANY</string> <key>repeatAlert</key> <integer>0</integer> <key>sound</key> <integer>1</integer> <key>soundPath</key> <string>/System/Library/Audio/UISounds/sms-received2.caf</string> <key>type</key> <integer>1</integer> <key>vibrate</key> <integer>1</integer> </dict> </array> </dict> </plist>
You’ll need to change the key to 0, near the line:
I don’t know how to restart the daemon as this is not a springboard app. I also don’t know whether restarting the springboard will take the new configuration.
So what I did was just launch MyProfiles again and then tried to edit the alert configuration. What I found out was that the configuration for override silent is untouched and even if I play around with it, it still won’t change from the new state I manually entered in the XML file. I also restarted the engine just to be sure.
But hey, it worked and when in silent mode the alert no longer play any sound.
* To do this you need to have SSH enabled on your iPhone/iPad. Hey if you’re using MyProfiles that means you have jailbreak your device anyway…
My better half and I have been looking for a nice table as surface in our large kitchen but we couldn’t find any nice ones. Even IKEA products are too simple or too expensive. She found a website that she likes very much, IKEA Hackers and has been showing me many designs since.
For her birthday we decided to do some IKEA hacking project. She will design and I will make it. As an artsy crafty person she designed things very easily but as someone who has only done woodwork in high school, it’s a proven challenge for me.
We decided to use 4 LACK side tables code 901.616.73 measuring 56x56cm and 1 VIKA AMON table top code 501.622.26 measuring 150x75cm. Total cost for this project including screws and brackets was RM240 (around US$80 at that time).
First, the LACK tables were assembled normally by screwing the 4 legs onto the top according to IKEA’s manual. They are arranged by the wall to see how they look:
As I have never worked on wood before, it proved difficult for me to find supplies of brackets and suitable screws to put the project together. I finally found some usable parts at a local DIY store. To attach 2 LACK on the same row together, I used 2 L shaped flat metal piece. I didn’t manage to take a picture after attaching them but you’ll be able to see it in the following picture.
Here’s a picture after they have been attached. Note that at this moment the top row and the bottom row aren’t connected yet as I wanted to be able to easily attach the huge VIKA AMON top first.
Here’s a view on how 2 LACK on the same row are attached using the L flat bracket. The red 3M tapes you see are just used to make sure the LACK tables stay put on the VIKA AMON table after I made the measurements.
The top is attached by screwing the tables from below, using 2.5″ wood screws with washers. It wasn’t an easy job because LACK tables have paper support inside and are hollow. I used 8 screws to fix the top.
After I was satisfied with the attachment strength it was time to attach the bottom row of the LACK tables. Ransacking through my IKEA box I found flat brackets from GORM so I used them at what supposedly to be the behind of the table (facing the wall).
A useful tip here is to offset a little from center when driving the screw near the LACK table top as you might hit the original screw that holds the feet together. You don’t want that, those screws are heavy duty. I broke a bit on my power drill.
At the legs of the inner side, I used L metal brackets to attach the top and bottom row together.
Here’s the (almost) final product. We plan to have some gypsum board covering for the sides and back but we are yet to find (and decide) on where we should get the supplies.
While we’re at that maybe we’ll look for nice wallpapers to cover the side and back boards.
Well that’s it. I hope you enjoyed reading.
On my MacBook Pro with minimal disk size (250GB) I had to install VirtualBox in order to run any kind of Windows, for emergency cases. I was able to install Windows Server 2008 in a 20GB dynamically expanding virtual disk image (VDI).
A couple of months back I also made a clone of my HP NX9010 hard disk, a Seagate Momentus 80GB drive using the dd utility and attach it to the same virtual machine. I don’t have a lot of time at hand so this will enable me to selectively back up the files on that drive, when I have some free time. I use that old laptop to play videos for my child.
After some time, the Windows Server 2008 VDI grew up to 11GB and the Momentus VDI stayed at 74GB because dd was copying it bit by bit. I needed to free up more space. My target was the Momentus VDI because it’s huge and I have already deleted (backed up) a lot of files in it.
As their name suggest, they are dynamically expanding so they will not shrink themselves. In VMware, you can easily stumble upon the “shrink” button in the tool. In VirtualBox, we need to use the command line utility VBoxManage.
It’s as simple as:
VBoxManage modifyhd Seagate\ Momentus\ 80GB.vdi --compact
*VBoxManage is run on the host machine, while the virtual machine is powered off (not suspended).
Running it without any preparation work will shrink the VDI a bit, too insignificant to even notice.
And so I used SDelete to zero all the unused space on the VDI, and ran VBoxManage again. SDelete needs to be run inside the virtual machine while it’s running.
sdelete -c d:
I managed to get the 74GB VDI to shrink to 23GB. Now that’s a significant reduction in size.
Still, I was greedy. I wanted to know whether fragmentation has any effect on the shrink-ability of the VDI. So I went into the virtual machine, ran defrag, ran sdelete, then I executed VBoxManage to compact the VDI.
Below was my final result. From 74GB to 5.1GB I was fully satisfied. I was also able to shrink the 11GB VDI that contains the OS to 9.7GB.
If you have questions/suggestions/feedback, please leave a comment.