Showing posts with label macos. Show all posts
Showing posts with label macos. Show all posts

Tuesday, April 29, 2014

Mac OS X Boot, Sleep and Wake Time and Date

For several times I wondered what was the exact time my machine booted, woke up or slept. So, I did a little investigation to find out that's actually very simple to get those answers.

Using the Mac OS X Terminal, you can run the following commands:

 
- For System Boot Time, use: systcl -a | grep kern.boottime

You should get results similar to the picture below





- For System Sleep Time, use: sysctl -a | grep sleeptime

You should get results similar to the picture below  




- For System Wake Time, use: sysctl -a | grep waketime

You should get results similar to the picture below




I typically use the "uptime" command (just type uptime on the Mac OS X Terminal) to find out how long my machine has been powered on.

Lastly, you can get a short history of the machine boot using the "last reboot" command (just type last reboot on the Mac OS X Terminal) to get the last three boots of the system.


You can get the same information reviewing system log files but I think opening the terminal and typing a few commands easy enough to get the information you're looking for.

Friday, April 18, 2014

Debugging Oracle ADF Mobile Applications - Part I

I've been involved with the Oracle Mobile Application Framework (a.k.a. ADF Mobile) lately and one of the things developers typically ask me during my talks is how to debug mobile applications created with the Oracle framework.

To give you a little bit of context, the Oracle Mobile Application Framework does generate a hybrid app (native container + HTML/JavaScript) so standard debugging techniques apply here. The Oracle Mobile Application Framework has some other capabilities like running Java code on the device but that's a topic for another post.

So, there is more than one way for debugging Oracle-generated (read hybrid) applications depending on the platform your are own and the target device you are working on. I'll try to isolate specific use cases on different posts so you don't get distracted with irrelevant stuff.

The first one on the list is debugging Oracle Mobile Applications on iOS and Mac OS X.

The ingredients are:

- Oracle JDeveloper 11.1.2.4.0
- XCode 5.1 (for the Simulator)
- Apple Safari

The setup is pretty straightforward and here is what you have to do:

On the iOS Simulator (works on iOS +6.x), go to Settings > Safari > Advanced > and make sure Web Inspector is turned ON.

Open up the Safari web browser and enable the Develop features. To do that, go to Preferences > Advanced and check the Show Develop menu in the menu bar.


If you don't have an app deployed to the simulator yet, this is a good time to do so. Open up JDeveloper and deploy a simple application to the simulator (you can use the same approach with a real device but I'd rather start debugging on the simulator).

Once you have the app installed/deployed and running on your iOS simulator go to Safari and select the Develop menu.   

You should see something similar to the picture below where you select the iPhone Simulator and then the name of your application (in my case - MyWeatherChannel). The below HTML pages are part of your application and highlighting one of them in the Safari menu will also highlight them on the iOS simulator.


Selecting that highlighted page will bring Safari's Web Inspector up. Click on the first icon on the left (Resources) and that should show you the DOM for the page you selected.



At this point, you have many options but you may want to try enabling the Styles (click on the Styles button on the top menu) and make changes to the existing components on the page. That would give a good idea on what to look for when doing further debugging.

You can also manipulate the DOM to change the name or size of the labels and see how they are going to look like.


What is also very interesting are the Timelines (click on the Timelines button on the top menu) where you can see how long it takes to make a network request, to load different components of your application and the details of JavaScript calls.



The last thing I'd like to show you here is the option to enable the Console (click on the Console button on the top menu) and you can many other things like triggering commands or watching the console output. You can also reload the application by pressing Cmd + R.


In the test above, I just fired an alert command (alert("My Test Message");) from the console and saw the JavaScript alert on the simulator.

You can also change the current values (by also manipulating the DOM) in the app like the example below where the command: document.getElementById("ot3").innerHTML=72; changes the value of one the fields in the app.




Happy debugging!





Thursday, September 20, 2012

The mysterious behavior of Mac Mail and Yahoo! Mail Plus

If you, like me, uses Mac Mail as your primary email client and you also have an Yahoo! Mail Plus subscription (which gives you IMAP access to your Yahoo Mail account), you may have experienced an intermittent connection behavior where the email client is not able to connect due an invalid password even though you're using the correct one.

I've been reading lots of blog posts and forums reporting the exact same behavior and I was not able to find a concrete answer but the following approach seems to be working for me so far.

So, next time you see that dialog box requesting that you enter your password again to login to Yahoo, go to your web browser of choice and navigate to Yahoo Mail (mail.yahoo.com).

If you are automatically logged into the system then make sure you click on the Sign Out button first.

When you return to the login screen, type your username and password normally but make sure you select the Keep Me Signed In checkbox and then click Sign In. That should solve the problem.

Have fun...



Monday, March 5, 2012

Installing Erlang on Mac OS X Snow Leopard

I'm working with a customer who is using the Kaazing WebSocket Gateway - AMQP Edition with RabbitMQ and while his install was pretty straightforward on Windows 7 I thought the same would be applicable to my case (a Mac user). Well, to summarize the process, it was quite of a challenge to get everything working, not from the complexity perspective but for the number of steps involved in the process to get the environment running starting from the point that RabbitMQ depends on Erlang to run. So, that was the first step... Installing Erlang on Mac OS X

Here are the steps I had to take:

- Download and install Apple Xcode 4.3 from Apple's AppStore (yeah, you read it right!)

- The tricky part here was to enable Command Line Tools which is not selected by default in Xcode. To do that, go to Xcode Preferences --> Downloads --> Components and install Command Line Tools. It's just another 170MB over the already downloaded 1.35GB of Xcode :)



- Download Erlang latest release from http://www.erlang.org/download.html

- Extract the Erlang package (i.e. tar -xvf otp_src_R15B.tar) and navigate into the recently created directory

- Run ./configure

- Run ./make

- Run sudo make install

Hope this help you to get your project going...


Monday, April 25, 2011

Quick Access to Mac Dictionary

Sometimes you want to know the word definition but don't want to navigate to a website to know what it really means. So, here is keyboard shortcut that will help you a lot faster to get what you need.

1) Hover your mouse pointer over the word you wish to be defined (works in Safari, Mail and other Apple apps). I haven't tried in all of them yet.

2) Press control + Apple Command + D. The word will be highlighted and a Dictionary pop up box will show in the screen with the word definition.

3) Click anywhere in the screen to get rid of that pop up box.

There is also another approach to this using a very cool app called Alfred. Alfred is a must-have productivity tool that lets you automate a lot of things. You can also use Alfred to give you the word definition by just calling the Alfred utility (I use control + space bar) and then typing define and the word you want. The word definition should be presented on the screen for you.

Alfred has so many functions (no need to say that I'm a big Alfred fan already) but that would be a topic for another post.

Monday, March 28, 2011

How to Speed Up Mouse Tracking on Mac OS X

Sometimes I feel that my mouse tracking is not fast enough but when I check its settings on System Preferences it's already set to the maximum possible speed. Here is a very simple (and fast) solution to that problem.

Open Terminal.app (/Applications/Terminal)

Enter the following command:

defaults read -g com.apple.mouse.scaling

That should return the current speed of your mouse tracking as an integer. Mine was 5 and I want to update it to 10. Here is how I did it...

To change the speed of your mouse tracking you can simply run the following command:

defaults write -g com.apple.mouse.scaling your_mouse_speed

where your_mouse_speed is the speed you want to set to your mouse tracking.

Then you'll have to Log Out or restart your Mac to see the changes take effect.

UPDATE: As reported by the reader Squished Spider, if you update your settings using the approach above and perform any changes to the Mouse settings using Mac OS System Preferences later then the system will override everything you did and it will revert them back to the slow mouse behavior even though you've set it to the maximum speed.

Monday, March 21, 2011

How to re-enable Mac Mail plugins after Mac OS X upgrade

I just upgraded my machine to Mac OS X (10.6.7) and unfortunately the plugins I have installed with Mac Mail stopped working one more time. I'm a big fan of GrowlMail, TruePreview and LetterBox and have been using them for a long time.
If you search on the Internet, you're going to find tons of references to this issue that affects Mac Mail plugins when you update your Mac. I haven't written that procedure on my notes and kept googling it every time I faced such situation. Well, I came across a very well written note that I think it's worth mentioning about how to fix that issue and decided to share it

How to re-enable Mac Mail plugins after updates

I hope you find it useful as well.

Saturday, March 19, 2011

Moving to a Cloud-Based Lifestyle

I got a new laptop from my company (OpenSpan) some time ago and as much as I'm a Mac fan, and have been using the Apple hardware for quite some time, the company's standard is Lenovo and MS-Windows.

I try to spend as much time as I can on my Mac but the new laptop is really powerful (Lenovo W510 Intel Core i7 Q720 1.60Ghz, 8GB RAM, Win7 64-bit, 500GB HD) and a huge part of my job is done on virtual machines. Well, Virtual Machines use a lot of disk space, CPU and memory. Sometimes, I also need to run two VMs at the same time which it's kind of impossible with my Mac these days. I have a MacBook Pro Intel Core 2 Duo 2.16Ghz, 4GB RAM, MacOS Snow Leopard and there is no way to upgrade memory on this machine.

So, to be able to work from my Mac on the days that I don't need to spend hours developing or testing something on my VMs but also don't loose the ability to have all of my files updated on the next day when I need or want to log in to my Windows laptop and be ready to go I found that moving to a cloud-based lifestyle would be very appropriate.

Starting with my e-mails, both personal and work related, I have all of them on stored on the server and this approach seems to be fine since I can access them from whatever device I want.

For the files that work with every day like presentations, spreadsheets, virtual machines, text files, pictures, music, etc I have upgraded my Dropbox account to the Basic one which gives me 50GB of storage and that's enough for the most important files that I need to share between the devices I need. Of course a huge clean up process was needed before I move my digital life to this approach. It has been working fine so far and I don't think I want to go back to way it was before copying files manually all over the place and sometimes having problems when I forgot to copy an important presentation to the machine I would be using next day.

Additionally, most of the applications I use every day are "cloud-friendly" and don't require any intervention to continue to work independently of the device I'm logged in to...

Here is a short list:
Note Capturing + To Do - Evernote (Mac and PC)
Instant Messaging - Adium (Mac) and Digsby (PC)
Social Networking - TweetDeck (Mac and PC), Chatter (Mac and PC)
VoiP - Skype (Mac and PC)
E-Mail, Calendar and Address Book - MS-Outlook (PC) and Mail, iCal, Address Book (Mac)
Browser - Safari (Mac) and Chrome (PC)
RSS and News Feed - Mail (Mac) and FeedDemon (PC)

Last but not least there is another important aspect to mention here about the regular backup strategy I used to have. Since Dropbox also keeps a copy of my files I have restructured my strategy to weekly backups instead just in case something really bad happens to DropBox.

If you are interested in take an approach like this, there are several resources on the web pointing you to smart uses of Dropbox and similar approaches to the one I took...

Here are some links to what I found during my research:

Lifehacker: Dropbox Syncs and Backs Up Files Between Computers Instantaneously
Use Dropbox for More Than Just File Syncing

I don't think there is a right or wrong approach but I believe the right approach is the one that works for you.

Wednesday, March 16, 2011

How to Disable Mac Mail.app Inline Image Attachments

If you need to disable (or enable) inline images on Mac OS X Mail.app to view them as attachments, here is what you have to do:
Go to Terminal (Applications > Utilities > Terminal) and then type:
defaults write com.apple.mail DisableInlineAttachmentViewing -bool true
But, if you already have that set up on your system and want to go back, just run the following:
defaults write com.apple.mail DisableInlineAttachmentViewing -bool false
After any of the below commands don't forget to restart Mail.app

Tuesday, March 15, 2011

How to switch windows within the same application in Mac OS X using keyboard shortcut

Just found out how to switch windows within the same application in Mac OS X using keyboard shortcuts. The default behavior when you press Apple + Tab is to switch between applications but if you want to switch to the same application but a different window (let's say you have multiple Web browsers open) all you have to do is press Apple + ` (` is located left to the 1 key and on top of Tab key). Simple!

Setting Up Local Environment for Developing Oracle Intelligent Bots Custom Components

Oh the joy of having a local development environment is priceless. For most cloud based solutions the story repeats itself being hard to tr...