Tuesday, 26 November 2013

Cyberroam Tricks Part 1

Most of the colleges or Offices have Cyberroam to restrict user from accessing certain websites. This can also be used to limit the speed of your Internet. I am in college and My college installed Cyberroam when I was in 2nd year of my Engineering. Every sem they introduce something to put limitation on us and everytime we had to find something to bypass that limitation.

I will mention all the limitation that our college has put on us and how to overcome that limitation.

1. The very first one was when we had to enter username and password provided by the college after regular interval which was very annoying. I got automatically solved. I don't know. I guess college professor found the option in cyberroam which was causing this. But there was a time when If we remove the LAN wire (cross cable) from laptop without logging out then It will not work on your laptop for certain amount of time. Then you will have to insert into someone's other laptop and then again insert it into your laptop and then It will work. If something like this happens to you then the very basic solution to this problem is to renew your IP address assigned to you. You can do this by executing the following commands in command prompt.

ipconfig /release

and then this command

ipconfig /renew

Now you will be able to see the cyberroam login page where you can login and use the internet. This happened with us a lot in a semester as in hostel the mostly the lan wire was damaged so even If we move the laptop a little the lan wire got removed from the laptop accidently and the internet would stop workign and I had to run these commands to make it run again.

2. The second problem I faced due to cyberroam was that I was unable to download anything from torrent. uTorrent didn't work. Then we found a solution to this problem also. Now the solution is very simple. Goto Options menu (ALT + O) in utorrent and then Preferences, then select Bittorrent in the list given on the left side. Now you will see a option named in Protocol Encyption in the right side. There will be 3 values. Select Forced. and click on OK. Now your utorrent will work even in cyberroam. Now the main problem was to get the torrent file. All the torrent websites were blocked so we were unable to download any utorrent file. One simple solution to me right now is to go to katmirror.com which is a copy of kat.ph which is not blocked here at my college. So I can download torrents from this website.


The solutions to cyberroam will continued in the next blog. I will provide more solution to the problem mentioned above by telling your how to use proxifier. So Stay tuned. Enjoy.!!!

Thursday, 1 August 2013

Sync your fork and Original Resipository

I just started working for a organisation whose code is on Github. I cloned their repository and after making changes I tried to push changes to their repository But I couldn't. The reason was obvious. I cloned their repository. I don't have the permission to make changes in their repository.

Thats why you fork a repository. You can make any kind of changes in it. So I did that. But after I cloned it, I realised that the repository was too old. I hadn't merge the changes made in the original repository into my repository. I used to think that my fork automatically gets updated to the latest changes made in the original repository. Stupid thought? I know :P

Now you have to manually sync both of the repositories i.e. Your fork and the original one. I am writing this from this blog.

http://bradlyfeeley.com/2008/09/03/update-a-github-fork-from-the-original-repo/

I assume you have a local copy of your repository. Now issue the following commands

Now you need to add a remote branch to your repository which points to the original repository.

Issue the following command to do that

$ git remote add --track master mleung git://github.com/mleung/feather.git

Now here are 3 parameters i.e. master, mleung and git://github.com/mleung/feather.git

First one is the branch from which you want to merge. Most of the times it is master. In my case it was develop so I replaced it with develop. The next parameter is just a label. You can write whatever you want the name to be like repository_remote. And now the third parameter which is the link to the original repository. This command will add a remote branch to your repository. As you have noticed this command fetches nothing from the Internet. Now the next command is to do the same. Now before doing that you can also check if a remote branch was added from your above command using the following command

$ git remote

Now we can fetch the remote branch using

$ git fetch mleung

Now that you have fetched the changes and you have it in your repository. You can merge it which is the easiest thing to do. Now here specify the name of the remote branch that you have used above

$ get merge mleung/master

Now you successfully synced your local repository with the latest changes. Now you can push that changes in your remote repository with pride :P

$ git push

Happie Gitting :P

Sunday, 30 June 2013

Keyup event not responding to preventDefault()

I was working on jQuery's autocomplete/ Bootstrap typeahead kind of thing for phpBB.
It is basically used to provide user with suggestion/options when user enters something in the input or textarea
Now the default behaviour that you will see of the following keys is as follows:

For Arrow Up
If some option was already selected, then select the option just above it.
If no option was selected previously then select the very last option.

For Arrow Down
If some option was already selected, then select the option just below the current option
If no option was selected then select the first option

For Enter button
Now when enter button is pressed, check if any option was selected by the user. If yes then, insert that options value in the input

Now here we have to supress default actions of these above buttons. As if users presses Upper button the cursor moves to the first position i.e. before the text so to suppress this action you will have to use
Event.preventDefault function. Now If you use this function inside keyup then this might not work as the event that you are trying to start has already happened. So instead of using keyup you will have to do use keydown as the event of the keydown happens before event of keyup. So the preventDefault was not working. Now you can suppress these actions using the preventDeafult

Happie Coding!! :)