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?



GRE GMAT CAT Wordlist - TurboPack 4

Guys, I have seen many people trying by-heart the dictionary all at once while trying to prepare for the verbals of these competitive exams. In my opinion, its wiser to take small batches of words and work on them regularly. Hence the name TurboPack which is essentially a small batch of 10 random words in non-alphabetical sequence. I will try to post some word-sets like these at regular intervals. Make sure you bookmark them for future references.

Also, in case you missed, here's the list of previous TurboPacks.

TurboPack 1
TurboPack 2
TurboPack 3

Tip : Learn the meanings of these words and try to use them in any sentences. For starters, you could add a comment to my blog post with a sentence including a word you just learnt from the TurboPack. Try to have a conversation with someone and use these words randomly. I bet this approach will significantly boost your memorisation.


So here is the latest TurboPack for the day.

diadem : a jewelled crown
amazon : female warrior
cataract : a large waterfall, an eye abnormality
facsimile : copy
contusion : bruise, an injury
encumber : burden in such a way that movement is restricted
kernel : a central or vital part, core
maxim : proverb, a short statement of general truth
noxious : harmful, unpleasant, poisonous
orator : an eloquent/skilled public speaker

That's it for now. Will try to post more exciting and interesting TurboPacks very soon. In the meantime make sure to post an instant comment with some random sentence making use of the above words. Ciao!

GRE GMAT CAT Wordlist - TurboPack 3

The TurboPack 3 wordlist for today is as follows guys. Also do checkout TurboPack 1 and TurboPack 2 for reference.

apparition : ghost, phantom
buccaneer : pirate
nomenclature : terminology, the system of naming things
modicum : small amount, limited quantity
fallacious : based on a fallacy or mistaken belief, misleading
ewe : female sheep
cessation : stoppage, bringing to an end
pragmatic : practical, in a realistic way
recline : lie down, lean back
forlorn : sad and lonely, desolate

Friday 1 April 2016

Upgrade Subversion on Mac OS X using Homebrew

Hi guys, in today's article we will see how to upgrade Subversion on Mac OS X using Homebrew. Subversion i.e SVN as you know is a popular centralised version controlling system.

First of all check in Terminal, the default pre-loaded version of Subversion that comes packaged with OS X.

svn --version
svn, version 1.7.20 (r1667490)

Now lets install Homebrew on the machine. For that just type the below command as mentioned on Homebrew's homepage. Btw for those who may be unaware, Homebrew is a free open source package management solution.

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Now it will begin the installation process and will change/update the owner and permissions of the following folders.

==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/man/man1/brew.1
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to ironcladzone:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin


Once Homebrew is installed, we need to install Subversion using it. First of all lets get some information about svn installation. Type this in terminal :

brew info subversion

subversion: stable 1.9.3 (bottled)
Version control system designed to be a better CVS
https://subversion.apache.org/
Not installed
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/subversion.rb
==> Dependencies
Build: pkg-config , scons
Required: sqlite , openssl
Optional: gpg-agent
==> Options
--universal
Build a universal binary
--with-gpg-agent
Build with support for GPG Agent
--with-java
Build Java bindings
--with-perl
Build Perl bindings
--with-python
Build with python support
--with-ruby
Build Ruby bindings
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

You see there are some dependencies that Brew will install along with Svn. Dependencies like sqlite, openssl etc. Proceed with the installation now and be patient for a while till it finishes.

brew install subversion

==> Installing dependencies for subversion: readline, sqlite, openssl
==> Installing subversion dependency: readline
==> Downloading https://homebrew.bintray.com/bottles/readline-6.3.8.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring readline-6.3.8.el_capitan.bottle.tar.gz
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.
.
.
.
==> Caveats
svntools have been installed to:
  /usr/local/opt/subversion/libexec

Bash completion has been installed to:
  /usr/local/etc/bash_completion.d
==> Summary
🍺  /usr/local/Cellar/subversion/1.9.3: 148 files, 11.1M

Just check which svn versions are installed on your machine. I mean the locations of svn.

which -a svn
/usr/local/bin/svn
/usr/bin/svn

Now after the installation is complete, if you check svn --version you will still see the older version of svn. Hey but it should be 1.9.3 the latest version right?

svn --version
svn, version 1.7.20 (r1667490)

To fix this we need to add a line to ~/.bash_profile

sudo vi ~/.bash_profile

export PATH="/usr/local/bin:$PATH"

Now type : source ~/.bash_profile

Check the svn version now and it will show the latest one.

svn --version
svn, version 1.9.3 (r1718519)

Cheers! You just upgraded Subversion on Mac OS X. Hope it helps guys!

Wednesday 30 March 2016

Metal Gear Solid V - Phantom Pain : Cloaked in Silence S-Rank FullHD Walkthrough

Guys, check out the High definition Hi-resolution walkthrough of Episode 11 : Cloaked in Silence of the blockbuster video game Metal Gear Solid V : Phantom Pain.

In this episode, you encounter the female Vanguard Sharpshooter "Quiet" in Afghanistan. It is usually triggered automatically when you pass a specific area [Aabe Shipaf Ruins] while going for the Stun-Arm blueprint Side Ops mission. You can either kill her or capture her and take to your Mother base. The choice is yours. If you capture her, you could use her as your buddy partner in future missions.

Tips and Tricks : 

  • This mission is particularly difficult coz Quiet has a sharp sight. She spots you quickly and also does lethal damage to your health when hit. Use the stones and rocks as your cover as much as possible.
  • She also has invisibility powers and zips around pretty fast. Also note that although if you spot her with the Analyser, she is untraceable after a while and you lose her position. Stay sharp!
  • Keep moving around and don't stay at one place for long.
  • While spotting Quiet with the Analyser, keep checking the Mic volume to hear her humming a soft tune. This helps to pinpoint her location.
  • If you lose her sight, stand up or come out in the open for a few moments to identify the angle  from which she spots you. It's risky I know.
  • Once you spot Quiet, immediately draw your Sniper Rifle for a quick hit. Make sure you do it accurately within a matter of few seconds. Time is of essence here.
  • There are multiple ways of hitting her in either lethal or non-lethal ways, this video will focus on the traditional approach using only the sniper rifle.

Check out this impossible S-Rank walkthrough video for reference :

Tuesday 29 March 2016

Modify a part of file path using Sed in Mac OS X - Tricky Scenario

Lets look into a fairly simple task with a slight twist today - update/modify a part of the file paths mentioned within a file using Sed from command line in Unix/Mac OS X. Mark this as a tricky interview question.

Let's consider a simple example. For instance we have a text file named Filepaths.txt which has the following file path details :

/Users/ironcladzone/Downloads/file1.txt
/Users/ironcladzone/Downloads/image.jpg
/Users/ironcladzone/Downloads/presentation.ppt
/Users/ironcladzone/Downloads/Spreadsheet.xls
/Users/ironcladzone/Downloads/Audio.mp3
/Users/ironcladzone/Downloads/Movie.avi
/Users/Shared/Downloads/Test1
/Users/Shared/Downloads/ABC
/Users/ironcladzone/Downloads/MovieClip.mov

Here we want to replace only a part of the file path i.e replace all instances of the word"Downloads" with "Documents". Sure you can instantly do it in some text editor using "Replace All". But the catch is I want to replace the word Downloads with Documents if and only if it exists in the /Users/ironcladzone/Downloads/ path. I want to skip all other file paths. In this case I want the path /Users/Shared/Downloads/Test1 & /Users/Shared/Downloads/ABC to remain intact and unchanged.

So let's see how to do it from command line using a Sed regex.

Open up terminal and type this :

sed 's/\/Users\/ironcladzone\/Downloads/\/Users\/ironcladzone\/Documents/g' FilePaths.txt

So here's the output as expected. Cheers!

/Users/ironcladzone/Documents/file1.txt
/Users/ironcladzone/Documents/image.jpg
/Users/ironcladzone/Documents/presentation.ppt
/Users/ironcladzone/Documents/Spreadsheet.xls
/Users/ironcladzone/Documents/Audio.mp3
/Users/ironcladzone/Documents/Movie.avi
/Users/Shared/Downloads/Test1
/Users/Shared/Downloads/ABC
/Users/ironcladzone/Documents/MovieClip.mov

Friday 25 March 2016

Logging in Ant : Live Practical Example

Hi! Hows it going guys! Today is an auspicious Indian day - Holi : the festival of colors. On this good auspicious day am also presenting a fresh new 200th post.

Let's look into a simple concept - how to take logs in Apache Ant builds. By taking logs I mean how to capture the console output in a log file.

The foremost thing you need to be aware of is the <record> task with which we tell Ant when and where to capture the console into a log. Detailed explanation of the task can be read at Ant Official Manual.

Let's use a familiar example that we used in our earlier posts - Ant build.xml updates : Feb 28 and Ant - Build.xml Introduction.

Check out our new updated build.xml below :

<?xml version="1.0" encoding="UTF-8"?>

<project name="AntBuildTest" default="generate-docs" basedir=".">

<property name="build.home" value="${basedir}" />
<property file="build.properties"/>

<tstamp>
<format property="timestamp" pattern="dd-MM-yyyy"/>
</tstamp>

<target name="clean">
<delete dir="${build.home}/src" />
<delete dir="${build.home}/bin" />
<delete dir="${build.home}/lib" />
<delete dir="${build.home}/test" />
<delete dir="${build.home}/dist" />
<delete dir="${build.home}/docs" />
<delete dir="${build.home}/logs" />
</target>

<target name="createdir" depends="clean">
<mkdir dir="${build.home}/src" />
<mkdir dir="${build.home}/bin" />
<mkdir dir="${build.home}/lib" />
<mkdir dir="${build.home}/test" />
<mkdir dir="${build.home}/dist" />
<mkdir dir="${build.home}/docs" />
<mkdir dir="${build.home}/logs" />
<record name="${build.home}/logs/build.log" action="start" append="no" loglevel="verbose" />
</target>

<path id="classpath">
<pathelement location="${build.home}/bin"></pathelement>
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>

<target name="copydir" depends="createdir">
<copydir src="${workspace.src}"
dest="${build.home}/src"></copydir>
</target>

<target name="compile" depends="copydir, clean">
<javac classpathref="classpath" includeantruntime="false"
srcdir="${build.home}/src"
destdir="${build.home}/bin"
includes="**/*.java"></javac>
</target>

<target name="create-jar" depends="compile">
<jar basedir="${build.home}/bin" destfile="${build.home}/dist/${timestamp}-TestJar-${versionnum}.jar"
includes="**/*.class">
<manifest>
<attribute name="Main-class" value="com.ironcladzone.FileSize"/>
</manifest>
</jar>
</target>
<target name="generate-docs" depends="create-jar">
<javadoc sourcepath="${build.home}/${src.dir}" destdir="docs"/>
<record name="${build.home}/logs/build.log" action="stop" append="no" />
</target>


</project>

Notice the "createdir" task where we started the recorder and in the "generate-docs" we stopped it. The loglevel parameter is an optional one. In this example you see we have set the loglevel to verbose. It means it will have much detailed information in the logs than the default console output. However it can have any of the 5 possible values - error, warn, info, verbose, debug. Experiment with each level to see the difference.

Btw check the directory structure for reference.

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