Tuesday, 24 March 2015

Enable whatsapp calls on Android (for root only)


Thanks to a friend, I got to enable whatsapp calling on my phone today :D
Thought I'd take a shot at making it available to all phones without someone having to call you!

THIS IS FOR ROOT ONLY!!


STEPS:

  • Step 1: Download https://raw.githubusercontent.com/amoghbl1/bash-scripts/master/whatsapp_call_enable.sh, I'd like to use wget for this, but, to each his own!
  • Step 2: Open terminal on your rooted phone, every rooted phone has this.
  • Step 3: Run the su command, which is basically typing
    su
    on the terminal app and hitting enter.
  • Step 4: Change the permission of the script, using the command
    chmod 655 whatsapp_call_enable.sh
  • Step 5: Run the script with the command
    sh whatsapp_call_enable.sh
  • Step 6: You're set :D If the output is something like "IF YOU CAN READ THIS, YOU PROBABLY HAVE CALLING PERMISSIONS NOW ON WHATSAPP!! :D". You can now launch whatsapp and call someone :P

 Have fun calling people with whatsapp now :P

Saturday, 17 January 2015

Install Android Studio Behind A Proxy

So I've finally got Android Studio installed on my computer, took a bit of an effort cause the setup wizard doesn't quiet let you edit the android studio settings to add your proxy configurations.

Problem:
"Connection failed. Please check your network connection and try again." While trying to install some sdk components that are required for it to work.

Something like "The following SDK components were not installed: extra-android-m2repository, tools, addon-google_apis-google-21, android-21, sys-img-x86-addon-google_apis-google-21, source-21, extra-google-m2repository" can be seen in the expanded log.

The problem is that Android Studio's Proxy settings are not configured and these are the steps you could follow to manually configure them (as it's not possible to configure them through GUI).

  • Step 1: Locate the  .AndroidStudio folder.
  • Step 2: Navigate to .AndroidStudio/config/options
  • Step 3: Edit the other.xml file.
    • Edit 1:  Replace  <option name="USE_HTTP_PROXY" value="false" /> with <option name="USE_HTTP_PROXY" value="true" /> .
    • Edit 2: Enter your proxy host configuration in <option name="PROXY_HOST" value="" /> , it should look something like <option name="PROXY_HOST" value="proxy.iiit.ac.in" /> .
    • Edit 3: Enter your proxy port into <option name="PROXY_PORT" value="" /> , mine looks like <option name="PROXY_PORT" value="8080" /> .
     
That's about it, you might need to enter extra details like login and password if your proxy requires them. Now try running the setup again and this time, it must be able to download all the required components and update the SDK :)

Please let me know if you have other problems, I'd be happy to help!

Wednesday, 1 October 2014

Importing a JSP WebApp into eclipse

Hmm, seems to be a simple thing right, but actually it isn't that easy for beginners :/

First things first, you need to make sure that you have all the right plugins installed, I'd recommend that you rather just use the Eclipse Web Tools platform instead.

After this, you'd think that just using import should do it but it's a little trickier than that!

1. Right Click on the | Projects Explorer View > Dynamic Web Project|
2. Untick the Use default location option that is ticked by default.
3. Click on Browse > Navigate to the path of the existing project.
4. Enter the name of the project that you want to import it as.
5. Select your desired runtime from existing ones or create a new one.
6. Select the required Dynamic web module version.
7. Select the default configuration for the runtime that you've selected.
8. Click finish and you're done!

Seems to be simple but took a little longer than I should have to figure it out.
NOTE- On clicking finish you may get a java.lang.NullPointer error, if you do, just restart the instance of eclipse and it should work for me, happened in my case so just a heads up!

Hope this helps you guys out.

Tuesday, 30 September 2014

Configure 802.1X Auth Mechanism using CLI in Linux

 
Connecting to a LAN network that uses 802.1x and EAPOL using the command line interface.

First, you would need to setup a wpa_supplicant.conf config file as shown below.

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=users
ap_scan=0
fast_reauth=1
network={
    key_mgmt=IEEE8021X
    eap=PEAP
    phase2="auth=MSCHAPV2"
    identity="IDENTITY"
    password="PASSWORD"
}

And that's pretty much it! All you need to do now is run this command:
 
wpa_supplicant -D wired -i eth0 -dd -c /path/to/config/file  #Replace eth0 with your ethernet interface

This could take a few seconds to run but should end with an authentication successful message, if not, try to find the place where it fails and try to debug it.

Once this is ready, you need to request for an ip address, run the following command.
 
dhclient eth0
And you're done!

Install Plugins from .zip Eclipse

Sometime, Eclipse doesn't exactly update quickly from update sites for installing plugins. This could be a problem especially when you're stuck behind a proxy! So, here's a way to manually install a plugin from a zip.
Note that most plugin writers don't always include the zip, in that case, you may have to try alternate methods to obtain it.

So these are the steps involved in manually installing the plugin-

1. First unzip the file. If the unzipped folder contains content.jar and artifacts.jar, you must be able to import it directly into eclipse from | Help > Install New Software > Add > Archive | .
2. If the above method fails, which happened in my case, unzip the file into a directory and move the directory into /path/to/eclipse/dropins directory. Name of the unzipped folder does not matter.
3. After moving the folder there, restart your eclipse and the plugin must be working now!

You can verify that the plugin is installed by doing | Help > About Eclipse > Installation Details > Installed Software |.

Hope this helps!

Sunday, 29 June 2014

Eventbrite Login and Queries using JS and OAuth

Hey guys, this is my first ever blog post and it's a short tutorial on how to connect your website to Eventbrite and it makes use of the OAuth2 protocol.

I assume that you have a basic idea about web development and I hope that this does not sound too technical to the new developers (if any)!

First, include jquery and the eventbrite js code, eventbrite code can be found at https://raw.github.com/ryanjarvinen/Eventbrite.jquery.js/master/Eventbrite.jquery.js .

Next, using the correct app_key, the key listed in your http://www.eventbrite.com/myaccount/apps/ use this code to login.
<script type="text/javascript">
  $('document').ready(function(){
    // Your API_Key's redirect_uri must be configured correctly at: http://eventbrite.com/api/key
    // Set your API_Key on the line below:
    Eventbrite.prototype.widget.login({'app_key': 'YOUR_API_KEY'}, function(widget_html){
      // Place the resulting Eventbrite login widget code somewhere on your page.
      // This example places the content into an element marked with class="eb_login_box"
      $('.eb_login_box').html(widget_html);
    });
  });
</script>

This code fills the element with class eb_login_box with an eventbrite button to connect to eventbrite.

Make sure that you have the right redirect uri else, it won't work and the callback will not happen properly.

You can look at a working example at http://amoghbl1.kd.io/eventbrite.html

Now, once you've got the access_token after authentication, you can initialize the client using
Eventbrite({'access_token': "USER_ACCESS_TOKEN"}, function(eb_client)
{ //eb_client interaction goes here...
});

After that, you can get the users events by using -
eb_client.user_list_events ( {}, function( response ){
    $( '#target' ).html( eb_client.utils.eventList( response, eb_client.utils.eventListRow ));
});

USEFUL LINKS:
https://github.com/ryanjarvinen/Eventbrite.jquery.js/blob/master/OAUTH2-README.md
https://github.com/ryanjarvinen/Eventbrite.jquery.js (Look at the readme to find all the required api calls and stuff like that!)

Hope this helps!