Lazy Hacker Babble

Just some random babblings from a lazy hacker…

Archive for the 'OSX' Category


Things that still annoys me about OSX/MBP

Posted by hsin on 26th July 2008

The Command-C/V combo to copy and paste is very uncomfortable for my hands. I prefer using the ctrl-c/v spacing but remapping the keys causes other discomforts such as tabbing between windows. Why can’t it be like the other two major systems: Linux and Windows? It always messes me up when I switch to those systems.

The menu bar should go with the app! In our modern day multi-monitor configuration, I hate having Firefox on one monitor but still have to go to the other monitor to get to the menu.

Programmer’s editors. Seems to me that the top editors are ports of those built for other systems. TextMate is pretty good but it doesn’t provide a good print feature for source code which is something I expects from any editor. Yes, I sometimes do print code on tree-based product ’cause you just shouldn’t use your notebook in the tub. Right now I tend to switch between Eclipse, VIM and TextMate. I miss my Visual Slickedit.

Print Preview… why don’t all applications have it?

Spotlight is great except it doesn’t work. I use Quicksilver instead. It doesn’t support email searching for Thunderbird. Boo.

Posted in OSX | No Comments »

Disable OSX Dashboard

Posted by hsin on 23rd July 2008

defaults write com.apple.dashboard mcx-disabled -boolean [YES|NO]

killall Dock

Posted in OSX | No Comments »

OSX shortcut keys

Posted by hsin on 20th July 2008

Page UP: FN + Shift + Up arrow
Page Down: FN + Shift + Down arrow
Home: FN + Shift + Left arrow
End: FN + Shift + Right arrow

delete a file: CTRL-delete

Posted in OSX | No Comments »

iPhone

Posted by hsin on 17th March 2008

This past week, I got myself an iPhone since my wife had to switch to AT&T and it was cheaper to move the same carrier then paying two separate bills. I didn’t have a strong desire to get an iPhone, but if I was to get a new phone I wanted one that was new for me to play with. My initial impressions of the iPhone is pretty good although depending on your perspective then it is either an expensive mp3 player or expensive mobile phone. It’s whether the combined functionalities justifies the price.

Having access to the internet anytime with a fully functioning web browser is no doubt… awesome. This was my #2 reason for liking the iPhone. This worked pretty well right out of the box and I had no problem connecting through the phone or getting it set up to access my home WIFI. The only thing missing is the ability to play songs from internet radio stations especially given that this is a combined music/video/phone device.

As a proud Dad, I naturally have the urge to show off pictures of my son, but I resisted the “carry 100 pictures in my wallet” stereotype. Well, with the iPhone I can be the modern day equivalent of it and literally carry thousands of pictures to show from the phone (don’t worry, I’m not carrying that many). The image quality looks good on the iPhone screen, but since I was managing my photos in Picassa, I had to create an album for the iPhone then export that album to a directory that I tell iTunes to sync. I have to do this each time I want to add a new picture. It’s a workable solution but not a great one.

Using VLC, I was able to convert my divx/xvid video to mp4 which I can copied to the iPhone and watch while I travel. The video quality and sound was excellent. I wish I could this as easily on the DS.

As an PDA device, the iPhone comes a little short and is more an phone then a Blackberry competitor at this point. Managing contacts could be easier in my opinion and the default list of apps is what you expect on a phone (calendar, clock, notepad).

As a phone, the quality is good, but the lack of a speed dial function sets it back to the stone age in that area.

As a music player, having to buy an adapter before being able to use regular headphones is plain silly.

The iPhone looks beautiful coming out of the box, but the shining silver band around the display is scratched easily even if the glass is more difficult to get scratched. It doesn’t matter though because when the border gets scratched the whole aesthetics of the device is compromized I’m talking about it being scratched by lint, folks! I had the device in my pocket (nothing else there, no coins, keys, pieces of paper, etc) for 10 minutes and it still got some scratches. I had to buy an iPhone condom to protect it from further scratches and to hide it.

Overall, it’s a good multi-function device but it’s not a PDA with a phone. It’s a phone with more advanced PDA functionality then typical phones. Or it’s a mobile media device with a phone and PDA functionality. If the iTouch had a camera, I’d probably have gone with it since my wife would already have the internet covered on her phone. The iPhone is a very good first generation device and has a lot of potential to be more in the future. I hope that future won’t be dominated by just Apple but that other companies will learn from the success of the iPhone as to what people are looking for and more.

Posted in Gadgets, OSX | 1 Comment »

Calendar App

Posted by hsin on 26th January 2008

Having an easily accessible calendar is extremely helpful. Some people use widgets/gadgets/PIMs/Outlook, etc. I generally like to have a small calendar on my desktop showing the current and following month.

With Geektools, I went with the classic Unix program ‘cal’. I have Geektool call ‘cal’ to show the current month and a second call to show the next month.

geektool to display calendar

Posted in OSX, Software | No Comments »

Feelings on the Macbook and OSX

Posted by hsin on 26th January 2008

I’m getting more used to using OSX/Macbook although a few things still nags at me. I’m still more used to having the application’s menu within the frame of the application instead of at the top of the OS (especially noticeable when I’m using a dual monitor setup), and I wish Apple would allow the screen to tilt back more, and why are they so unwilling to provide a docking station?!?

The keyboard is nice and comfortable, but a two button mouse is still preferable. Overall the system runs well, but I don’t feel it’s a speed demon. For those running Windows on OSX, 4 gig is recommended. Running with 2 gig is ok, but it’s like running Windows on 1 gig while also slowing down OSX.

I like Quicksilver and Geektools and I love the UNIX underlying. The support for external display kick the butts of my windows notebooks (especially ones by HP). The dimensions of the 15″ Macbook and the weight balance is excellent. The 17″ model is too big to travel around with and the Airbook just isn’t that compelling to me. Personally, I feel the 15″ is the sweet spot in Apple’s notebook line.

Posted in Gadgets, OSX | 1 Comment »

I don’t get the Apple Nation…

Posted by hsin on 20th January 2008

Truth be told, I never paid too much attention to the Apple Nation. Sure, I kept up-to-date on many of the products they release, but not because they were from Apple. It was more that I wanted to see what’s the latest mp3 player and the iPod is one of the top choices, etc. This is just to say that I never paid much attention to Macworld other then read a news article here and there after the fact.

Since I got the Macbook Pro, I’ve been finding out a little more about Apple stuff mainly because I’ve been looking for software and utilities and since you can’t go to any Apple-related site without hearing about Macworld, I actually paid some attention to Steve Jobs’ announcements. This year there doesn’t seem to be much revolutionary new products coming from Apple as compared to last year when they announced the iPhone. At the same time, though, the Apple fanbois made everything sound like Apple has just invented fire.

Macbook Air? It’s a pretty neat product and while it might be something new in the Mac universe, sub-notebooks are hardly a new thing here in the rest of the world. Almost as soon as it was announced, Gizmodo did a comparison of Apple’s sub-notebook with 5 other sub-notebooks. At most in the sub-notebook category, it has some evolutionary refinements, but the Apple Nation was cheering as if they’ve never seen a light portable notebook before…

Posted in Gadgets, OSX | 3 Comments »

Customizing my work environment.

Posted by hsin on 14th January 2008

I’m continuing to get more familiar with working with a Macbook Pro and am starting to customize it to suit my working style. The first thing was to get some parity with what I was used to in Windows. At work, I have two machines (Macbook Pro notebook and a Linux workstation) and two monitors (24″ LCD and 17″ LCD). I previously had a Windows notebook instead of the Macbook and had configured my system to be a three monitor system. The Windows notebook was on the far left and connected into a docking station. I used the notebook’s LCD for Thunderbird, IM buddies, etc.

To the right of the notebook, I had the large monitor which is the extension of the Windows desktop and what I’m staring at most of the day (when I’m at my desk that is). Next to large monitor is the 17″ monitor that is connected to my Linux work station.

There is only a single keyboard and mouse, and both are connected to the Linux workstation. By running a VNC Server on the Windows machine and a program call x2vnc on the Linux machine, I can move the mouse/keyboard cursor across all three monitors as if they were one and even copy-and-paste between UNIX-Windows apps. The only limitation is that Linux apps can’t be moved off the the 17″ screen and Windows apps can’t be on the 17″ screen, but effectively my one keyboard and mouse controls both computers.

Being so used to VNC, I tried to do the same thing with OSX. Imagine the above system except with the Macbook instead of the Windows notebook. At first I tried using Apple’s Remote Desktop which is suppose to be basically a VNC Server. The problem is that x2vnc or any other vnc client I tried could connect to OSX. I then downloaded a VNC Server for OSX, but that didn’t recognize the dual monitor display of the notebook+external monitor.

Fortunately, the solution was the open-source Synergy tool which does much of the same thing as x2vnc and has both a server and client for Linux and OSX. Basically, on the Linux workstation, I run the Synergy “server”. On the Macbook, I run the Synergy “client” and now I can do what exactly the same thing as before with one mouse and keyboard.

Installing Synergy was a snap. On Linux, use whatever your app management tool might be (i.e. “yum install synergy”) and on OSX use Macports (i.e. sudo port install synergy). The Synergy site has instruction on what the configuration file should be and then it’s just a matter of running the programs on each machine.

With my physical environment ready, I started to tackle trying to get a good ToDo app for OSX. For me, a todo utility must be easy to access. I’m too lazy to have to move my hands from the keyboard to the mouse. ^^; I also want the data to be presented simply and non-obtrusively. It’s surprisingly hard to find this combo. Even on Windows, I didn’t have a great solution: I used Google Desktop’s todo widget which required that I use the mouse to select the widget before I can type into it, but the look was simple and basic.

I tried a few Mac Todo lists and was going to go with DoIt since it had Quicksilver integration that allowed me to write items to the list with keyboard strokes… almost. The problem was that DoIt also requires you select a category from a drop down list before it adds the todo item, and for the life of me I couldn’t figure out how to select the category without using the mouse.

I finally came across a mixed low-tech/high-tech solution. Quicksilver has an action called “Append to text file”. Using a simple text file (i.e. todo.txt), I created a trigger and keyboard shortcut that when hit, let’s me type a todo item that gets appended directly into the text file. To see my changes, I used a very neat little app called Geektool that display a transparent window containing the text output of anything log file, script output or image.

Todo List

One limitation of this setup was that I used Geektool’s file type to handle the display of the todo file. This only works when the file is appended to at the end like typical log files. This means that if you edit the file with another application, the change doesn’t show up. The solution is to not use “file” but use a Geektool “command” with a refresh timer. By using the command, “curl ” every 30 seconds, it’ll regularly update the window with whatever is in the text file. Not as good as detecting a change automatically, but works well.

Posted in Gadgets, OSX, Programming, Software | 2 Comments »

OSX Networking

Posted by hsin on 3rd January 2008

Setting up wireless connection was surprisingly easy and I was able to get it up in minutes, so points there for Apple. I connected the machine through the built-in ethernet at work and the performance was dog slow! I saw packet loss of about 70 percent so definite negative points. Initially I thought that there might have problem with the ethernet hardware but then I read online that Macbook Pros have problem if they are on a LAN that has 802.1q/vLAN. The problem is discussed here.

I hook the notebook on another network and it performed fine so it seems like I got bit by this same bug. I’m surprised that Apple still haven’t fixed it, but I suspect this mainly effect corporate users which might still not be a big customer base for Apple to pay attention to.

Posted in Gadgets, OSX | No Comments »

Dev environment on OSX Tiger

Posted by hsin on 2nd January 2008

I feel like I’m behind at work recently so I didn’t want to start the new year at the office spending time configuring the new notebook. The baby was nice to me tonight and went to bed early so it allowed me to have the chance to get my development environment on the new Macbook Pro with OSX Tiger configured. Thanks to M in Ohio who saved me hours of time by pointing me to the right solution.

The nice thing about the OSX is that it is build on top of UNIX which is a developer’s OS. You’ll find that most open source tools are available and if not then getting it compiled from source is usually possible. I used compile everything from source including the kernel, but now that I am a lazy old man, I tend to prefer using some sort of package management solution that has the dependencies resolved. For Linux, I like the yum package management tool that sits on top of RPM. It beats the hell out of downloading the source and figuring out all the dependencies.

M pointed me to MacPorts as a similar repository/package management solution for OSX open source packages. It’s really easy to use. Simply download the install package from the site, run it and you’re ready to go. I did ran into one bug where it didn’t create a .profile file for me so the path to “port” couldn’t be found. I’m not sure why, but a quick look on the site and I knew which directories to add to my $PATH variable.

export PATH=/opt/local/bin:/opt/local/sbin:$PATH

Don’t forget to “source ~/.profile” to pick up the change.

With MacPorts installed, it was only a matter of grabbing the programs I needed for a web development environment: Apache2, MySQL, PostgreSQL, PHP5.

Installing Apache2:

  • sudo port install apache2
  • copy /opt/local/apache2/conf/httpd.conf.sample to /opt/local/apache2/conf/httpd.conf
  • sudo /opt/local/apache2/bin/apachectl start
  • point your browser to http://localhost to see that everything is running.

Installing MySQL and PostgreSQL:

  • sudo port install mysql5 +server
    (at the end of the install, it tells you the command you should run to initialize the mysql db)

  • sudo port install postgresql82 +server

Installing PHP5 with support for MySQL, PostgreSQL:

  • sudo /opt/local/apache2/bin/apachectl stop
  • sudo port install php5 +apache2 +mysql5 +postgresql +sqlite +pear
  • sudo cp /opt/local/etc/php.ini-dist /opt/local/etc/php.ini
  • sudo vi /opt/local/apache2/conf/httpd.conf
    • add “Include conf/extras-conf/*.conf” to /opt/local/apache2/conf/httpd.conf
  • sudo /opt/local/apache2/bin/apachectl start

Installing Eclipse IDE:

  • Download the IDE from Eclipse.
  • unarchive it to whichever location you want to run it from (I put it in /Applications/eclipse).

With that, the an Unix development environment capable of doing web development with PHP, MySQL and/or PostgreSQL as well as Java/C/C++ development is all ready!

For a little more detail about the set up process, I stumbled on this nice post.

Posted in Gadgets, OSX, Programming, Software | No Comments »