TechUp Amrita ’14: Week 1


This post was intended to be posted sometime back but due to technical issues I am posting my updates now and henceforth will try to keep posting every week with my updates :P

TechUp Amrita is an application development competition organized by our Alumni (from Amritapuri campus) where we can choose our own domain (Android, Unity, web platforms, etc) and we have to plan weekly tasks and they will be evaluating us on the tasks completed as well as we need to submit weekly reports, and update our blogs regularly (hmm, something reminds me of GSoC kinda thing).

Week 1 comprises of discussing the project with project mentors which the TechUp team allotted us as per our technology used for development.

Week 1 began from 2nd of June, 2014

Our team name is OOPS_United under the mentor-ship of P.P Rahul, our AndroGeek. He was traveling and my team was unstable and had to fix ‘em up :P

My idea for this competition was to create an application where people from different regions, speaking different languages can find it easy to manage local languages using our application (atleast basic pronunciation) while they are traveling to different places and also polish their own mother tongue (which nowadays youngsters are not fluent in and/or are not taught in schools, the so called “Generation Gap”).

This Android app will fill in this void and as almost everyone from rags to rich people are having atleast one android device within their family will help reach out a large community due to android’s popularity.

We also plan to add scriptures and ancient texts in the app with audio feedback where available and this will be done in different parts.

We will begin by creating the app layout and prepare it’s designs and then move on to requirements of the applications and provide maximum support for all devices. Wherever needed we will also make use of alternate technologies that provide the same feature and support for older versions of android.

How to Create a SSH Key for Git


Hola amigos,

I will be going to show you how to create a SSH key for git so that you don’t need to type your password again and again while pushing your local code.

To check existing SSH keys in your machine run the following commands in the terminal:

cd ~/.ssh/
ls -a

This will list all your keys in the ‘~/.ssh’ folder.

To create a new ssh key you need to run:

ssh-keygen -t rsa -C "your_email@example.com"
Generating public/private rsa key pair.
Enter file in which to save the key (/home/JacksonIsaac/.ssh/id_rsa):

Here, your email-id will be used as a label for the SSH key.

You can simply press Enter and the SSH key will be saved as ‘~/.ssh/id_rsa’. You can also select a custom filename as per your wish.

Now you need to enter your passphrase (keep empty for no passphrase)

Enter passphrase (empty for no passphrase):
Enter same passphrase again:

The SSH key will be generated and you will get your key fingerprint.

Your identification has been saved in /home/jacksonisaac/.ssh/id_rsa.
# Your public key has been saved in /home/jacksonisaac/.ssh/id_rsa.pub.
Your key fingerprint is:
01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db jacksonisaac2008@gmail.com

Add your ssh key to ssh-agent

ssh-add ~/.ssh/id_rsa

Copy your public key and paste it in the SSH Key box at ‘https://github.com/settings/ssh’
You can view your public key by using cat (which displays the contect on the terminal itself) or use gedit to open the file and you can copy-paste the key.

cat ~/.ssh/id_rsa.pub
Add SSH Key on Github

Add SSH Key on Github

Note: Remember to copy the public key (file ending with .pub) and not the private key.

You can also copy the public key using terminal clipboard tools like xclip and many more.

Let the Windows be open, and feel the Freedom.

Download Youtube videos on Mac OS X through Terminal.App


Hola amigos,

In this post I am going to show you how you can download youtube videos easily through Terminal.App

First of all you need to set up HomeBrew, follow the steps mentioned here: Setting up HomeBrew on Mac OS X

Then install youtube-dl package by running the following command in your Terminal.App


brew install youtube-dl

Now you can download youtube videos by running the following command in your Terminal.App :


youtube-dl 'link to youtube video'

P.S: I used to download videos using youtube downloaders and in-browser extensions like video download helper, but recently I was unable to download some videos (Official vevo music videos in particular)

So I decided to give youtube-dl a try, and Voila it worked perfectly well and downloaded the videos in HD by default.

youtube-dl uses python script to download the videos and videos downloads with maximum bandwidth. :)

Further details can be found at youtube-dl on Github

Let the Windows be open, and feel the Freedom.

Exit Recovery Mode on iPhone


Hola Amigos,

If you are an iPhone user and trying to update or restore your firmware using .ipsw package. You might want to have a look at this post for sure.

I have tried this on non-Jailbroken device, but it would work with Jailbroken devices as well.

Problem:
Sometimes the package won’t build onto your device saying:

“This device isn’t eligible for the requested build”

You are probably stuck into Recover Mode loop and only possible action for you would be restoring you iPhone firmware using iTunes. But this would erase all your data, and you haven’t backed up your phone recently. What would you do now? Well the solution to this is very simple and I am going to tell you how you can restore your iPhone to working state and exit from the recovery mode safely.

Cause: You are trying to restore using an older firmware package. Apple has stopped signing the earlier versions of iOS, and you are forced to update to the latest firmware.

Solution:
The easiest and best way to get out from Recovery mode would be using a software, TinyUmbrella (the firmware umbrella).

You can download TinyUmbrella for Mac OS X from here: http://cache.firmwareumbrella.com/downloads/TinyUmbrella-7.11.00.app.zip

You can find other downloads for Windows here: http://blog.firmwareumbrella.com/

Extract the zip file and open the ‘TinyUmbrella.App’.

Now you will see a screen like this

TinyUmbrella Exit Recovery

Now click on Exit Recovery button and your device will restart and your previous firmware will be loaded and you can continue using your iPhone as it was :)

TinyUmbrella select Exit Recovery

Note: You can also Enter Recovery mode manually using this software. Also you can save SHSH for future restoration of your previous firmwares (for downgrading).

 

Let the Windows be open, and feel the Freedom.

Setting up HomeBrew on Mac OS X


Hola Amigos :)

If you are using Mac and are Open Source enthusiast or a developer or want to install any open source packages that are available for Linux-based OS’s through your Terminal.App rather than compiling and installing from source. Well don’t worry HomeBrew comes to your rescue.

In this post, I am going to tell you how to set up Homebrew easily. You might want to have a good internet connection if you are not that patient in waiting, as this is going to download quite a large amount of files on your machine.

What is Homebrew?

It is an alternative version for Mac OS X of apt-get or aptitude that you use in Linux-based systems. It is a command line tool that will install the missing packages from the source that are not available through Mac App Store. It enables you to install latest development tools like wget, git, mysql, python3, and many more easily through your Terminal.App just like you used to do with Linux terminal.

They are simple formulas written using Ruby script so that the packages are easily installed into Mac OS X. It also installing them under a different directory so there is no need to worry about the default packages being replaced or conflict between the default and homebrew versions.

Eg: wget formulae sample

require "formula"

class Wget < Formula
  homepage "http://www.gnu.org/software/wget/"
  url "http://ftp.gnu.org/gnu/wget/wget-1.15.tar.gz"
  sha1 "f3c925f19dfe5ed386daae4f339175c108c50574"

  def install
    system "./configure", "--prefix=#{prefix}"
    system "make", "install"
  end
end

Here the source of wget is fetched from the source and it will automatically run .configure, make, make install for you and saving you the work of executing these commands.

Let me put this in simple terms, homebrew will take the package name as an argument from the user and will fetch the source of the appropriate package from git (or ftp, wherever the package is hosted) run .configure with appropriate arguments, make, make install; and make installing packages simpler for the user. It is basically ruby scripts executing the command line (terminal) commands for you :)

Installing Homebrew:


ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

This command will download the homebrew ruby gem(package written in ruby) using curl, a command line tool (included by default in Mac) for transferring data just like wget. After the download is complete it will execute the package using “ruby -e” (-e being the execution argument for ruby).

It will pause in between installation and tell you about what it is going to do. While using ‘brew install’ too you can see each and every step that the command executes and you can know what is going on behind the curtains (one of my favorite features).

After Installation run:


brew update

This will make sure that you have the updated brew repository and the latest packages are available.

brew update terminal log

brew update terminal log

P.S: There is MacPorts too that you can use, but I would recommend you to use homebrew as lots of technologies are having steps to install latest packages using homebrew.

Reference:

brew.sh

Let the Windows be open, and feel the Freedom.

Installing Scheme on Mac OS X


Hola readers,

Many questions might have come across your mind on seeing the title. It says installing ‘Scheme’. Well I am not talking about any offers or daily schemes :P. Scheme is a functional programming language, a variation to LISP programming language.

And other thing that might come across would be why am I talking about Mac OS when my earlier posts were all related to Open Source or Linux in some or the other way. IMHO, Mac is best of both worlds, an awesome GUI by Apple designers and Linux like command line interface backed by Unix. Most of the developers prefer Mac and hence there are lots of awesome IDE available for it. I do most of my programming on X-Code. Using command line tools I can write programs through terminal too using vi and Emacs (I prefer vi/vim). I run Linux on VBox for my Open Source contributions and enjoy best of both worlds :D.

This is my second post of the day. You would be thinking that I am on some kind of blogging spree, well am also thinking the same :P. Reason to post about this is that I was talking to my friend about MPLAB IDE for Mac and then he mentioned that he couldn’t even get his MIT-Scheme running. Maybe there would be others too facing the same problem, so why not share my knowledge with the world :)

In this post, I am going to help you with setting up MIT-Scheme (implementation of Scheme programming language developed by MIT) for Mac OS X.

First of all, you will need to download the .dmg file of MIT Scheme.

Download link for OS X:

32-bit system

64-bit system

Click on the downloaded dmg file and a finder window will open up like this:

MIT-Scheme disk image

MIT-Scheme disk image

Just drag the MIT/GNU Scheme.app into the Applications folder and it will be installed in your system.

Now to use Scheme through command line, open up Terminal.app from either Launchpad, Spotlight or under Applications folder and run the following command.

For 32-bit package:

sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-i386

For 64-bit package:

sudo ln -s /Applications/MIT\:GNU\ Scheme.app/Contents/Resources /usr/local/lib/mit-scheme-x86-64

Enter you administrator password and then run this command to link mit-scheme.app to ‘scheme’ command in terminal:

For 32-bit package:

sudo ln -s /usr/local/lib/mit-scheme-i386/mit-scheme /usr/bin/scheme

For 64-bit package:

sudo ln -s /usr/local/lib/mit-scheme-x86-64/mit-scheme /usr/bin/scheme

To use Scheme open up Terminal.app and simply run:

scheme

Happy Coding \m/

Let the Windows be open, and feel the Freedom.