Showing posts with label Mac. Show all posts
Showing posts with label Mac. Show all posts

View Hidden Files On Mac

Wednesday, September 21, 2011

Run this in the terminal to view hidden files on Mac ..


defaults write com.apple.finder AppleShowAllFiles -bool true

To hide the hidden files back, run this...


defaults write com.apple.finder AppleShowAllFiles -bool false

Relaunch Finder or logout to see the changes

Read more...

Create a debug log for objective c project

Tuesday, September 20, 2011

This is to create a simple log for debugging purposes in objective C

- (void)debugLog:(NSString*)message
{
    NSString *ReportPath = /Your path to generate the log/
    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
    NSString *fileLog = _ReportPath;
    fileLog = [fileLog stringByAppendingString:@"/myLog.log"];

    NSError *error;
    NSFileManager *fileManager = [[NSFileManager alloc] init];

    // if the path was deleted create it again
    BOOL isDir = NO;
    if (!([fileManager fileExistsAtPath:_ReportPath isDirectory:&isDir] && isDir))
    {
        if(![fileManager createDirectoryAtPath:_ReportPath withIntermediateDirectories:YES attributes:nil error:&error ])
            NSLog(@"DNMainController: Error on creating _ReportPath - %@", [error localizedDescription]);
    }

    //if file doesnt exist, create it first for later appending
    if(![fileManager fileExistsAtPath:fileLog isDirectory:NO])
    {
        if(![@"" writeToFile: fileLog atomically:YES encoding:NSUTF8StringEncoding error:&error]) {
            NSLog(@"UtilClass: Error on creating _DebugLog file - %@",[error localizedFailureReason]);
            [fileManager release];
            [pool drain];
            return;
        }
    }
   
    NSFileHandle *handle = [NSFileHandle fileHandleForWritingAtPath:fileLog];
    if (handle) {
        [handle seekToEndOfFile];
        NSMutableData *data = [NSMutableData data];
        [data appendData:[message dataUsingEncoding:NSUTF8StringEncoding]];
        [handle writeData:data];
        [handle closeFile];       
    }
   
   
    [fileManager release];
    [pool drain];

}

Read more...

How To Spoof Your MAC Address on Mac OS X

Saturday, January 8, 2011

Mac address is a unique identifier for every computer network card. You might want to spoof your mac address sometimes for whatever reasons. So, here are the way to do it. It should works with but not limited to Mac OS X 10.4, 10.5, and10.6.

First of all you should take a look on your current MAC address. Launch the terminal and start typing below command and hit 'enter'.

ifconfig en1 | grep ether

You'll  see the result something like this.

ether 00:12:cb:c6:24:e2


So, that's is your mac address. To spoof your MAC address just set it to another hex value in this format : aa:bb:cc:dd:ee:ff. This is how it's done.
Simply type the following command together with your spoof MAC address. For example :

sudo ifconfig en1 ether 00:e2:e3:e4:e5:e6

Check your MAC address again using this command.

ifconfig en1 | grep ether

You should see your new spoof MAC address..

ether 00:e2:e3:e4:e5:e6

Happy trying

Read more...

New Tab in Safari By Default

Friday, January 7, 2011

I love Safari but before this, i'm used to chrome and firefox. By default for chrome/firefox, a new tab instead of a new window will popup when we click any external link but this is not the case is Safari. I can see that there's a lot of user searching for the answer on how to make safari open a new tab by default instead of a new window.. So here is the solution.

Just open you terminal , enter this command, hit 'enter' and you're done..


defaults write com.apple.Safari TargetedClicksCreateTabs -bool true

If suddenly you're thinking to revert back to its original state, you can enter this command into your teminal..


defaults write com.apple.Safari TargetedClicksCreateTabs -bool false

Read more...

Ultrasurf Alternative for Mac

Tuesday, January 4, 2011

Sometimes, every here and there, we need to hide our IP address for whatever reason. The best one for me before this was Ultrasurf. You can just download the package and you can run it straight away without installing it. Furthermore, every browser in the computer will be able to integrate with it automatically.



When I shift to Mac, I've been searching for similar application. The closest that I could find is Tor. Although its not as dynamic as ultrasurf, still it's one of the best. Your can read more or download the app from their website.

If anybody found a better one, do share it with me...

Read more...

Solution for sudo: port: command not found (Mac)

Saturday, January 1, 2011

 This is one of the solution for this famous error message .. 


sudo: port: command not found
I encountered this problem when I first install macports into my macbook. FYI, I'm running on OS   X10.6.3 (Snow Leopard). After the installation I tried to run this code but it return the error as above.

Read more...

Mac Keyboard Shortcuts

I'm fairly new to MacBook. I've used Windows all my life until one day, I decided to try out the most powerful OS in the world and I'm glad I did. Now, I don't have to worry about the small things especially about the virus. But Anyhow, I can't seems to remember all Mac keyboard shortcuts which are very useful sometimes. So here it is ...

Read more...
Technology blogs Blog Directory

  © Blogger template Noblarum by Ourblogtemplates.com 2009

Back to TOP