Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

How to take simulator screenshots for Android is a frequently asked question. There are many ways to do it, but I'd like to show you the easiest and quickest way for Windows and OS X.

I assume here, that you have already installed the Android SDK. If not, you can install it from https://developer.android.com/sdk/index.html

Ok, now just start your simulator as usual. After your simulator is already up and running, go to the Android SDK folder/tools and start the monitor tool (or just search for monitor in the SDK folder).

In the Monitor tool, when you look at the toolbar you have a screenshot icon there. Click and voila, there you are!


After I came back from my last vacation, the first thing I did was updating my system to Mavericks. Of course, I read some recommendations before if it is worse to update or not, but after some researches I thought nothing can go wrong :)

The OS X update itself worked for me like a charm without having any problems, but there was one thing I mentioned first: Java is no more included in OS X 10.9 Mavericks. Ok this was easy to fix. The real problem started after I wanted to build my Sencha Touch application via Sencha CMD.

When I started the Sencha CMD build I received a message, that not the right Ruby version is installed on my system.
[ERR] Detected ruby version 2.0.0 was not less than 2.0. Please install ruby 1.8 or 1.9
After some researches on the web, I found the following information:

  • Ext JS themes use Sass variables whose value are set to "null !default".
  • Sass changed the behavior of such things and broke those themes.
  • Sencha Cmd embeds a version of Sass that is known compatible with Ext JS themes.
  • Ruby 2 changed some API and broke that version of Sass.
So the only solution for my problem was going back to Ruby 1.9 to make my Sencha CMD build working again.

There are a lot of ways to downgrade Ruby, but a very straight forward and easy way by using RVM is described in the following article: http://moduscreate.com/sencha-cmd-not-working-in-os-x-10-9-mavericks/



Go to Terminal and open the bash_profile:
vi ~/.bash_profile
Press "i" to insert and copy the following line to the bash_profile script (Make sure that the path matches your XAMPP installation):
export PATH=/Applications/XAMPP/xamppfiles/bin:$PATH
Commit the current changes while pressing ESC and writing :wq + ENTER 

To apply your changes to the current Terminal session, type:
source ~/.bash_profile
or just close and open the Terminal again.
Mac OS X offers you a smart built-in solution to secure your files and folders. It is possible to create an encrypted disk image, it is like a regular disk image but requieres a password to become mounted. How this works, I'd like to show you in the following steps:
  1. Open Disk Utility (press + SPACE and type disk utility).
  2. File > New > Blank Disk Image.
  3. Type a name in the Save As field. This name will be used for the disk image.
  4. Choose a preferred location to save the *.dmg file.
  5. Select a size for the disk image.
  6. Choose as volume format the default Mac OS X Extended (Journaled)
  7. Use "sparse disk image" for a disk image that only uses as much space as it needs, rather than a set amount of space.
  8. Choose 128-bit AES encryption (or 256-bit AES in Mac OS X v10.5 or later, but slower). I would suggest 128-bit AES encryption. 
  9. Click on "Create" button.
  10. Enter a strong password and don't forget to deselect "Remember password (add to keychain)" if you don't want it saved. Because if you do, your created disk image is less secure.




Okay nothing new here, but maybe it inspires you to use "hot" keys more often  :)
  1. CRTL + Q goto last edit location
  2. CRTL + SPACE completes everything
  3. + S removes current line or selected lines
  4. + L goto line number
  5. + ALT + copies current line or selected lines to below
  6. + ALT + copies current line or selected lines to above
  7. ALT + moves current line or selected lines to below
  8. ALT + moves current line or selected lines to above
  9. + SHIFT + 7 Toggle comment*
  10. + goto the beginning of a line
  11. + goto the end of a line
  12. + SHIFT + L brings up a List of shortcut keys
Something missed? - See Windows -> Preference -> General -> Keys.

* You may have to disable the OS X hotkey (  + SHIFT + 7 brings up the help menu).



AJAX-Requests for local files are not working on Google Chrome.
XMLHttpRequest cannot load file:///Users/… . Origin null is not allowed by Access-Control-Allow-Origin
To bypass, either use a HTTP server or start Google Chrome with a command-line switch. Open the Terminal and type the command below:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --allow-file-access-from-files
If you receive a message like:
XMLHttpRequest cannot load ... Cross origin requests are only supported for HTTP.
Open the Terminal and type the command below:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --disable-web-security

As long as web security is disabled, it is not recommended to surf on public internet pages. In this mode your web browser is vulnerable for any kind of cross-site scripting.

For more information about Google Chrome command-line switches, take a look at Google Chrome command line switches.


Today I had a small problem - how to make hidden files and folders visible in Finder?

After some researches on the web, I found the following solution:

Open the Terminal and run the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
Before the changes will take effect, you need to restart Finder by running the following command:
killall Finder
Done!

To hide hidden files invisible again, open a Terminal and run the following command:
defaults write com.apple.finder AppleShowAllFiles FALSE
killall Finder


You want to use Time Machine over WIFI? - Then you have to buy a Time Capsule or you run a Time Machine at Ubuntu.

Tested with iOS 10.8.2 and Ubuntu Server 12.04

You did an unsuccessful installation before?

For the case that you did, remove Netatalk and all configuration files:
sudo apt-get remove --purge netatalk

Preparing the Ubuntu server...

From the Terminal (press + SPACE and type terminal) you have to run the following command to install Netatalk:
sudo apt-get install netatalk
Note: See also Netatalk HTML documentation for more details.
Configure the afpd server:
sudo vi /etc/netatalk/afpd.conf
Add the following line at the end of this file:
- -tcp -noddp -uamlist uams_dhx.so,uams_dhx2_passwd.so -nosavepassword
Check if CNID_METAD_RUN=yes in "/etc/default/netatalk" file. Otherwise change it. Create a new user for the Time Machine connect:
sudo adduser username
Go to the newly created user directory and create a backup folder there:
cd /home/username/
mkdir time_backup
sudo chown -R username:username time_backup
Configure the newly created backup directory in Netatalk:
sudo vi /etc/netatalk/AppleVolumes.default
At the end of the file you add the following entry:
/home/username/time_backup "My Time Machine Backup" allow:username cnidscheme:dbd volsizelimit:250000 options:usedots,upriv,tm
Make sure that you adjust the directory and username to your needs. With "volsizelimit" you can define the maximum size of the backup. In this case 250 GB.

After you are finished with all the configuration staff you need to restart the Netatalk service:
sudo service netatalk restart
Don't forget to allow afp if you are using ufw - Uncomplicated Firewall:
# Allow network access to the ports 548 and 427
sudo ufw allow 548
sudo ufw allow 427
sudo ufw disable && sudo ufw enable 

Preparing the Mac client...

To allow unsupported network volumes, you have to run the following command in Terminal (press + SPACE and type terminal):
defaults write com.apple.systempreferences TMShowUnsupportedNetworkVolumes 1
"Connect to your server" (open Finder and press + K) and type the address of your server:
afp://ip_address
Congrats, your Ubuntu server volume should be visible and ready for Time Machine usage now.


Well, there are many ways to access a Mac via remote desktop... I'll explain a very simple way here.

On your Mac, go to Settings -> Sharing -> Screen Sharing and enable the VNC option + a password. Make sure that you have enabled the Screen Sharing itself too.

That's it! Your Mac is ready for a VNC connection now.

If you want to connect to your Mac from another computer, you can use a client like http://www.realvnc.com/.


To enable the inspector you need to type the following in Terminal (press + SPACE and type terminal) once:
defaults write com.apple.Safari IncludeDebugMenu 1
Restart safari... You will now see the "Inspect Element" item in safari contextual menu.