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.

Sunday 20 March 2016

Double digit Arguments Passed to Shell script - Tricky Scenario

Guys, you know that $# is a special variable that gives the arguments passed to the shell script.

$1 will give the 1st argument passed, $4 will give the 4th argument passed to the script.

Let's consider a tricky scenario. 
Note : This is a tricky interview question.

Let's say you want to pass 12 arguments to the script.

Did you notice that after 9th argument, all arguments passed would be of 2 digits... I mean the 10th, 11th and 12th argument.

So let's say to get the 12th argument, you may tend to use $12. But hey look again! Thats not right! The script doesn't understand that. Check out a practical example to know what I mean.

Let's take a simple bash script and compare the output of Wrong and Correct versions.

[WRONG VERSION]

#!/bin/bash

# Call this script with 12 parameters

echo "1st parameter is $1";
echo "2nd parameter is $2";
echo "3rd paramter is $3";
echo "4th parameter is $4";
echo "5th paramter is $5";
echo "6th parameter is $6";
echo "7th parameter is $7";
echo "8th paramter is $8";
echo "9th parameter is $9";
echo "10th parameter is $10";
echo "11th parameter is $11";

echo "12th paramter is $12";

Now lets say you execute the script with 12 arguments. Watch the output :

./Parameters_Pass.sh 5 10 15 20 25 30 32 35 42 45 50 65

1st parameter is 5
2nd parameter is 10
3rd paramter is 15
4th parameter is 20
5th paramter is 25
6th parameter is 30
7th parameter is 32
8th paramter is 35
9th parameter is 42
10th parameter is 50
11th parameter is 51
12th paramter is 52

See how the 10th 11th and 12t argument that we passed got screwed up. Instead of 45, 50, 65 what we see is 50, 51 and 52. Thats's so wrong, right?

Now here's the correct version of the script.

[CORRECT VERSION]

#!/bin/bash

# Call this script with 12 parameters

echo "1st parameter is $1";
echo "2nd parameter is $2";
echo "3rd paramter is $3";
echo "4th parameter is $4";
echo "5th paramter is $5";
echo "6th parameter is $6";
echo "7th parameter is $7";
echo "8th paramter is $8";
echo "9th parameter is $9";
echo "10th parameter is ${10}";
echo "11th parameter is ${11}";

echo "12th paramter is ${12}";

Observe the brace brackets used for 10th, 11th and 12th argument. Now if you execute the script with 12 arguments again, we'll get the correct output as expected.

./Parameters_Pass.sh 5 10 15 20 25 30 32 35 42 45 50 65

1st parameter is 5
2nd parameter is 10
3rd paramter is 15
4th parameter is 20
5th paramter is 25
6th parameter is 30
7th parameter is 32
8th paramter is 35
9th parameter is 42
10th parameter is 45
11th parameter is 50
12th paramter is 65

Saturday 19 March 2016

List only hidden files in Unix / Mac OS X

Folks you may be aware that ls -a will list all hidden files and visible files as well.

But to list only the hidden files, type the following in Terminal :

ls -ld .?*

This is one of the tricky interview questions, so make a note of this.

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

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