Apple OS X

I'm one of the folks who bought MacUpdate Spring 2012 Bundle, which includes Drive Genius 3. I've just upgraded my Mac with 750Gb Seagate Momentus XT2 (ST750LX003) and wanted to try defragging a hard-drive on OS X (just because).

So here's the result and a picture worth a thousand words:

Drive Genius 3 - Defrag Failed


Thank goodness it was still an empty drive with no data. Continue Reading
 Read More

There was an unused Apple desktop machine running OS X 10.4 sitting around, so I decided to use it as a storage for our company's firewall log. The current log is then rotated and saved in /private/var/log/archived. Here's the script:

#!/bin/bash
echo Stopping Syslog...
sudo launchctl unload /System/Library/LaunchDaemons/com.apple.syslogd.plist
sleep 1

echo ""
printf %s "Rotating log files:"
cd /var/log
for i in edmonton.log; do
    if [ -f "${i}" ]; then
        printf %s " ${i}"
        if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
        if [ -f "${i}.6${gzext}" ]; then mv -f "${i}.6${gzext}" "${i}.7${gzext}"; fi
        if [ -f "${i}.5${gzext}" ]; then mv -f "${i}.5${gzext}" "${i}.6${gzext}"; fi
        if [ -f "${i}.4${gzext}" ]; then mv -f "${i}.4${gzext}" "${i}.5${gzext}"; fi
        if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}" "${i}.4${gzext}"; fi
        if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}" "${i}.3${gzext}"; fi
        if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}" "${i}.2${gzext}"; fi
        if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}" "${i}.1${gzext}"; fi
        if [ -f "${i}" ]; then
              touch "${i}.$$" && chmod 640 "${i}.$$" && chown root:admin "${i}.$$"
              mv -f "${i}" "${i}.0" && mv "${i}.$$" "${i}" && if [ -x /usr/bin/gzip ]; then
                gzip -9 "${i}.0"; fi
        fi
    fi
done
if [ -f /var/run/syslog.pid ]; then kill -HUP $(cat /var/run/syslog.pid | head -1); fi
echo ""

cp -f /var/log/edmonton.log.1.gz /var/log/archived/edmonton_log-`/bin/date +%Y-%m-%d`.gz

sudo rm -f /var/log/edmonton.log
sudo touch /var/log/edmonton.log
sudo chgrp -v admin /var/log/edmonton.log
sudo chmod -v go+w /var/log/edmonton.log


for i in toronto.log; do
    if [ -f "${i}" ]; then
        printf %s " ${i}"
        if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
        if [ -f "${i}.6${gzext}" ]; then mv -f "${i}.6${gzext}" "${i}.7${gzext}"; fi
        if [ -f "${i}.5${gzext}" ]; then mv -f "${i}.5${gzext}" "${i}.6${gzext}"; fi
        if [ -f "${i}.4${gzext}" ]; then mv -f "${i}.4${gzext}" "${i}.5${gzext}"; fi
        if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}" "${i}.4${gzext}"; fi
        if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}" "${i}.3${gzext}"; fi
        if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}" "${i}.2${gzext}"; fi
        if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}" "${i}.1${gzext}"; fi
        if [ -f "${i}" ]; then
              touch "${i}.$$" && chmod 640 "${i}.$$" && chown root:admin "${i}.$$"
              mv -f "${i}" "${i}.0" && mv "${i}.$$" "${i}" && if [ -x /usr/bin/gzip ]; then
                gzip -9 "${i}.0"; fi
        fi
    fi
done
if [ -f /var/run/syslog.pid ]; then kill -HUP $(cat /var/run/syslog.pid | head -1); fi
echo ""

cp -f /var/log/toronto.log.1.gz /var/log/archived/toronto_log-`/bin/date +%Y-%m-%d`.gz

sudo rm -f /var/log/toronto.log
sudo touch /var/log/toronto.log
sudo chgrp -v admin /var/log/toronto.log
sudo chmod -v go+w /var/log/toronto.log

for i in montreal.log; do
    if [ -f "${i}" ]; then
        printf %s " ${i}"
        if [ -x /usr/bin/gzip ]; then gzext=".gz"; else gzext=""; fi
        if [ -f "${i}.6${gzext}" ]; then mv -f "${i}.6${gzext}" "${i}.7${gzext}"; fi
        if [ -f "${i}.5${gzext}" ]; then mv -f "${i}.5${gzext}" "${i}.6${gzext}"; fi
        if [ -f "${i}.4${gzext}" ]; then mv -f "${i}.4${gzext}" "${i}.5${gzext}"; fi
        if [ -f "${i}.3${gzext}" ]; then mv -f "${i}.3${gzext}" "${i}.4${gzext}"; fi
        if [ -f "${i}.2${gzext}" ]; then mv -f "${i}.2${gzext}" "${i}.3${gzext}"; fi
        if [ -f "${i}.1${gzext}" ]; then mv -f "${i}.1${gzext}" "${i}.2${gzext}"; fi
        if [ -f "${i}.0${gzext}" ]; then mv -f "${i}.0${gzext}" "${i}.1${gzext}"; fi
        if [ -f "${i}" ]; then
              touch "${i}.$$" && chmod 640 "${i}.$$" && chown root:admin "${i}.$$"
              mv -f "${i}" "${i}.0" && mv "${i}.$$" "${i}" && if [ -x /usr/bin/gzip ]; then
                gzip -9 "${i}.0"; fi
        fi
    fi
done
if [ -f /var/run/syslog.pid ]; then kill -HUP $(cat /var/run/syslog.pid | head -1); fi
echo ""

cp -f /var/log/montreal.log.1.gz /var/log/archived/montreal_log-`/bin/date +%Y-%m-%d`.gz

sudo rm -f /var/log/montreal.log
sudo touch /var/log/montreal.log
sudo chgrp -v admin /var/log/montreal.log
sudo chmod -v go+w /var/log/montreal.log


sudo launchctl load /System/Library/LaunchDaemons/com.apple.syslogd.plist

Then, I also added the following to /etc/syslog.conf

local4.*                        /var/log/montreal.log
local6.*                        /var/log/edmonton.log
local0.*                        /var/log/toronto.log

That's it!

Continue Reading
 Read More

I can finally watch Bloomberg on OS X with only Quicktime & Flip4Mac installed, and the audio is working!. No need to run the old Windows Media Player 9 anymore.

Bloomberg TV

Just open this link with Quicktime:

Bloomberg TV for Mac OS X

What's the catch? This is the stream from Hong Kong (Bloomberg Asia) :) The content is exactly the same, but you'll get different advertisements every now and then. At least you don't need to run a 6-years old WMP9 with Rosetta.

Continue Reading
 Read More
I've just downloaded Firefox 3 Beta 4 on my Mac and Windows machines and tried it out. First impression is fantastic but not without a caveat. First of all, all of the Firefox add-ons from version 2.0.0.x don't work at all.

Firefox 3 Beta 4 Add-ons incompatibility

Secondly, Firefox 3 Beta 4 in OS X does some strange rendering. It doesn't render one of my clients' website correctly in OS X but it looks normal in Windows. If you take a look at the screenshot below, the Contact Us text is rendered just below the cyan box. This doesn't happen on Firefox 2.0.0.x in OS X. Firefox 3 Beta 4 OS X rendering bug Compare this with the Windows rendering, which is identical to v2.0.0.x rendering.Firefox 3 Beta 4 Windows rendering Other than that, general browsing does feel faster. It uses OS X form controls - which is a bit disadvantage for me because everytime I want to check what it looks like on Windows I'll have to go back to Windows again. Continue Reading
 Read More
I'm the kind of guy who prefers typing with a keyboard than clicking and moving a mouse to do things. Another minor annoyances is OS X disables the Tab button by default for selecting buttons (OK, Cancel) in a dialog. If you're a typer and not a clicker, you may find that enabling All Controls option in System Preferences => Keyboard & Mouse makes your keyboard operation more efficient. Continue Reading
 Read More
If you find yourself confused with distinguishing directory & file listing in UNIX, you're not alone. I remember when I first installed of Redhat 5.2 in 1998, I got confused with distinguishing file and directory after ls command. It took me a while to find out that the good news is: it is configurable with color-coded directory listing for easier reading and usability if you're a heavy command line user. The second thing is finding where exactly I am located in the current directory without typing pwd all the time. OS X Terminal with a cool BASH promptSo here's a little step that you can to do to improve your working efficiency in UNIX command line:
  1. Edit /etc/bashrc and add alias ls="ls -laFG" to make directory listing colored
  2. For the command prompt, add the following command: if [ -n "$PS1" ]; then PS1='nu@e[31;1m[w]33[0mn$ '; fi
Continue Reading
 Read More
I've finally purchased OS X Leopard 10.5 and I believe the improvement increases my efficiency working with files than in OS X Tiger 10.4. The first improvement that I'm particularly impressed with is the Columns view in Finder. Even with Tiger, I've always liked Finder's ability to navigate my folders in one click and see the content of the upper directories on the left column. The only quirk is that there is no way I could arrange the sort order by Kind so I can easily see folders sorted on top. I am also surprised, however, that Finder sorts the filename kind by its alphabetical definition of the filetype without placing folder on top. For example: a folder called Library (File type: Folder) will still be placed below com.apple.IntlDataCache.le.sbdl (File type: Document) as you can see above. I find it easier to navigate with KDE File Manager or Windows Explorer where folder is always sorted on top. I am disappointed, however, that, the Open Dialog still has no configurable options to sort by Kind. I'm used to seeing folders on top in Windows, KDE, or GNOME environment. This lack of option in OS X oftentimes slows down my day-to-day operation with files. I hope that the next release of OS X address this issue. OS X Open File Dialog Another improvement over Tiger is the Path Bar (breadcrumb) as you can see below. I've always find it difficult to see folders within folders before Leopard comes out, there has never been a path bar (only shown during Spotlight search result) except the Path button on top, which was really quirky. Although the placement of the Path Bar (inconsistent to where address bar should be) is at the bottom of the window, this is still a very much welcomed improvement. I found it difficult working with nested folders in Tiger as I couldn't see which directory I'm located then. OS X Finder Column View Continue Reading
 Read More

Latest

Tik Tok algorithm is interesting

17.Apr.2024
I don't know how Tik Tok does it and honestly I don't know how its algorithm works. It can't be alg...

How to upgrade Gitlab safely with zero downtime

30.Mar.2024
GitLab is a complex piece of software. If you are planning on upgrading your self-hosted GitLab mac...

How to reduce Proxmox VE guest machine backup size

30.Mar.2024
To reduce a guest machine before you perform a backup, first set the discard flag on the guest mach...

Proxmox and CSF - LAN vmbr2 not working

29.Mar.2024
If somehow you have Proxmox & CSF for blocking outside traffic vmbr0 (WAN), and have a vmbr2 LA...

Scam text message from +1 (604) 339-2192

24.Jun.2017
Today I got a scam text message from +1 (604) 339-2192, telling me to deposit email money transfer ...

Disable free SSL from CPanel

26.Jan.2017
Recently, CPanel has been providing domain validated SSL certificate for free. However, it is quite...

Windows 2012 Server RC Evaluation ISO direct link

2.Aug.2012
I've been wanting to download the latest version of Windows 2012 but for some reasons I keep gettin...

Scam from TextWon.com/Ziinga (claiming to be BestBuy) sent by (917) 690-6874

3.Jul.2012
This morning I received a scam spam message from (917) 690-6874. Becareful because this is not a le...

Oracle VM Server on Lenovo W520 with i7-2860QM and 32GB RAM, 1.5TB RAID

2.Jul.2012
I've been curious about Oracle VM Server and wanted to try it for my own home lab. I've had the VMW...

Ubuntu 12.04 on Lenovo W520 with Intel RAID - don't waste your time

24.Jun.2012
I think Ubuntu 12.04 is a big failure. It's unstable and buggy to the point where I think it just d...

iOS 6 - How to get turn-by-turn navigation for older iPhone (3G, 4)

13.Jun.2012
iOS 6 - How to get Siri and turn-by-turn navigation for older iPhone (3G, 4): Sell your old iPhone...

Bitrig - copycat of OpenBSD

13.Jun.2012
Another day and yet another open source project got forked. Bitrig has decided to copycat OpenBSD&n...

Mobile Vendor Trend - 2012

11.Jun.2012
What Google Trends is telling you:...

GMail - Temporary Error (500) - Numeric Code 93

17.Apr.2012
At the mercy of Google when all my data (Google Apps) is in the cloud:It has been down for the last...

Drive Genius 3 - Defrag Failed

28.Mar.2012
I'm one of the folks who bought MacUpdate Spring 2012 Bundle, which includes Drive Genius 3. I've j...