Saturday, June 1, 2013

Install httrack using brew on Mac

Typed
brew install httrack
Then I got:-
==> Downloading http://download.httrack.com/httrack-3.46.1.tar.gzAlready downloaded: /Library/Caches/Homebrew/httrack-3.46.1.tar.gz
Error: SHA1 mismatch
Expected: be6328d2ff3cbabd21426b7acc54edcf1ebb76e0
Actual: 237fca7a9c5c63b53c5d0134dac6e5714422384c
Archive: /Library/Caches/Homebrew/httrack-3.46.1.tar.gz
(To retry an incomplete download, remove the file above.)
So I did:-
brew update
Then I got:-
error: The following untracked working tree files would be overwritten by merge:     Library/Formula/libmusicbrainz.rbPlease move or remove them before you can merge.AbortingError: Failure while executing: git pull -q origin refs/heads/master:refs/remotes/origin/master
To fix it, I did:-
cd /usr/local
git fetch origin
git reset --hard origin/master
After that, I could run "brew update" and "brew install httrack" again with no problem. 

Refs
http://forum.httrack.com/readmsg/25812/25794/index.html
http://apple.stackexchange.com/questions/36862/install-homebrew-package-and-ignore-md5-hash
http://stackoverflow.com/questions/10762859/brew-update-the-following-untracked-working-tree-files-would-be-overwritten-by

Monday, May 27, 2013

Reduce memory usage in Chrome by suspending tabs

Google Chrome seems to use lots of memory especially when there are lots of tabs open at once. It quite often slows down my machine significantly to the point that I have to restart the browser (with all tabs still open after the restart) and then it gradually slows down again. I'm glad I came across The Great Suspender. This extension allows me to suspend any tab manually, or let it suspend idle tabs for me automatically.

Refs
http://lifehacker.com/5982490/the-great-suspender-suspends-memory+hungry-chrome-tabs-you-havent-used-lately
https://chrome.google.com/webstore/detail/the-great-suspender/klbibkeccnjlkjkiokjodocebajanakg?utm_source=chrome-ntp-icon

Friday, May 24, 2013

Convert an object array to a string array in Java


  • System.arraycopy(Object src, int srcPos, Object dest, int destPos, int length);
  • Arrays.asList(Object_Array).toArray(new String[Object_Array.length]);  
  • Java 1.6
        String[] stringArray = Arrays.copyOf(objectArray, objectArray.length, String[].class);

Refs

Friday, May 10, 2013

Find which process is using a file on Mac

Use this command
lsof | grep <filename>
or
lsof <filepath>
To ignore case, use
lsof | grep -i <filename>
Run it as root if the process is owned by root,
sudo lsof | grep -i <filename>
Refs

Getting the error "oasis-text.icns is in use" when installing LibreOffice on Mac


The full error message is

The operation can't be completed because the item "oasis-text.icns" is in use.

To fix it, just quit the SystemUIServer process in the Activity Monitor.

Wednesday, May 8, 2013

Install Force.com IDE on Eclipse 4.2 (Juno)

Cannot complete the install because one or more required items could not be found.
  Software being installed: Force.com IDE 27.0.0.201302151147 (com.salesforce.ide.feature.feature.group 27.0.0.201302151147)
  Missing requirement: Force.com IDE 27.0.0.201302151147 (com.salesforce.ide.feature.feature.group 27.0.0.201302151147) requires 'org.eclipse.update.ui 0.0.0' but it could not be found
Refs

Friday, June 15, 2012

Running Tomboy Note-Taking App on Mac


When running Tomboy 1.10.2 on Mac OS X Lion with Mono 2.10.9 installed, I got this error:-
Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for IgeMacIntegration.IgeMacDock ---> System.EntryPointNotFoundException: ige_mac_dock_get_type
I found that the ige-mac-integration-sharp.dll library used by Tomboy is not compatible with libigemacintegration.dylib in Mono 2.10.9 (some external functions don't exist any more). I'm new to Mono and this library and I just wanted to get Tomboy to run on Mac and also wanted to keep the latest version of Mono so I did a dirty fix by doing the following:-

  • Build Tomboy.
git clone git://git.gnome.org/tomboy
xbuild Tomboy-mac.sln
./bundle-mac-app.sh
  • Copy libigemacintegration.0.0.0.dylib from Mono 2.6.x to Tomboy.app/Contents/MacOS and rename it to libigemacintegration.dylib

  • Transfer all notes from my Ubuntu machine to Mac.
cp /Volumes/tom-ubuntu/.local/share/tomboy/*.note /Users/tomtanti/Library/Application Support/Tomboy/
  • Run Tomboy for testing.
open Tomboy.app
  • Move Tomboy.app to Applications so that I can simply run it from there in the future.
Refs