[OSFY] : Improve Python Code by Using a profiler


Hola amigos,

I am glad to inform you all that I have successfully published my Second article for ‘Open Source For You (OSFY)’ magazine, September 2014 Edition, titled ‘Improve Python Code by Using a Profiler‘.

To download and view the article please click on the above link.

In this article I have shared about using line_profiler for python (referenced from my earlier blog post).

Hope you enjoy reading this article. Your love for my blog and articles encourage me to write more articles in future and keep on sharing the knowledge with everyone :)

Let the Windows be open, and feel the Freedom.

[Mac OS X] Unable to move/empty files from Trash.App


Hola amigos,

I had installed an application on my Mac OS X and then found it to be not of any use for me. I moved the application from the ‘Application’ folder to the Trash and then emptied it. It was normal for the Finder to ask for administrator password as I was trying to remove an application file.

Later on, I was deleting some files to free up disk space when I realized that the Finder was again asking for admin password and I could see the Trash empty (I thought it is directly deleting the files without moving it into the Trash; for the time being). I tried on multiple files in different folders and found the same ‘Finder wants to make changes. Enter your password to allow this.’

Enter admin password popup

Enter admin password popup

This popup comes every time you try to move files to Trash or while emptying the Trash.

This problem usually arises because while emptying the Trash, the owner or user privileges gets modified and only the root/administrator can access it.

To fix this problem, simply open up your Terminal and type the following command:

sudo chown your_user_name ~/.Trash

The above command will change owner (chown) of the Trash (location: ~/.Trash; ~ – Home path, .Trash – ‘.’ meaning hidden file) to your ‘user name’ and give read/write permissions to it. We use sudo to give administrator privilege to make the changes and you have to enter your admin password once.

You can also use this command to give access privileges for particular files/folders to other users.

Note: Some users might have also noticed that the Trash is not getting cleared ever after you click ‘Empty the Trash’ and it shows successful. (The above method in not tested yet though for this particular problem, but you can always try it out and share it with everyone here).

Hope this helps you :) Leave your queries in the comment and will get back to you.

Let the Windows be open, and feel the Freedom.

[Android] Unable to send images after recent WhatApp Update


Hola amigos and WhatsApp users ;) ,

Android users constantly keep getting updates for almost all the applications in a matter of few weeks, months or even days. WhatsApp being one among them, and which expires after a few versions if you don’t update to the latest. This is not the issue with iPhone users though.

It keeps saying your whatsapp version is too old, it will expire in 14 days (and the countdown begins) :P

Few weeks back I got this message, and I had to update to the latest version of whatsapp (this time I didn’t wait for it to expire before my net pack expires).

Though it has got a new camera shortcut (not working though; shows camera failed every time) placed along with the voice recorder in the chat box, it has introduced new bug for many users.

It was a great nuisance for me as I couldn’t share images in whatsapp. I tried clearing the cache, restarting the phone, sending the image through file manager/gallery share option; few of the common troubleshooting methods which to work fine for me in the past, but this time it was something else. I tried uninstalling all the apps and still it used to show failed to send image message.

Whatsapp failed to upload Image.

Whatsapp failed to upload Image.

After a long time and lot of trial and error I found out a way out of this or you can say an alternative method to share image on whatsapp.

Solution: Select Camera option from ‘Attachment option’ from the top right corner and in the Camera setting select a lower/least resolution and send the image.

Camera Resolution Option

Camera Resolution Option

Note: This worked well for me (Tested only on HTC Explorer). If you are still unable to send images, leave your problem in the reply and will find a fix for it soon :)

Let the Windows be open, and feel the Freedom.

[WordPress] How to remove HTML content from Comments view


Hola amigos!

It’s been quite some time that I posted something technical. So here is a post for you all. This one is related to WordPress (hosted on your own server or just trying out locally).

I was an intern at Hangrr – Business, Leadership and Marketing Program, where we had to set up our own website. We chose WordPress as our back-end. You can visit our website here.

While we were deciding on the themes and the slider plugin on the homepage, we had to make sure that we have contact us forms and the users should be able to leave comments on the articles too. When we were working on comments form we came across some extra text being displayed on the page which was unnecessary and was related to HTML tags something like this –

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

HTML content below Comments form

HTML content below Comments form

To remove this just add the following code under Custom CSS and voila! your website and comment form is clean and simple.

Go to Dashboard->Appearance->Theme Options->Other->Custom CSS

#respond form p.form-allowed-tags {
display: none;
}

Then click on save options.

Alternate method: You can also add the following css code in your stylesheet (style.css) file.

Go to Dashboard->Appearance->Editor->style.css (on right side bottom corner)

.form-allowed-tags {
display: none;
}

Click on update file after adding the code.

[Screenshot] After adding the code:

Comment Form after removing HTML tags

Comment Form after removing HTML tags

Q. Where to add the code in style.css?
Ans. It’s quite simple, almost all the themes have comments in their source files for better understanding. You might find something like this in your style.css

/* =Content
----------------------------------------------- */

You can add the code first thing below this comment or you can place it at the end of the file to find it easily in future.

Let the Windows be open, and feel the Freedom.

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&#8217;
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.