Showing posts with label Apple. Show all posts
Showing posts with label Apple. Show all posts

Thursday 12 May 2016

Play audio file from Terminal on Mac OS X without iTunes

Guys, am sure this post will definitely interest you - how to play an audio file from Terminal on Mac OS X without using iTunes. Well, we play it using the "afplay" command.

Well here's what you need to do in Terminal :

afplay -q 1 --leaks /Users/ironcladzone/Music/Bo\ Saris\ -\ She\'s\ On\ Fire\ \(Maya\ Jane\ Coles\ Remix\).mp3 -d -r 1

Playing file: /Users/ironcladzone/Music/Bo Saris - She's On Fire (Maya Jane Coles Remix).mp3
Playing format: AudioStreamBasicDescription:  2 ch,  44100 Hz, '.mp3' (0x00000000) 0 bits/channel, 0 bytes/packet, 1152 frames/packet, 0 bytes/frame

Buffer Byte Size: 20135, Num Packets to Read: 19
Enable rate-scaled playback (rate = 1.00) using Spectral algorithm

-q switch is to set the quality level. 0 is default for low quality. Set it 1 for high quality version.

-d switch is for debugging which shows you the technical details like frames/packet, buffer byte size etc.

-r is the rate / speed of playback. Default is 1. Try changing it to 2 or 3 for speedier playback ;)

Oh and by the way, in case if you didn't notice, I was playing the cool Maya Jane Coles remix of Bo Saris' "She's on Fire". Maya Jane Coles rocks :)

Saturday 2 April 2016

Mac OS X - Hidden Gems : Part 3

Guys in today's new gem, we'll see how to play the hidden game Tetris on Mac OS X which comes bundled by default for FREE. Didn't you even know that? I bet you didn't!

Allright! So to play Tetris on Terminal, do this :

  • Open Terminal
  • Type emacs
  • Now hit the Esc button and immediately press x

  • When you see the M-x prompt, just type tetris. Now simply relax and play a cool game of Tetris. How cool is that?



Friday 18 March 2016

Mac OS X - Hidden Gems : Part 2

Oh boy! yet another Mac OS X hidden gem that you probably weren't aware of.

Type this is Terminal to read Mrs Fields secret Cookies recipe.

open /usr/share/emacs/22.1/etc/COOKIES

Mac OS X - Hidden Gems : Part 1

Guys, presenting a mind blowing Mac OS X hidden gem that I just stumbled onto.

Type the following in Terminal to read some Apple supplied Jokes :)

open /usr/share/emacs/22.1/etc/JOKES

Thursday 11 February 2016

Shibuya - The Modern Tetris

A few months back I had some real trouble concentrating well on things. A friend of mine suggested I play Tetris once in a while to help improve my concentration. Well, that's when I stumbled across this simple awesome game - Shibuya. 

Shibuya Grandmaster is a modern day refined Tetris with the classic arcade look and feel. The objective of the game is very simple - match multiple blocks of the same color and take them out. But the game needs to be completed in 7 varying speeds. Though the game may seem extremely simple in the beginning, but gets really tough later. The speed list is as follows : 
  • Slow
  • Normal
  • Adept
  • Fury
  • Reflex
  • Machine
  • Gentle Rain
The slow speed is the easiest while the Gentle Rain is really really difficult. The continually faster speeds challenge your reflexes and thereby helps improve concentration. You really need to plan fast based on the upcoming blocks so as to form pairs. You have to couple your concentration with quick adept planning to successfully complete the level in stipulated 2 minutes. All in all, its a beautiful game of concentration and planning, highly recommended to players of all ages.

Check out my gameplay of the Reflex Mode below to get a taster : 


Friday 5 February 2016

Stealth mode in Mac OS X

In Mac OS X, you can enable Stealth mode so that ping requests to your IP address are unreachable.

Go to System preferences -> Security & Privacy -> Firewall -> Firewall Options

Tick the Stealth mode options as shown below:


Now if you try to ping your Mac's IP address from another machine, you'll get the Request Timeout error with the stealth mode enabled.

Tuesday 2 February 2016

Hidden Screenshot Tricks on Mac OS X

Here's a quick guide to the keyboard shortcuts for taking screenshots on Mac OS X.
  • For capturing the entire screen press Command+Shift+3.
  • For capturing only the current active window press Command+Shift+4 and then the space bar and Return.
  • For capturing a specific limited region from the screen press Command+Shift+4 and choose the area by dragging the crosshairs.
Now here'a a small compilation of the hidden tricks of screenshots :
-----------------------
By default the screenshots are saved as a .png file on the desktop. For changing the default save location do the following.
Open Terminal and type the following for example :

defaults write com.apple.screencapture location /Users/IronCladWriter/Pictures

Make sure to replace the location path as desired.
-----------------------
If you want to change the image type from default .png to say .jpg, simply type the following :

defaults write com.apple.screencapture type jpg
-----------------------
To apply the above changes type in Terminal :

killall SystemUIServer
-----------------------

Alternatively you could fire up the Grab application, as seen in Other Utilities


Saturday 11 October 2014

Contra video game for iPad

Guys do you remember the good old days playing classic games like Bomberman, Contra etc during the Atari & Sega console box days. I was recently so happy to see Contra ported to the iPad. I immediately downloaded it and have been playing it for quite some time now. 

For those who are unaware of the game, please note that this is a classic side scrolling shooter action game. In fact it is so addictive, I bet you would play even while commuting or just lazying around the couch. A bunch of weapons goodies like the laser gun, SL gun, SH gun, power shield make for an interesting experience. Also with each new level, the difficulty gets increasing proportionally. Honestly, there's nothing pathbreaking in this game, but play it just for the good old shooting fun. Aah the vintage classics!

Check out a few screenshots here :) This will definitely make you download it.






Saturday 10 May 2014

Lock Screen in Mac OS X

Here's a quick tip for the month of May - Q) How to lock screen of Mac OS X?

Answer : Control + Shift + Eject button

Correct me if am wrong, the Windows equivalent to lock screen is Windows button + L  right

Sunday 20 April 2014

MySQL JDBC Connector on Mac OSX

If you're working on any Java based program which uses MySQL as it's back-end database, you might find this article extremely helpful.

In order to pull data from the MySQL database, it is first important to establish a connection with it so that the script can talk with it.

The connection can be established by using the MySQL JDBC driver. Now, this driver needs to be separately downloaded. Here's the download link btw. If you're working on Mac OSX, please select the platform-independent version of the Connector from the drop down.

Once downloaded, untar the tar (or unzip the zip file). Copy the mysql-connector-x.x-bin.jar to /Library/Java/Extensions.

If you're using Eclipse IDE for editing class files, you need to make some changes in Eclipse's preferences. So go to Eclipse -> Preferences -> Java -> User Libraries. Click 'New' to create a new user library named as "MYSQL_CONNECTOR_LIBRARY" for instance. Now, click "Add External JARs..." button and browse to the downloaded jar : mysql-connector-x.x-bin.jar.

So if you're Java application is trying to connect to MySQL database, the following code snippet might come in handy for quick reference.

import java.sql.DriverManager;
import java.sql.Connection;
import java.sql.SQLException;


try {

connection=DriverManager.getConnection("jdbc:mysql://localhost:3306", "username", "password");

}

Tuesday 1 April 2014

Validate Fonts on Mac OS X

Occasionally or infact very rarely, fonts might get corrupt on Mac OS X. Mac OS X offers the option to validate the authenticity of fonts so that they are safe to use.

Open Fontbook

Click "All Fonts" from the Collection bar on left. Now select and highlight all the installed fonts using shift key (from top to bottom).

From the File menu -> choose Validate Fonts

You'll see the results of the output, something like below. This is a useful procedure to check the font authenticity, if you download & install some third party fonts from the Internet. Just an extra step of caution to make sure that nothing is corrupted. Hope it helps. Ciao.


Tuesday 4 March 2014

Using MD5 checksum utility on Mac OS X

If you might be aware, every Linux distribution comes with the MD5 checksum utility - md5sum. Similarly UNIX flavors like Mac OS X, come pre-bundled with utility called md5

The OS X md5 utility can be found at /sbin/md5

I'll quickly show some steps on how to use it :

  • Open Terminal
  • Create a blank empty file anywhere on the system (I mean just anywhere) using touch


Eg : touch test.xml
  • Now type the following to generate the md5 checksum of this file 
Eg : md5 test.xml > test.xml.md5

That's it. Now open the test.xml.md5 using TextEdit or Text Wrangler and you'll see the file's equivalent md5 checksum. 

If you want to change the format of the output similar to Linux's md5sum use the -r switch 

Eg : md5 -r test.xml > test.xml.md5

Note that MD5 checksums are used to verify the integrity of a file. Even a single new character added to the file will change the equivalent md5 output. Check for yourself. Modify the test.xml by adding some content to it. Now run the md5 utility again as shown above. The md5 equivalent of the file will now be different. The checksums are important to verify that the files / resources are intact throughout and ensure that they are not corrupt or tampered.

You can use this method to verify the integrity of zip or tar files that you download from the internet.

A free utility Checksum Validator is also available. At the heart of it's gui, it uses this md5 command.

This information can come particularly handy while using Maven as well. Suppose for some odd reason, you have to manually create md5 checksums of the dependency jar's - then this method tells you how to do it.

Sunday 2 March 2014

How to Wrap & Tie Macbook Pro Charger Cord

I've seen a lot of naive & experienced Macbook Pro & Air users struggle with tying and wrapping the Magsafe power adapter cord. This is a quick tutorial on how to wrap it the right way in order to carry it in the backpack with ease.

Apple has really put a lot of thought into the charger's wire management. The charger happens to be the most portable one among all laptop chargers. Good job, Apple. So, here are the steps.

Step 1 : Raise the 2 side hooks of the square box of the battery charger.

Step 2 : First take the thick wire side and roll it vertically around the square box. Don't stretch it too much on the first roll.

Step 3 : Now hold the rolled thick wire with your left hand so that it doesn't unwind. With your right hand, take the thin wire side (the side which you connect to the laptop). Roll this thin wire horizontally around the 2 raised hooks of the box. Make sure you don't stretch the thin wire. Just tie it around naturally, without stressing it out. The thin wire side is the most susceptible to wear and tear. So, make sure you don't put pressure on the thin side, so that it lasts longer.

The thin wire which is horizontally wound helps keep the vertically wound thick wire in check.

Take a look at the picture for reference.




Oh and just in case you need a new Magsafe power adapter, check Apple store which sells it USD 79 & Amazon which sells it for USD 73.99. You have a good day, guys. Ciao for now. 

Friday 28 February 2014

Info on Google Chrome with Java 7 on Mac OS X

Fact Check : Guys, did you know the following fact about Chrome : Google Chrome does not work with Java 7 on Mac OS X. Turns out that the 32-bit Chrome browser does not support Oracle Java 7 on Mac OS X.



Folks, please make a note of this, in case you're planning to upgrade Apple supplied Java 6 to Java 7.

Also note that Chrome works perfectly fine with Java 6 while other browsers like Mozilla Firefox & Apple Safari do support Java 7 out of the process.

Refer the following official Oracle Java link about this fact.

Chrome's 64-bit version is among it's future plans as listed on this Chromium Design Documents page.

Thursday 27 February 2014

Tomcat Controller for Mac OS X

Folks, if you've installed Apache Tomcat on your Mac OS X machines for deploying webapps, this post will surely interest you. This quick byte is about a free small useful utility - Tomcat Controller, used for starting and stopping Apache Tomcat with a single mouse click.

Once downloaded, install it. Observe that it will add a new PrefPane in the System Preferences. It supports the newer 64-bit machines and older 32-bit machines as well. However, on newer 64-bit machines, am wondering why it closes and reopens the 32-bit System Preferences. Guys, do drop in your comments if you're aware of the reasons why it happens this way.


You simply have to mention the location pointing to the Tomcat instance. The current version 2.1 works like a charm for Tomcat 6 & 7 alike. Just click Start Tomcat Server. This comes in very handy if you have to bounce the server over and over again.


Finally, if you need some help with installing Tomcat & accessing the Tomcat manager, do refer my previous post. Bye.

Sunday 23 February 2014

Disable Google Chrome Notifications on Mac OS X

All Mac OS X users using Google Chrome browser might have recently noticed a new Google Notification icon ( a grey bell ) on the OSX menu bar.

You'll quickly notice that it's settings menu does not provide any intuitive way to exit or disable it.

In order to disable it, do the following :

Open Google Chrome browser.

In address bar, type chrome://flags

Now search for the option "Enable Rich Notifications" and change "Default" to "Disabled" from its drop down menu. Hope it helps.


Wednesday 12 February 2014

Oracle Weblogic 12c Installation Guide on Mac OSX

This post will walk you through the installation of Oracle Weblogic Application Server 12c on a Mac OSX machine.

First of all, visit the official Oracle Weblogic download page and download the latest generic version. You would need to create a Oracle ID first. Accept the agreement and start the download. In this example, we would download the Weblogic v12.1.2. The filename in this case is wls_121200.jar

Also, note that the generic version does not come with JVM / JDK for its installation. So make sure, you have Java installed on your machine.

Once downloaded, note the following steps :

Run the following command to initiate the installer

java -d64 -Dspace.detection=true -Xmx1024m -jar wls_121200.jar

This will start the extraction of the wls_121200.jar and also perform some routine system pre-requisite checks. Note the arguments that we passed. The space.detection parameter is set to true to detect available space. Also, the max memory usage size by JVM is set to 1024m i.e 1 GB.


Now, you'll the following installer GUI screens.



In the next screen, you'll see the option to modify or change location of Oracle_Home directory. Leave it to default option if you don't want to modify the location. Click Next.


In the following screen, you have to choose the type of installation. Choose the default option. However, choosing the Complete Installation will also install OPatch and some examples like medrec. 


In next screen, you can see the overall Installation summary. Save the response file if you intend to perform silent installations in the future. Check this link for reference. Click Next.


This will start the installation process. This will take a few minutes. You can observe the overall progress here.



Once the installation is completed, you'll see the following screen. Click Finish. This will initiate the next step - Configuration Wizard.


Below is the welcome screen of the Wizard.


Following is the first screen of the Configuration Wizard. Here you can set the Weblogic Administrator account and define the Parent domain location. Click Next.


In next screen, you'll see the progress of the domain creation.


Now, in the next and final screen, you'll see the Configuration success scene. Here you can check the option to start domain. Leave it unchecked, so that we can start it manually. Click Finish. That's pretty much a plain vanilla installation of Oracle Weblogic server 12c on Mac OSX machines.

In my next post, I'll cover how to start and stop Weblogic 12c and any associated issues related to it.

Monday 10 February 2014

Info on decryptedFile.dmg - Mac OS X

I've come across many users who get confused or panicked, the moment they see something strange like "decryptedFile.dmg" in the Disk Utility. Well usually, it is the remnants of the last Flash Player install / update that you performed. Seemingly it is a harmless dmg. Although there is a well-known malware named Flashback, which disguises itself as the decryptedFile.dmg.

If you feel like it might be Flashback, check this link for detailed instructions on how to remove it manually. (Your system is clean if you have to jump from steps 1-3-8-9)

If its not the malware, then note these simple instructions for how to remove the harmless dmg from your system :
  • Open Disk Utility
  • From the left pane, control-click decryptedFile.dmg and choose the eject option
  • Again control-click decryptedFile.dmg and choose "Reveal in Finder" option.
  • Now, once you see the file in Finder (usually it's located in the sub-folders of /var/folders), delete it using Cmd-delete
Also, refer the following Apple Discussion page for more related content.

Wednesday 29 January 2014

Python on Mac OSX

All Apple Macbooks come pre-loaded with Python. On Mac OSX, the Python interpreter is located at /usr/bin/python

You can enter the python prompt (denoted by >>>) by just typing 'python' in the terminal.

Also, in order to quit from the python interpreter (>>>) type quit() or press CTRL-D

Note that Python is case sensitive, so if you type QUIT or Quit instead of quit(), you would get the following error :

>>> Quit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'Quit' is not defined

Tuesday 21 January 2014

Check if a user has root access in Mac OSX

On Mac OSX or any other unix flavor, you can find if a user has root access i.e superuser privileges or not. Open terminal and type the following

Eg:

sudo -l -U ironcladWriter

where the -U switch stands for user name.

If you have root access, you will see the following in the output :

User ironcladWriter may run the following commands on this host:
    (ALL) ALL

If by any chance, you don't know your username, type the following in Terminal :

whoami
Related Posts Plugin for WordPress, Blogger...
eXTReMe Tracker