tag:blogger.com,1999:blog-17967506392312724532024-03-04T20:25:22.453-08:00VIKI THE AIThis blog is about me, my life and my work. Hope you find it interesting :)Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.comBlogger30125tag:blogger.com,1999:blog-1796750639231272453.post-87888734331733801932016-12-15T23:10:00.001-08:002016-12-16T01:14:59.366-08:00setting up virtualenv and virtualenvwrapper on mac over zsh and iterm.<div dir="ltr" style="text-align: left;" trbidi="on">
I have setup zsh on iterm in mac. While trying to set up virtualenvwrapper for using virtualenv in python projects I ran into the following error:<br />
<br />
<blockquote class="tr_bq">
➜ pip install virtualenvwrapper<br />
Collecting virtualenvwrapper<br />
Using cached virtualenvwrapper-4.7.2.tar.gz<br />
Complete output from command python setup.py egg_info:<br />
Traceback (most recent call last):<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 156, in save_modules<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 197, in setup_context<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 246, in run_setup<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 276, in run<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 245, in runner<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 47, in _execfile<br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/setup.py", line 22, in <module><br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/pbr/util.py", line 264, in cfg_to_args<br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/pbr/util.py", line 566, in wrap_commands<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 2264, in resolve<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg/sphinx/setup_command.py", line 23, in <module><br />
from sphinx.application import Sphinx<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg/sphinx/application.py", line 26, in <module><br />
from docutils.parsers.rst import convert_directive_function, \<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/parsers/rst/__init__.py", line 74, in <module><br />
import docutils.statemachine<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/statemachine.py", line 113, in <module><br />
from docutils import utils<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/utils/__init__.py", line 20, in <module><br />
import docutils.io<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/io.py", line 18, in <module><br />
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/utils/error_reporting.py", line 47, in <module><br />
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]<br />
File "/Users/viki/anaconda3/lib/python3.5/locale.py", line 577, in getlocale<br />
return _parse_localename(localename)<br />
File "/Users/viki/anaconda3/lib/python3.5/locale.py", line 486, in _parse_localename<br />
<br />
<br />
raise ValueError('unknown locale: %s' % localename)<br />
ValueError: unknown locale: UTF-8<br />
During handling of the above exception, another exception occurred:<br />
Traceback (most recent call last):<br />
File "<string>", line 1, in <module><br />
File "/private/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/pip-build-01z4855a/virtualenvwrapper/setup.py", line 7, in <module><br />
pbr=True,<br />
File "/Users/viki/anaconda3/lib/python3.5/distutils/core.py", line 108, in setup<br />
_setup_distribution = dist = klass(attrs)<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/dist.py", line 315, in __init__<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/dist.py", line 361, in fetch_build_eggs<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 851, in resolve<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 1123, in best_match<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 1135, in obtain<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/dist.py", line 428, in fetch_build_egg<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/command/easy_install.py", line 664, in easy_install<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/command/easy_install.py", line 694, in install_item<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/command/easy_install.py", line 875, in install_eggs<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/command/easy_install.py", line 1114, in build_and_install<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/command/easy_install.py", line 1100, in run_setup<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 249, in run_setup<br />
File "/Users/viki/anaconda3/lib/python3.5/contextlib.py", line 77, in __exit__<br />
self.gen.throw(type, value, traceback)<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 197, in setup_context<br />
File "/Users/viki/anaconda3/lib/python3.5/contextlib.py", line 77, in __exit__<br />
self.gen.throw(type, value, traceback)<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 168, in save_modules<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 143, in resume<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/_vendor/six.py", line 685, in reraise<br />
raise value.with_traceback(tb)<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 156, in save_modules<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 197, in setup_context<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 246, in run_setup<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 276, in run<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 245, in runner<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/setuptools/sandbox.py", line 47, in _execfile<br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/setup.py", line 22, in <module><br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/pbr/util.py", line 264, in cfg_to_args<br />
File "/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/easy_install-ff5qsxzn/pbr-1.10.0/pbr/util.py", line 566, in wrap_commands<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/setuptools-27.2.0-py3.5.egg/pkg_resources/__init__.py", line 2264, in resolve<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg/sphinx/setup_command.py", line 23, in <module><br />
from sphinx.application import Sphinx<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/Sphinx-1.4.6-py3.5.egg/sphinx/application.py", line 26, in <module><br />
from docutils.parsers.rst import convert_directive_function, \<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/parsers/rst/__init__.py", line 74, in <module><br />
import docutils.statemachine<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/statemachine.py", line 113, in <module><br />
from docutils import utils<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/utils/__init__.py", line 20, in <module><br />
import docutils.io<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/io.py", line 18, in <module><br />
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput<br />
File "/Users/viki/anaconda3/lib/python3.5/site-packages/docutils/utils/error_reporting.py", line 47, in <module><br />
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]<br />
File "/Users/viki/anaconda3/lib/python3.5/locale.py", line 577, in getlocale<br />
return _parse_localename(localename)<br />
File "/Users/viki/anaconda3/lib/python3.5/locale.py", line 486, in _parse_localename<br />
raise ValueError('unknown locale: %s' % localename)<br />
ValueError: unknown locale: UTF-8<br />
----------------------------------------<br />
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/xp/xcwv5f6s05g2381pc4_vvbs80000gn/T/pip-build-01z4855a/virtualenvwrapper/</blockquote>
<br />
<br />
--<br />
Was trying to figure out why this was happening and finally found that the issue is something to do with LANG settings with zsh.<br />
<br />
The solution was pretty simple though:<br />
<br />
I just added the following lines in ~/.zshrc<br />
<br />
<blockquote class="tr_bq">
export WORKON_HOME=~/.virtualenvs<br />
export LC_ALL=en_US.UTF-8<br />
export LANG=en_US.UTF-8</blockquote>
<br />
and ran<br />
<br />
<blockquote class="tr_bq">
source ~/.zshrc</blockquote>
<br />
After which I re-ran<br />
<br />
<blockquote class="tr_bq">
pip install virtualenvwrapper</blockquote>
<br />
and it worked.<br />
<br />
But later while creating virtualenv I faced a different issue:<br />
<br />
<blockquote class="tr_bq">
export WORKON_HOME=~/.virtualenvs<br />
mkdir -p $WORKON_HOME<br />
source /usr/local/bin/virtualenvwrapper.sh</blockquote>
For anaconda + virtualenv<br />
<br />
Add following line to ~/.zshrc<br />
<blockquote class="tr_bq">
source "/Users/viki/anaconda3/bin/virtualenvwrapper.sh"</blockquote>
<br />
<blockquote class="tr_bq">
➜ source ~/.zshrc<br />
➜ mkvirtualenv env1<br />
Using base prefix '/Users/viki/anaconda3'<br />
New python executable in /Users/viki/.virtualenvs/env1/bin/python<br />
dyld: Library not loaded: @rpath/libpython3.5m.dylib<br />
Referenced from: /Users/viki/.virtualenvs/env1/bin/python<br />
Reason: image not found<br />
ERROR: The executable /Users/viki/.virtualenvs/env1/bin/python is not functioning<br />
ERROR: It thinks sys.prefix is '/Users/viki/.virtualenvs' (should be '/Users/viki/.virtualenvs/env1')<br />
ERROR: virtualenv is not compatible with this system or executable</blockquote>
<br />
The above does not work. And I don't know the exact reason.<br />
But it has something to do with symlinking to the system level python env that is not the same as symlinking to anaconda env.<br />
<br />
To resolve the above issue you can specify the python version to be used in the virtualenv<br />
<br />
<blockquote class="tr_bq">
mkvirtualenv -p /usr/bin/python2.7 env1<br />
Running virtualenv with interpreter /usr/bin/python2.7<br />
New python executable in /Users/viki/.virtualenvs/env1/bin/python<br />
Installing setuptools, pip, wheel...done.<br />
virtualenvwrapper.user_scripts creating /Users/viki/.virtualenvs/env1/bin/predeactivate<br />
virtualenvwrapper.user_scripts creating /Users/viki/.virtualenvs/env1/bin/postdeactivate<br />
virtualenvwrapper.user_scripts creating /Users/viki/.virtualenvs/env1/bin/preactivate<br />
virtualenvwrapper.user_scripts creating /Users/viki/.virtualenvs/env1/bin/postactivate<br />
virtualenvwrapper.user_scripts creating /Users/viki/.virtualenvs/env1/bin/get_env_details<br />
Error: deactivate must be sourced. Run 'source deactivate'<br />
instead of 'deactivate'.</blockquote>
This finally worked.<br />
<br />
--<br />
Happy :)</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-14297954678751821402015-05-19T06:12:00.001-07:002015-05-19T06:12:48.777-07:00Pip install upgrade is failing with error message ImportError: cannot import name IncompleteRead<div dir="ltr" style="text-align: left;" trbidi="on">
Sometimes suddenly pip stops working for no reason:<br />
<br />
It happens when the version of pip we were using becomes outdated. And the error message we get is somewhat like this :<br />
<br />
<div>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="color: #333333; font-family: Courier New, Courier, monospace;"><span style="font-size: xx-small; line-height: 18px;">ubuntu@ip-127.0.0.1:~/utils$ sudo pip install --upgrade dist/utils-0.1.tar.gz
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 61, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead</span></span><span style="color: #333333; font-family: 'Courier New', Courier, monospace; font-size: 15.3999996185303px; line-height: 18px;">
</span></pre>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
To solve this we need to update pip :</div>
<div>
<br /></div>
<div>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="color: #333333; font-family: Courier New, Courier, monospace;"><span style="font-size: xx-small; line-height: 18px;">sudo easy_install -U pip</span></span></pre>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
This will resolve the problem.</div>
<div>
<br /></div>
<div>
Cheers,</div>
<div>
Vikash</div>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-67399848873533320902015-04-30T04:31:00.001-07:002015-12-09T04:48:27.713-08:00Mongo starting issue : LC_* environment variables are set correctly<div dir="ltr" style="text-align: left;" trbidi="on">
I have been facing this issue with mongo lately. After i installed zsh, whenever i login to a remote box and try to start mongo i get this error :<br />
<br />
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman";"><span style="white-space: normal;">Failed global initialization: BadValue Invalid or no user locale set. Please ensure LANG and/or LC_* environment variables are set correctly</span></span></pre>
<br />
So simple solution is mentioned here: http://askubuntu.com/questions/536875/error-in-installing-mongo-in-virtual-machine<br />
<br />
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><pre class="sourcecode" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman";"><span style="white-space: normal;">export LC_ALL=C</span></span></pre>
<pre class="sourcecode" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman"; white-space: normal;">mongo </span></pre>
</pre>
<br />
To solve this permanently i change the ssh config :<br />
<br />
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman"; white-space: normal;">sudo vim /etc/ssh/ssh_config </span></pre>
<br />
and change the value from:<br />
<br />
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman";"><span style="white-space: normal;">SendEnv LANG LC_*</span></span></pre>
<br />
to:<br />
<br />
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); padding: 5px;"><span style="font-family: "times new roman"; white-space: normal;">SendEnv LANG LC_ALL=C</span></pre>
<br />
That's it.<br />
Thanks<br />
<br />
<br />
<br />
<br />
<br /></div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com2tag:blogger.com,1999:blog-1796750639231272453.post-46199595331503605562015-04-28T02:40:00.002-07:002015-04-28T02:40:26.967-07:00Setting up RabbitMq with SSL and Celery integration for python client<div dir="ltr" style="text-align: left;" trbidi="on">
I have been using celery for a while now with RabbitMq broker. <br /><br />I was using authentication all this time but i still didn't feel confident that that will keep it secure as it was over http. So i tried setting it up over https. It took some time but finally i was able to complete it:<div>
<br /></div>
<div>
Setting up the ssl certificates first:</div>
<div>
<br /></div>
<div>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: xx-small;">mkdir testca
cd testca
mkdir certs private
chmod 700 private
echo 01 > serial
touch index.txt</span><span style="font-size: 13px;">
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;"># create a file openssl.cnf and add the content to it.
</span><span style="font-size: xx-small;">vim openssl.cnf</span><span style="font-size: 13px;">
</span><pre class="sourcecode" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border-image-outset: initial; border-image-repeat: initial; border-image-slice: initial; border-image-source: initial; border-image-width: initial; border: 1px solid rgb(221, 221, 221); font-family: 'Courier New', Courier, monospace; padding: 5px;"><span style="font-size: xx-small;">[ ca ]
default_ca = testca
[ testca ]
dir = .
certificate = $dir/cacert.pem
database = $dir/index.txt
new_certs_dir = $dir/certs
private_key = $dir/private/cakey.pem
serial = $dir/serial
default_crl_days = 7
default_days = 365
default_md = sha1
policy = testca_policy
x509_extensions = certificate_extensions
[ testca_policy ]
commonName = supplied
stateOrProvinceName = optional
countryName = optional
emailAddress = optional
organizationName = optional
organizationalUnitName = optional
[ certificate_extensions ]
basicConstraints = CA:false
[ req ]
default_bits = 2048
default_keyfile = ./private/cakey.pem
default_md = sha1
prompt = yes
distinguished_name = root_ca_distinguished_name
x509_extensions = root_ca_extensions
[ root_ca_distinguished_name ]
commonName = hostname
[ root_ca_extensions ]
basicConstraints = CA:true
keyUsage = keyCertSign, cRLSign
[ client_ca_extensions ]
basicConstraints = CA:false
keyUsage = digitalSignature
extendedKeyUsage = 1.3.6.1.5.5.7.3.2
[ server_ca_extensions ]
basicConstraints = CA:false
keyUsage = keyEncipherment
extendedKeyUsage = 1.3.6.1.5.5.7.3.1</span></pre>
</pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#run these 2 commands they will generate the key file testca/cacert.pem
</span><span style="font-size: xx-small;">openssl req -x509 -config openssl.cnf -newkey rsa:2048 -days 365 \
-out cacert.pem -outform PEM -subj /CN=MyTestCA/ -nodes
openssl x509 -in cacert.pem -out cacert.cer -outform DER</span><span style="font-size: 13px;">
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#Now generate key for server:
</span><span style="font-size: xx-small;">cd ..
ls
testca
mkdir server
cd server
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out req.pem -outform PEM \
-subj /CN=$(hostname)/O=server/ -nodes
cd ../testca
openssl ca -config openssl.cnf -in ../server/req.pem -out \
../server/cert.pem -notext -batch -extensions server_ca_extensions
cd ../server
openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPassword</span><span style="font-size: 13px;">
#chose and remember the MySecretPassword.</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#Now generate key for client:
</span><span style="font-size: xx-small;">cd ..
ls
server testca
mkdir client
cd client
openssl genrsa -out key.pem 2048
openssl req -new -key key.pem -out req.pem -outform PEM \
-subj /CN=$(hostname)/O=client/ -nodes
cd ../testca
openssl ca -config openssl.cnf -in ../client/req.pem -out \
../client/cert.pem -notext -batch -extensions client_ca_extensions
cd ../client
openssl pkcs12 -export -out keycert.p12 -in cert.pem -inkey key.pem -passout pass:MySecretPassword</span><span style="font-size: 13px;">
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#Relevant files generated:
.
├── client
│ ├── cert.pem
│ └── key.pem
├── server
│ ├── cert.pem
│ └── key.pem
└── testca
└── cacert.pem
Rename files to :
.
├── client
│ ├── client_cert.pem
│ └── client_key.pem
├── server
│ ├── server_cert.pem
│ └── server_key.pem
└── testca
└── cacert.pem
copy these files to your rabbitmq server.
Move the files to this directory:
</span><span style="font-size: x-small;">/etc/rabbitmq/ssl/certs/</span><span style="font-size: 13px;">
client_cert.pem client_key.pem server_cert.pem server_key.pem cacert.pem
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#Next configure the rabbitmq to use these files:
#create the config file:
vim /etc/rabbitmq/rabbitmq.config
</span><span style="font-size: xx-small;">%% -*- mode: erlang -*-
%% ----------------------------------------------------------------------------
%% RabbitMQ Sample Configuration File.
%%
%% See http://www.rabbitmq.com/configure.html for details.
%% ----------------------------------------------------------------------------
[
{ssl, [{versions, ['tlsv1.2', 'tlsv1.1']}]},
{rabbit,
[
{ssl_listeners, [5671]},
{ssl_options, [{cacertfile,"/etc/cert/cacert.pem"},
{certfile,"/etc/cert/cert.pem"},
{keyfile,"/etc/cert/key.pem"},
{password, "dataemocertpass1@"},
{verify, verify_peer},
{fail_if_no_peer_cert, true},
{versions, ['tlsv1.2', 'tlsv1.1']}]}
%%
%% Network Connectivity
%% ====================
%%
%% By default, RabbitMQ will listen on all interfaces, using
%% the standard (reserved) AMQP port.
%%
%% {tcp_listeners, [5672]},
%% To listen on a specific interface, provide a tuple of {IpAddress, Port}.
%% For example, to listen only on localhost for both IPv4 and IPv6:
%%
%% {tcp_listeners, [{"127.0.0.1", 5672},
%% {"::1", 5672}]},
%% SSL listeners are configured in the same fashion as TCP listeners,
%% including the option to control the choice of interface.
%%
%% {ssl_listeners, [5671]},
%% Maximum time for AMQP 0-8/0-9/0-9-1 handshake (after socket connection
%% and SSL handshake), in milliseconds.
%%
%% {handshake_timeout, 10000},
%% Log levels (currently just used for connection logging).
%% One of 'debug', 'info', 'warning', 'error' or 'none', in decreasing
%% order of verbosity. Defaults to 'info'.
%%
%% {log_levels, [{connection, info}, {channel, info}]},
%% Set to 'true' to perform reverse DNS lookups when accepting a
%% connection. Hostnames will then be shown instead of IP addresses
%% in rabbitmqctl and the management plugin.
%%
%% {reverse_dns_lookups, true},
%%
%% Security / AAA
%% ==============
%%
%% The default "guest" user is only permitted to access the server
%% via a loopback interface (e.g. localhost).
%% {loopback_users, [<<"guest">>]},
%%
%% Uncomment the following line if you want to allow access to the
%% guest user from anywhere on the network.
%% {loopback_users, []},
%% Configuring SSL.
%% See http://www.rabbitmq.com/ssl.html for full documentation.
%%
%% {ssl_options, [{cacertfile, "/path/to/testca/cacert.pem"},
%% {certfile, "/path/to/server/cert.pem"},
%% {keyfile, "/path/to/server/key.pem"},
%% {verify, verify_peer},
%% {fail_if_no_peer_cert, false}]},
%% Choose the available SASL mechanism(s) to expose.
%% The two default (built in) mechanisms are 'PLAIN' and
%% 'AMQPLAIN'. Additional mechanisms can be added via
%% plugins.
%%
%% See http://www.rabbitmq.com/authentication.html for more details.
%%
%% {auth_mechanisms, ['PLAIN', 'AMQPLAIN']},
%% Select an authentication database to use. RabbitMQ comes bundled
%% with a built-in auth-database, based on mnesia.
%%
%% {auth_backends, [rabbit_auth_backend_internal]},
%% Configurations supporting the rabbitmq_auth_mechanism_ssl and
%% rabbitmq_auth_backend_ldap plugins.
%%
%% NB: These options require that the relevant plugin is enabled.
%% See http://www.rabbitmq.com/plugins.html for further details.
%% The RabbitMQ-auth-mechanism-ssl plugin makes it possible to
%% authenticate a user based on the client's SSL certificate.
%%
%% To use auth-mechanism-ssl, add to or replace the auth_mechanisms
%% list with the entry 'EXTERNAL'.
%%
%% {auth_mechanisms, ['EXTERNAL']},
%% The rabbitmq_auth_backend_ldap plugin allows the broker to
%% perform authentication and authorisation by deferring to an
%% external LDAP server.
%%
%% For more information about configuring the LDAP backend, see
%% http://www.rabbitmq.com/ldap.html.
%%
%% Enable the LDAP auth backend by adding to or replacing the
%% auth_backends entry:
%%
%% {auth_backends, [rabbit_auth_backend_ldap]},
%% This pertains to both the rabbitmq_auth_mechanism_ssl plugin and
%% STOMP ssl_cert_login configurations. See the rabbitmq_stomp
%% configuration section later in this file and the README in
%% https://github.com/rabbitmq/rabbitmq-auth-mechanism-ssl for further
%% details.
%%
%% To use the SSL cert's CN instead of its DN as the username
%%
%% {ssl_cert_login_from, common_name},
%% SSL handshake timeout, in milliseconds.
%%
%% {ssl_handshake_timeout, 5000},
%%
%% Default User / VHost
%% ====================
%%
%% On first start RabbitMQ will create a vhost and a user. These
%% config items control what gets created. See
%% http://www.rabbitmq.com/access-control.html for further
%% information about vhosts and access control.
%%
%% {default_vhost, <<"/">>},
%% {default_user, <<"guest">>},
%% {default_pass, <<"guest">>},
%% {default_permissions, [<<".*">>, <<".*">>, <<".*">>]},
%% Tags for default user
%%
%% For more details about tags, see the documentation for the
%% Management Plugin at http://www.rabbitmq.com/management.html.
%%
%% {default_user_tags, [administrator]},
%%
%% Additional network and protocol related configuration
%% =====================================================
%%
%% Set the default AMQP heartbeat delay (in seconds).
%%
%% {heartbeat, 600},
%% Set the max permissible size of an AMQP frame (in bytes).
%%
%% {frame_max, 131072},
%% Set the max permissible number of channels per connection.
%% 0 means "no limit".
%%
%% {channel_max, 128},
%% Customising Socket Options.
%%
%% See (http://www.erlang.org/doc/man/inet.html#setopts-2) for
%% further documentation.
%%
%% {tcp_listen_options, [binary,
%% {packet, raw},
%% {reuseaddr, true},
%% {backlog, 128},
%% {nodelay, true},
%% {exit_on_close, false}]},
%%
%% Resource Limits & Flow Control
%% ==============================
%%
%% See http://www.rabbitmq.com/memory.html for full details.
%% Memory-based Flow Control threshold.
%%
%% {vm_memory_high_watermark, 0.4},
%% Fraction of the high watermark limit at which queues start to
%% page message out to disc in order to free up memory.
%%
%% Values greater than 0.9 can be dangerous and should be used carefully.
%%
%% {vm_memory_high_watermark_paging_ratio, 0.5},
%% Set disk free limit (in bytes). Once free disk space reaches this
%% lower bound, a disk alarm will be set - see the documentation
%% listed above for more details.
%%
%% {disk_free_limit, 50000000},
%% Alternatively, we can set a limit relative to total available RAM.
%%
%% Values lower than 1.0 can be dangerous and should be used carefully.
%% {disk_free_limit, {mem_relative, 2.0}},
%%
%% Misc/Advanced Options
%% =====================
%%
%% NB: Change these only if you understand what you are doing!
%%
%% To announce custom properties to clients on connection:
%%
%% {server_properties, []},
%% How to respond to cluster partitions.
%% See http://www.rabbitmq.com/partitions.html for further details.
%%
%% {cluster_partition_handling, ignore},
%% Make clustering happen *automatically* at startup - only applied
%% to nodes that have just been reset or started for the first time.
%% See http://www.rabbitmq.com/clustering.html#auto-config for
%% further details.
%%
%% {cluster_nodes, {['rabbit@my.host.com'], disc}},
%% Interval (in milliseconds) at which we send keepalive messages
%% to other cluster members. Note that this is not the same thing
%% as net_ticktime; missed keepalive messages will not cause nodes
%% to be considered down.
%%
%% {cluster_keepalive_interval, 10000},
%% Set (internal) statistics collection granularity.
%%
%% {collect_statistics, none},
%% Statistics collection interval (in milliseconds).
%%
%% {collect_statistics_interval, 5000},
%% Explicitly enable/disable hipe compilation.
%%
%% {hipe_compile, true},
%% Timeout used when waiting for Mnesia tables in a cluster to
%% become available.
%%
%% {mnesia_table_loading_timeout, 30000},
%% Size in bytes below which to embed messages in the queue index. See
%% http://www.rabbitmq.com/persistence-conf.html
%%
%% {queue_index_embed_msgs_below, 4096}
]},
%% ----------------------------------------------------------------------------
%% Advanced Erlang Networking/Clustering Options.
%%
%% See http://www.rabbitmq.com/clustering.html for details
%% ----------------------------------------------------------------------------
{kernel,
[%% Sets the net_kernel tick time.
%% Please see http://erlang.org/doc/man/kernel_app.html and
%% http://www.rabbitmq.com/nettick.html for further details.
%%
%% {net_ticktime, 60}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ Management Plugin
%%
%% See http://www.rabbitmq.com/management.html for details
%% ----------------------------------------------------------------------------
{rabbitmq_management,
[%% Pre-Load schema definitions from the following JSON file. See
%% http://www.rabbitmq.com/management.html#load-definitions
%%
%% {load_definitions, "/path/to/schema.json"},
%% Log all requests to the management HTTP API to a file.
%%
%% {http_log_dir, "/path/to/access.log"},
%% Change the port on which the HTTP listener listens,
%% specifying an interface for the web server to bind to.
%% Also set the listener to use SSL and provide SSL options.
%%
%% {listener, [{port, 12345},
%% {ip, "127.0.0.1"},
%% {ssl, true},
%% {ssl_opts, [{cacertfile, "/path/to/cacert.pem"},
%% {certfile, "/path/to/cert.pem"},
%% {keyfile, "/path/to/key.pem"}]}]},
%% One of 'basic', 'detailed' or 'none'. See
%% http://www.rabbitmq.com/management.html#fine-stats for more details.
%% {rates_mode, basic},
%% Configure how long aggregated data (such as message rates and queue
%% lengths) is retained. Please read the plugin's documentation in
%% http://www.rabbitmq.com/management.html#configuration for more
%% details.
%%
%% {sample_retention_policies,
%% [{global, [{60, 5}, {3600, 60}, {86400, 1200}]},
%% {basic, [{60, 5}, {3600, 60}]},
%% {detailed, [{10, 5}]}]}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ Shovel Plugin
%%
%% See http://www.rabbitmq.com/shovel.html for details
%% ----------------------------------------------------------------------------
{rabbitmq_shovel,
[{shovels,
[%% A named shovel worker.
%% {my_first_shovel,
%% [
%% List the source broker(s) from which to consume.
%%
%% {sources,
%% [%% URI(s) and pre-declarations for all source broker(s).
%% {brokers, ["amqp://user:password@host.domain/my_vhost"]},
%% {declarations, []}
%% ]},
%% List the destination broker(s) to publish to.
%% {destinations,
%% [%% A singular version of the 'brokers' element.
%% {broker, "amqp://"},
%% {declarations, []}
%% ]},
%% Name of the queue to shovel messages from.
%%
%% {queue, <<"your-queue-name-goes-here">>},
%% Optional prefetch count.
%%
%% {prefetch_count, 10},
%% when to acknowledge messages:
%% - no_ack: never (auto)
%% - on_publish: after each message is republished
%% - on_confirm: when the destination broker confirms receipt
%%
%% {ack_mode, on_confirm},
%% Overwrite fields of the outbound basic.publish.
%%
%% {publish_fields, [{exchange, <<"my_exchange">>},
%% {routing_key, <<"from_shovel">>}]},
%% Static list of basic.properties to set on re-publication.
%%
%% {publish_properties, [{delivery_mode, 2}]},
%% The number of seconds to wait before attempting to
%% reconnect in the event of a connection failure.
%%
%% {reconnect_delay, 2.5}
%% ]} %% End of my_first_shovel
]}
%% Rather than specifying some values per-shovel, you can specify
%% them for all shovels here.
%%
%% {defaults, [{prefetch_count, 0},
%% {ack_mode, on_confirm},
%% {publish_fields, []},
%% {publish_properties, [{delivery_mode, 2}]},
%% {reconnect_delay, 2.5}]}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ Stomp Adapter
%%
%% See http://www.rabbitmq.com/stomp.html for details
%% ----------------------------------------------------------------------------
{rabbitmq_stomp,
[%% Network Configuration - the format is generally the same as for the broker
%% Listen only on localhost (ipv4 & ipv6) on a specific port.
%% {tcp_listeners, [{"127.0.0.1", 61613},
%% {"::1", 61613}]},
%% Listen for SSL connections on a specific port.
%% {ssl_listeners, [61614]},
%% Additional SSL options
%% Extract a name from the client's certificate when using SSL.
%%
%% {ssl_cert_login, true},
%% Set a default user name and password. This is used as the default login
%% whenever a CONNECT frame omits the login and passcode headers.
%%
%% Please note that setting this will allow clients to connect without
%% authenticating!
%%
%% {default_user, [{login, "guest"},
%% {passcode, "guest"}]},
%% If a default user is configured, or you have configured use SSL client
%% certificate based authentication, you can choose to allow clients to
%% omit the CONNECT frame entirely. If set to true, the client is
%% automatically connected as the default user or user supplied in the
%% SSL certificate whenever the first frame sent on a session is not a
%% CONNECT frame.
%%
%% {implicit_connect, true}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ MQTT Adapter
%%
%% See https://github.com/rabbitmq/rabbitmq-mqtt/blob/stable/README.md
%% for details
%% ----------------------------------------------------------------------------
{rabbitmq_mqtt,
[%% Set the default user name and password. Will be used as the default login
%% if a connecting client provides no other login details.
%%
%% Please note that setting this will allow clients to connect without
%% authenticating!
%%
%% {default_user, <<"guest">>},
%% {default_pass, <<"guest">>},
%% Enable anonymous access. If this is set to false, clients MUST provide
%% login information in order to connect. See the default_user/default_pass
%% configuration elements for managing logins without authentication.
%%
%% {allow_anonymous, true},
%% If you have multiple chosts, specify the one to which the
%% adapter connects.
%%
%% {vhost, <<"/">>},
%% Specify the exchange to which messages from MQTT clients are published.
%%
%% {exchange, <<"amq.topic">>},
%% Specify TTL (time to live) to control the lifetime of non-clean sessions.
%%
%% {subscription_ttl, 1800000},
%% Set the prefetch count (governing the maximum number of unacknowledged
%% messages that will be delivered).
%%
%% {prefetch, 10},
%% TCP/SSL Configuration (as per the broker configuration).
%%
%% {tcp_listeners, [1883]},
%% {ssl_listeners, []},
%% TCP/Socket options (as per the broker configuration).
%%
%% {tcp_listen_options, [binary,
%% {packet, raw},
%% {reuseaddr, true},
%% {backlog, 128},
%% {nodelay, true}]}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ AMQP 1.0 Support
%%
%% See https://github.com/rabbitmq/rabbitmq-amqp1.0/blob/stable/README.md
%% for details
%% ----------------------------------------------------------------------------
{rabbitmq_amqp1_0,
[%% Connections that are not authenticated with SASL will connect as this
%% account. See the README for more information.
%%
%% Please note that setting this will allow clients to connect without
%% authenticating!
%%
%% {default_user, "guest"},
%% Enable protocol strict mode. See the README for more information.
%%
%% {protocol_strict_mode, false}
]},
%% ----------------------------------------------------------------------------
%% RabbitMQ LDAP Plugin
%%
%% See http://www.rabbitmq.com/ldap.html for details.
%%
%% ----------------------------------------------------------------------------
{rabbitmq_auth_backend_ldap,
[%%
%% Connecting to the LDAP server(s)
%% ================================
%%
%% Specify servers to bind to. You *must* set this in order for the plugin
%% to work properly.
%%
%% {servers, ["your-server-name-goes-here"]},
%% Connect to the LDAP server using SSL
%%
%% {use_ssl, false},
%% Specify the LDAP port to connect to
%%
%% {port, 389},
%% LDAP connection timeout, in milliseconds or 'infinity'
%%
%% {timeout, infinity},
%% Enable logging of LDAP queries.
%% One of
%% - false (no logging is performed)
%% - true (verbose logging of the logic used by the plugin)
%% - network (as true, but additionally logs LDAP network traffic)
%%
%% Defaults to false.
%%
%% {log, false},
%%
%% Authentication
%% ==============
%%
%% Pattern to convert the username given through AMQP to a DN before
%% binding
%%
%% {user_dn_pattern, "cn=${username},ou=People,dc=example,dc=com"},
%% Alternatively, you can convert a username to a Distinguished
%% Name via an LDAP lookup after binding. See the documentation for
%% full details.
%% When converting a username to a dn via a lookup, set these to
%% the name of the attribute that represents the user name, and the
%% base DN for the lookup query.
%%
%% {dn_lookup_attribute, "userPrincipalName"},
%% {dn_lookup_base, "DC=gopivotal,DC=com"},
%% Controls how to bind for authorisation queries and also to
%% retrieve the details of users logging in without presenting a
%% password (e.g., SASL EXTERNAL).
%% One of
%% - as_user (to bind as the authenticated user - requires a password)
%% - anon (to bind anonymously)
%% - {UserDN, Password} (to bind with a specified user name and password)
%%
%% Defaults to 'as_user'.
%%
%% {other_bind, as_user},
%%
%% Authorisation
%% =============
%%
%% The LDAP plugin can perform a variety of queries against your
%% LDAP server to determine questions of authorisation. See
%% http://www.rabbitmq.com/ldap.html#authorisation for more
%% information.
%% Set the query to use when determining vhost access
%%
%% {vhost_access_query, {in_group,
%% "ou=${vhost}-users,ou=vhosts,dc=example,dc=com"}},
%% Set the query to use when determining resource (e.g., queue) access
%%
%% {resource_access_query, {constant, true}},
%% Set queries to determine which tags a user has
%%
%% {tag_queries, []}
]}
].
</span><span style="font-size: 13px;">
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#Restart rabbitmq server
#Check queue status:
python code:
</span><span style="font-size: xx-small;">import amqplib.client_0_8 as amqp
host = '127.0.0.1'
port = 5671
connection= amqp.Connection(host='%s:%s' % (host, port), userid='user', password='password', ssl=True, virtual_host='vhostname')
channel = connection.channel()
name, jobs, consumers = channel.queue_declare(queue='for_monitoring', passive=True)
print jobs</span><span style="font-size: 13px;">
</span></pre>
<pre class="sourcecode" style="background: rgb(238, 238, 238); border: 1px solid rgb(221, 221, 221); color: #333333; font-family: 'Courier New', Courier, monospace; line-height: 18px; padding: 5px;"><span style="font-size: 13px;">#coding celery worker:
</span><span style="font-size: xx-small;">from __future__ import absolute_import
from celery import Celery
from kombu import Exchange, Queue
import requests
import ssl
worker_app = Celery('project',
broker = 'amqp://' + RABBITMQ_USER_NAME + ':' + RABBITMQ_PASSWORD + '@' + RABBITMQ_HOST + ':5671/' + RABBITMQ_VIRTUAL_HOST,
include = ['tasks'])
worker_app.conf.update(
CELERY_TASK_RESULT_EXPIRES = 3600,
CELERY_QUEUES = (
Queue('for_monitoring', Exchange('for_monitoring'), routing_key = 'for_monitoring')
),
CELERY_ROUTES = {
'monitoring': {'queue': 'for_monitoring', 'routing_key': 'for_monitoring'}
},
CELERY_TIMEZONE = 'UTC',
BROKER_USE_SSL = {
'ca_certs': '/etc/rabbitmq/ssl/certs/cacert.pem',
'keyfile': '/etc/rabbitmq/ssl/certs/key_client.pem',
'certfile': '/etc/rabbitmq/ssl/certs/cert_client.pem',
'cert_reqs': ssl.CERT_REQUIRED
}
)</span><span style="font-size: 13px;">
</span></pre>
</div>
<div>
<br /></div>
<div>
This i tried and tested and is working fine. I am not sure how to disable the http port though. So i just blocked the port from remote access. Will update if i find that out.</div>
<div>
<br /></div>
<div>
Thanks,</div>
<div>
Vikash</div>
<div>
<br /></div>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com1tag:blogger.com,1999:blog-1796750639231272453.post-57937416983476296842015-03-12T21:01:00.000-07:002015-03-12T21:11:16.586-07:00How to download from torrent<div dir="ltr" style="text-align: left;" trbidi="on">
<b>Step 1: </b>Open <a href="https://torrentz.eu/" target="_blank">https://torrentz.eu/</a> . This is a torrent search engine. Like Google for torrents.<br />
<div>
<br /></div>
<div>
<b>Step 2:</b> Search. Search for what you are looking to download.</div>
<div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidCJgMhcLdfDl6TmhmkkYE_FDR950e3vtVdhPFeX1Y9lt8GSRqgJ39vpScbZhKS1bls4wA33CuF1l7Ckgr185yadCHnnq7SJmc9tQhJvRLbIlXzoRPHw0Ulsu5CfpdmfuKy2dgw529UwTu/s1600/1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidCJgMhcLdfDl6TmhmkkYE_FDR950e3vtVdhPFeX1Y9lt8GSRqgJ39vpScbZhKS1bls4wA33CuF1l7Ckgr185yadCHnnq7SJmc9tQhJvRLbIlXzoRPHw0Ulsu5CfpdmfuKy2dgw529UwTu/s1600/1.png" height="358" width="640" /></a></div>
<div>
<br /></div>
</div>
<div>
<b>Step 3:</b> click on 1 that matches your search best. Look at rating and size. Some torrents could be very large like 10-20 Gb. Some could still be large like 2-3Gb for a BlueRay Movie or something. While we can manage with a 720 Blure Ray Rip.</div>
<div>
<br /></div>
<div>
<b>Step 4:</b> Open this torrent you chose in a new tab. This may take 2 clicks. On your first click you might end up opening an Ad and on the 2nd click the actual torrent may open. </div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxpHElOY4CFPDkpYEq92lo-uLL2GpDfltvEGvwF9E1s28vk-W8rtnP-TukJ_9GbSN8AdZnKLhtOaWFrM4rEKdSifNpA2LQnaos60zaAb_XTwwFpdvTJj9X9dG-ZZfYxa0vtXogm2N8mbHN/s1600/2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxpHElOY4CFPDkpYEq92lo-uLL2GpDfltvEGvwF9E1s28vk-W8rtnP-TukJ_9GbSN8AdZnKLhtOaWFrM4rEKdSifNpA2LQnaos60zaAb_XTwwFpdvTJj9X9dG-ZZfYxa0vtXogm2N8mbHN/s1600/2.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 5: </b>I trust very few websites. Like https://kickass.to/ or http://1337x.to/ or http://thepiratebay.to/. These are the reliable once. Open that link in a new Tab.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 6: </b>Now the crucial parts. Check for the comments and likes on the torrent. That will tell you what other users who have downloaded the torrent say about it. if they found it useful or not.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizF6i0WCvr5v48km7Ihxjl1rAFKGH8kgvmkcquYyPYBVr-tAMNPmKJMp1GUNfUrgJxIZrPRH_ttJVUDDHnByKqm0jjMlpbQja7UQdOVquZ4XBBMi7g6eMrkym8U4tWYE9saBAg5TLeezYo/s1600/3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEizF6i0WCvr5v48km7Ihxjl1rAFKGH8kgvmkcquYyPYBVr-tAMNPmKJMp1GUNfUrgJxIZrPRH_ttJVUDDHnByKqm0jjMlpbQja7UQdOVquZ4XBBMi7g6eMrkym8U4tWYE9saBAg5TLeezYo/s1600/3.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; font-weight: bold; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 7: </b>Now open the downloaded .torrent file in a torrent client like <a href="http://www.bittorrent.com/" target="_blank">Bit torrent</a>, <a href="http://www.utorrent.com/" target="_blank">U Torrent</a>, <a href="http://dev.deluge-torrent.org/wiki/Installing/Linux/Ubuntu" target="_blank">Deludge for linux</a>. It should download a some time.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<b>Step 8: </b>And if you have limited bandwidth then once the download is complete stop that particular torrent otherwise it will keep uploading/seeding which will consume your bandwidth. </div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Other ways to verify a torrent is genuine or not is to check other uploads from the same up-loader.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
open the up-loader account in new tab.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmuVru8FyiK7OO1muoiYU_ZgqF6bzs8EmQbQtI6UNcN1YS4BlLdMsEGcoltWHhv4acbldH_ypw_Bs2s4SajzjY35humPMks8Se_BnfwfwYi7pgmAv3TT0l7aAQhCBkdCwZl5TS_bayZGNO/s1600/4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmuVru8FyiK7OO1muoiYU_ZgqF6bzs8EmQbQtI6UNcN1YS4BlLdMsEGcoltWHhv4acbldH_ypw_Bs2s4SajzjY35humPMks8Se_BnfwfwYi7pgmAv3TT0l7aAQhCBkdCwZl5TS_bayZGNO/s1600/4.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
check the users other uploads and comments on them.</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpcZYhnh7bsHorFOnUacb8TMNgrXA6swLJzaNyqxM4juONI1CbhasQSX8PwCFPQ6OoscSUkPNzGqucj37Roe6KVIlwARk5JIXrdlNWYXCCeqkyWsT50_HtL4ebowJPWtKAvZbbj0Ed2nB3/s1600/5.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpcZYhnh7bsHorFOnUacb8TMNgrXA6swLJzaNyqxM4juONI1CbhasQSX8PwCFPQ6OoscSUkPNzGqucj37Roe6KVIlwARk5JIXrdlNWYXCCeqkyWsT50_HtL4ebowJPWtKAvZbbj0Ed2nB3/s1600/5.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
Enjoy your downloads :)</div>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-30330807676431151732015-03-06T21:49:00.000-08:002015-03-06T21:49:15.495-08:00How to achieve port forwarding<div dir="ltr" style="text-align: left;" trbidi="on">
you will need a few things:<br />
<br />
A computer through which you want to achieve port forwarding:<br />
<br />
details required:<br />
<br />
ip<br />
port # any port would do<br />
ssh key # if needed to access the computer or password<br />
username on that computer<br />
<br />
<br />
run this command in the terminal to port forward from port 8080 on your computer to the remote computer over ssh.<br />
<br />
<i> ssh -D 8080 -C -N -i ~/.ssh/key.pem ubuntu@<ip></i><br />
<br />
Now configure your browser to talk to this computer as a proxy server on the port you specified.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCu28FDvpz3KUvnLmXy6AjzM97Hg1lTDllTvDvQGfGHOBhFpH8F_ynGjlDxw2Wr1fs1dnIjw3aqYHyu4b4SRYrt2GRgXVR2b4osvNcU-7bUu-ClQKS0KvyxaUEkSAzUfxRF52tFhWSs7tO/s1600/sock+configuration.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCu28FDvpz3KUvnLmXy6AjzM97Hg1lTDllTvDvQGfGHOBhFpH8F_ynGjlDxw2Wr1fs1dnIjw3aqYHyu4b4SRYrt2GRgXVR2b4osvNcU-7bUu-ClQKS0KvyxaUEkSAzUfxRF52tFhWSs7tO/s1600/sock+configuration.png" height="640" width="580" /></a></div>
This is browser level configuration for Firefox. You can configure the same proxy settings at Ubuntu/OS level to use it across the system from any browser or computer.<br />
<br />
cheers.<br />
<br /></div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-341391265408041462015-03-06T21:30:00.002-08:002015-06-01T06:46:07.912-07:00How to extract email ids from your gmail account using a python script<div dir="ltr" style="text-align: left;" trbidi="on">
<span style="font-family: Georgia, Times New Roman, serif; line-height: 150%;">Recently a friend of mine asked me to give him all the email ids that i have. Post the usual discussion of 'i will not spam them, it's research purpose, ... is what i am working on' i agreed to give him the list. He sent me a link to some 3rd part service which i was suppose to authenticate to so he can get the list of mail id's. While he is not a techie, i am. So agreeing to an o-auth with some random 3rd party website does not sound like a good idea to me. Thus i mailed him that i will not authenticate a 3rd party app with o-auth but i will give him the list of mail ids and i will extract it myself. He didn't mind it so i set to work:</span><br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large; line-height: 150%;"><br /></span>
<span style="font-family: Georgia, Times New Roman, serif; line-height: 150%;">I found a simple program online :</span><br />
<span style="font-family: Georgia, Times New Roman, serif; font-size: large; line-height: 150%;"><br /></span>
<br />
<div class="codeblock" style="background: rgb(244, 244, 244); color: #333333; font-family: Georgia, Times, 'Times New Roman', serif; font-size: 13px; line-height: 18.2000007629395px;">
<pre style="overflow: auto;"><span style="font-family: Courier New, Courier, monospace; font-size: x-small;"><i>import imaplib, email
def split_mail_id(email_id):
#split an address list into list of tuples of (name, address)
if not(email_id): return []
out_queue = True
cut = -1
result = []
for i in range(len(email_id)):
if email_id[i]=='"': out_queue = not(out_queue)
if out_queue and email_id[i]==',':
result.append(email.utils.parseaddr(email_id[cut+1:i]))
cut = i
result.append(email.utils.parseaddr(email_id[cut+1:i+1]))
return result
user_id = "<email>"
password = "<app_password>" #at the bottom of the page we explain how to get this password
mail = imaplib.IMAP4_SSL('imap.gmail.com')
mail.login(user_id, password)
mail.select("INBOX")
result, data = mail.search(None,"ALL")
ids = data[0].split()
msgs = mail.fetch(','.join(ids),'(BODY.PEEK[HEADER])')[1][0::2]
addresses = []
for x, msg in msgs:
msgobj = email.message_from_string(msg)
addresses.extend(split_mail_id(msgobj['to']))
addresses.extend(split_mail_id(msgobj['from']))
addresses.extend(split_mail_id(msgobj['cc']))
output_file = open('mail_ids.txt','w')
for address in addresses:
output_file.write(address[1] + "\n")
output_file.close()</i></span><span style="font-family: monospace, monospace; font-size: 1em;">
</span></pre>
<div>
<br /></div>
</div>
<div class="codeblock" style="background: rgb(244, 244, 244); color: #333333; font-family: Georgia, Times, 'Times New Roman', serif; font-size: 13px; line-height: 18.2000007629395px;">
<pre style="font-family: monospace, monospace; font-size: 1em; overflow: auto;"></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">Now, How to get app specific gmail password:</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">
</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">goto : <i>https://myaccount.google.com/</i></span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">
</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">and select App passwords or direct click this link: </span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span style="font-size: x-small;">
</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">https://security.google.com/settings/security/apppasswords
</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">
</span></pre>
<pre style="font-family: monospace, monospace; overflow: auto;"><span class="" style="font-size: x-small;">There select "other". Enter a name like mail_ids and generate a password.</span></pre>
<pre style="font-family: monospace, monospace; font-size: 1em; overflow: auto;"><span class="">
</span></pre>
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWydV0VLIYrrzkG4o3ywna7Vhba0yQC3McXMobHC4PFA-Bup8RXoUqUle-Ys8FCBP3-jygXBvCQ4m8_UBFkOgPesPtPT_Xksyoo62R3dCsCkgJHU51-cw37iCct2SjYagqsCjQl9LUpFf9/s1600/app_password.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="376" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWydV0VLIYrrzkG4o3ywna7Vhba0yQC3McXMobHC4PFA-Bup8RXoUqUle-Ys8FCBP3-jygXBvCQ4m8_UBFkOgPesPtPT_Xksyoo62R3dCsCkgJHU51-cw37iCct2SjYagqsCjQl9LUpFf9/s1600/app_password.png" width="640" /></a></div>
<br />
<span style="font-family: monospace, monospace; font-size: x-small;">this is a google app password. You can use this password to access your gmail account from any app.</span><br />
<span style="font-size: x-small;"><br /></span>
<span style="font-size: x-small;"><br /></span><span style="font-family: Georgia, 'Times New Roman', serif; line-height: 24px;">Finally my friend got all the mail ids in a .txt file. He is happy and i am happy that i didn't had to authenticate a 3rd party app with my gmail.</span><br />
<span style="font-family: Georgia, 'Times New Roman', serif; line-height: 24px;"><br /></span>
<span style="font-family: Georgia, 'Times New Roman', serif; line-height: 24px;">Peace Out.</span></div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com1tag:blogger.com,1999:blog-1796750639231272453.post-16438762346679316112015-03-06T20:48:00.003-08:002015-03-06T20:50:21.249-08:00Clear all queue in rabitmq<div dir="ltr" style="text-align: left;" trbidi="on">
To clear a queue in rabbitmq or get no of jobs/consumers in/on the queue:<br />
<br />
open python shell<br />
enable a connection to the rabbitmq server<br />
open a channel to the connection<br />
<br />
<blockquote class="tr_bq" style="text-align: left;">
import amqplib.client_0_8 as amqp
<br />
<br />
host = <IP><br />
port = <PORT><br />
connection= amqp.Connection(host ='%s:%s' % (host, port),<br />
userid = '<user>',<br />
password = '<password>',<br />
ssl = False,<br />
virtual_host = 'rabbitvhost') </blockquote>
<blockquote class="tr_bq" style="text-align: left;">
channel = connection.channel()<br />
<br />
name, jobs, consumers = channel.queue_declare(queue='queue_name', passive=True)
<br />
<div style="text-align: left;">
</div>
<br />
<div style="text-align: left;">
jobs # no of jobs in the queue</div>
<div style="text-align: left;">
consumers # no of workers working on that queue</div>
<div style="text-align: left;">
<br /></div>
<br />
<div style="text-align: left;">
</div>
<div style="text-align: left;">
#Delete the queue</div>
<div style="text-align: left;">
channel.queue_delete(queue='queue_name')</div>
<br />
# Close the channel<br />
channel.close()
<br />
# Close our connection
<br />
connection.close()</blockquote>
happy programming :)</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-12132164828166429172015-01-28T01:30:00.001-08:002015-01-28T01:34:18.451-08:00Post messages in Slack using a non existing bot user<div dir="ltr" style="text-align: left;" trbidi="on">
Simply go to this url :<br />
<br />
https://api.slack.com/methods/chat.postMessage/test<br />
<br />
and fill up a couple of fileds:<br />
<br />
Channel, text, username [That will show], and a url for the icon<br />
<br />
eg:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QB-lo1uBwUoK62RjuEDUNzWzdhyphenhyphencnsul9J3yntMFE1ZYKJt5MiYAjHtCgmd00c3awUJClXai_BJJADghZgN07u6-H2ChUQZUvKqPuMiPCCK6XDvMvH1PanVmpe_hdh4lISm41U9OadK6/s1600/slack+bot+user+post.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7QB-lo1uBwUoK62RjuEDUNzWzdhyphenhyphencnsul9J3yntMFE1ZYKJt5MiYAjHtCgmd00c3awUJClXai_BJJADghZgN07u6-H2ChUQZUvKqPuMiPCCK6XDvMvH1PanVmpe_hdh4lISm41U9OadK6/s1600/slack+bot+user+post.png" height="528" width="640" /></a></div>
<br />
<br />
output:<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9CqxhXj1Kdom0y1If1zKWmVpkGRG_6W41ZPmHyy-zJIuzXAVW_jVa8krkKiWL3YHNMRTt4RfLx8FrnvlJMJW0m8wX3VVC_vOh7pT0nTfwKc4EYDyJ7ckfx0P56ZhiUJkWG_JzxfnBAKu/s1600/slack+result.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJ9CqxhXj1Kdom0y1If1zKWmVpkGRG_6W41ZPmHyy-zJIuzXAVW_jVa8krkKiWL3YHNMRTt4RfLx8FrnvlJMJW0m8wX3VVC_vOh7pT0nTfwKc4EYDyJ7ckfx0P56ZhiUJkWG_JzxfnBAKu/s1600/slack+result.png" height="506" width="640" /></a></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Have fun with slack :)</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-72704525551736559582014-12-23T09:47:00.001-08:002015-09-29T08:35:30.846-07:00Using Elastic Search with mongodb<div dir="ltr" style="text-align: left;" trbidi="on">
Eastic search(ES) is super duper fast. Once you integrate it with mongodb and start redirecting your queries their you will be able to scale much better.<br />
<br />
But like every other thing out their ES also has a learning curve. And some times when you get stuck it is difficult to figure out whats going wrong.<br />
<br />
We ran into some issues while working with ES so hear goes our experience and learning with ES.<br />
<br />
<b>I. Installations:</b><br />
<b><br /></b>
A. Install mongodb : http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/<br />
<br />
B. Install Elastic Search: this is simple. just download the latest package of ES and extract it.<br />
<br />
C. Install mongo connector: <span style="background-color: #f9f2f4; color: #c7254e; font-family: Menlo, Monaco, Consolas, 'Courier New', monospace; font-size: 13px; letter-spacing: 0.280000001192093px; line-height: 18.0000019073486px; white-space: nowrap;">pip install mongo-connector</span> #maybe with sudo<br />
<br />
This application is used to pull data out of mongo and push to ES<br />
<br />
D. Install plugin head on ES: [Optional but very helpful plugin]<br />
(if elastic-search is installed then plugin may be found in this directory : /usr/share/elasticsearch/bin)<br />
<br />
elasticsearch/bin/plugin -install mobz/elasticsearch-head<br />
<br />
<b>II. Start Replication log on Mongodb:</b><br />
<br />
You dont need to actually set up replication on mongo. You just need to enable replication logs. This is because mongo connector uses mongo replication logs to read the changes coming in.<br />
<br />
A. edit mongodb config file<br />
<br />
sudo gedit /etc/mongod.conf<br />
<br />
add line<br />
<br />
replSet=rs0<br />
<br />
B. Restart mongo<br />
<br />
sudo service mongod restart<br />
<br />
C. Login to mongo<br />
<br />
mongo<br />
<br />
and run this command<br />
<br />
rs.initiate()<br />
<br />
Now the replication log is setup.<br />
<br />
<b>III. Start Elastic Search</b><br />
<br />
A. Goto ES directory<br />
<br />
cd elasticsearch/bin/<br />
<br />
or<br />
<br />
cd /usr/share/elasticsearch/bin/<br />
<br />
B. run elasticsearch<br />
<br />
./elasticsearch<br />
<br />
<b>IV. Setup mongo Connector</b><br />
<b><br /></b>
A. Open a new tab and enter the following command<br />
<br />
mongo-connector -m localhost:27017 -t localhost:9200 -d elastic_doc_manager --oplog-ts oplogstatus.txt<br />
<br />
You ES is now setup. All indexes from your database will be automatically created<br />
<br />
<b>V. monitor all indexes [if you have installed head plugin]</b><br />
<br />
http://localhost:9200/_plugin/head/<br />
<br />
Index are going to be created with the following naming convention:<br />
<br />
<span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;">Mongo-connector gives each MongoDB collection its own index in Elasticsearch. For example, documents from the collection </span><code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; font-stretch: normal; margin: 0px; padding: 0.2em 0px;">kittens</code><span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;"> in the database </span><code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; font-stretch: normal; margin: 0px; padding: 0.2em 0px;">animals</code><span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;"> will put into the </span><code style="background-color: rgba(0, 0, 0, 0.0392157); border-radius: 3px; box-sizing: border-box; color: #333333; font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 14px; font-stretch: normal; margin: 0px; padding: 0.2em 0px;">animals.kittens</code><span style="background-color: white; color: #333333; font-family: 'Helvetica Neue', Helvetica, 'Segoe UI', Arial, freesans, sans-serif; font-size: 16px; line-height: 25.6000003814697px;"> index in Elasticsearch.</span><br />
<br />
<a href="https://github.com/10gen-labs/mongo-connector/wiki/Usage-with-ElasticSearch#elasticsearch-indexes-mappings-and-types">index naming convention</a><br />
<br />
<b>VI. Querying Elastic search:</b><br />
<b><br /></b>
<b> </b> A. You can use elastic search clients:<br />
<br />
Official list of supported clients : See Clients & Integrations<br />
<br />
http://www.elasticsearch.org/guide/<br />
<br />
B. Simple rest calls:<br />
<br />
You can simple make calls to ES over http<br />
<br />
ex: http://localhost:9200/animals.kittens/_search?pretty=1&q=Tom&size=2&fields=id,owner.name&sort=age<br />
<br />
Here may have to experiment and try out different combinations. And you have a very complicated structure then building a query may turn out to be difficult. So do it step by step.<br />
Partition the query into pieces and build them separately and figure a way to integrate them.<br />
<br />
eg: result = es.search(index="animals.kittens", body=<br />
{<br />
"from" : 0,<br />
"size" : 10,<br />
"query" : {<br />
"filtered" : {<br />
"query": {<br />
"query_string": {<br />
"query": "mouse",<br />
"fields": ["product"]<br />
}<br />
},<br />
"filter" : {<br />
"bool" : {<br />
"must" : [<br />
{<br />
"terms" : {<br />
"address.name" : ["mumbai", "pune"]<br />
}<br />
},<br />
{<br />
"range": {<br />
"cost.inr": {<br />
"gte" : 0,<br />
"lte" : 400<br />
}<br />
}<br />
}<br />
],<br />
"must_not" : {<br />
"terms" : {"id" : ["43832jd0dskf09123yhjdhf012u3j"]}<br />
}<br />
}<br />
}<br />
}<br />
},<br />
"sort": [<br />
{<br />
"rating.avg_ratting": {<br />
"order": "desc"<br />
}<br />
}<br />
]<br />
})<br />
<br />
with the above query you can figure out what the structure of the data will be like. Play around with ES and if you get stuck then drop a comment or ask on Stack-overflow or Quora. :)<br />
<br />
<b>LEARNING:</b><br />
<b><br /></b>
<b>I. To create a custom mapping :</b><br />
<br />
If you are planning to use ES on production for a big data set you will probably find the need to write your own mapping file. Know that mongo-connector creates the index with the name:<br />
<br />
http://localhost:9200/animals.kittens/<br />
<br />
and the mapping is put under :<br />
<br />
http://localhost:9200/animals.kittens/string/<br />
<br />
So to apply your own mapping you will need to do this:<br />
<br />
A. First clear the existing index by deleting it. [head plugin gifs you the feature of make a Delete curl call at the index'<br />
<br />
B. Create a new index<br />
<br />
curl -XPUT 'http://localhost:9200/animals.kittens/'<br />
<br />
C. Apply the mapping file<br />
<br />
curl -XPUT 'http://localhost:9200/animals.kittens/string/_mapping/' -d '<br />
{<br />
"string": {<br />
"properties": {<br />
"owner": {<br />
"properties": {<br />
"name": {<br />
"type": "string"<br />
},<br />
"address": {<br />
"type": "string"<br />
},<br />
"tell": {<br />
"type": "string"<br />
}<br />
}<br />
},<br />
"breed": {<br />
"type": "string"<br />
},<br />
"id": {<br />
"type": "string",<br />
"index": "not_analyzed"<br />
}<br />
}<br />
}<br />
}'<br />
<br />
Not analyzed is very import for fields which might contain spaces or special characters like "#$@" etc..<br />
<br />
<b>II. DB-structure limitation:</b><br />
<br />
A. To efficiently use ES you have to ensure a few consistencies in your database.<br />
<br />
all top level properties must be present in all documents:<br />
<br />
eg:<br />
<br />
[<br />
{<br />
"name": "Vikash",<br />
"dob": "23-11-1989",<br />
"address": "Indiranagar, Bangalore"<br />
},<br />
{<br />
"name": "Viki",<br />
"dob": "22-10-1990"<br />
}<br />
]<br />
<br />
This is a bad idea because the absence of field address in the 2nd document may cause issues.<br />
<br />
B. If you don't have a value for a particular field replace it will null but create the field.<br />
<br />
{<br />
"name": "Viki",<br />
"dob": "22-10-1990",<br />
"address": null<br />
}<br />
<br />
C. This is more a json rule than a db schema rule.<br />
<br />
values in an array should be of the same type and i dont mean just data type i mean in terms of meaning.<br />
<br />
eg: if you need to store a expiration data in year and months separately<br />
<br />
"expiration_time":<br />
[<br />
1, //year<br />
6 //months<br />
]<br />
<br />
you should rather store it as a map/dictionary as<br />
"expiration_time":<br />
{<br />
"years" : 1,<br />
"months" :5<br />
}<br />
<br />
D. Another json rule:<br />
<br />
keys that you use to store the dictionaries should not be generated randomly. Also if possible avoid rule based key generation. This will help you keep your database more structured.<br />
<br />
eg:<br />
<br />
{<br />
"january":<br />
{<br />
"sum": value<br />
},<br />
"december":<br />
{<br />
"sum": value<br />
}<br />
}<br />
// if you are not going to have all 12 months avg stored in there then i suggest use month as a paramet in the data<br />
<br />
{<br />
"aggregated_data":<br />
[<br />
{<br />
"month": 1,<br />
"sum": value<br />
<br />
},<br />
{<br />
"month":12,<br />
"sum": value<br />
}<br />
]<br />
}<br />
<br />
<br />
<br />
Here it will be much easier to select the data from the min month then it will be in the 1st case. Also you can sort by month much easily here.<br />
<br />
To conclude: ES is really really really fast. I am in love with its speed. Hope you enjoy working with it too.<br />
<br />
Bye for now.</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com7tag:blogger.com,1999:blog-1796750639231272453.post-52314324085490490922014-02-09T01:06:00.000-08:002014-02-09T01:07:59.223-08:00Running Android application on device from eclipse in Ubuntu/Linux<div dir="ltr" style="text-align: left;" trbidi="on">
While for windows this process might be as simple as a click on the run button with debugging mode enabled on the device, with Ubuntu it needs a little configuration changes.<br />
<br />
So, Here is how you can do it with Ubuntu/Linux:-<br />
<br />
Step 1: Setup eclipse with Android development kit.<br />
<br />
Download from here <a href="http://developer.android.com/sdk/index.html?utm_source=weibolife">developer.android.com</a><br />
<br />
Extract the zip file.<br />
<br />
cd to the extracted drive and run eclipse.<br />
<br />
Step 2: Create and android application.<br />
<br />
how to do that : <a href="http://developer.android.com/training/basics/firstapp/creating-project.html">first android app</a><br />
<br />
Step 3: connect your android device over USB, And enable USB debugging option (under Settings -> Developer options)<br />
<br />
Step 4: Run the application from the run button on top.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5kKj5CoDBYxsgUxCN6GUNZ1V5ZXPffn0BIF39zzDZgbuHPxgmEDlayXh4GNunEeIvCI6G1uEcrT_O6pNE10w2w_sGF_ORhTe9VAKMsutV1AkbE0JSDdWisO7T7OaYX-CcAJnrNi6UUwb/s1600/running+android+app.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO5kKj5CoDBYxsgUxCN6GUNZ1V5ZXPffn0BIF39zzDZgbuHPxgmEDlayXh4GNunEeIvCI6G1uEcrT_O6pNE10w2w_sGF_ORhTe9VAKMsutV1AkbE0JSDdWisO7T7OaYX-CcAJnrNi6UUwb/s1600/running+android+app.png" height="358" width="640" /></a></div>
<br />
if you get a pop up box like this, that means that eclipse is unable to access the USB device.<br />
<br />
Step 5: Enable access to the USB device.<br />
<br />
open terminal and run this command:<br />
lsusb<br />
<br />
Bus 002 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub<br />
Bus 001 Device 004: ID 1abc:0abc Ricoh Co., Ltd<br />
Bus 001 Device 005: ID 1abc:0abc Foxconn / Hon Hai<br />
Bus 001 Device 002: ID 1abc:0abc Intel Corp. Integrated Rate Matching Hub<br />
Bus 001 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub<br />
Bus 004 Device 001: ID 1abc:0abc Linux Foundation 3.0 root hub<br />
<span style="background-color: #f1c232;">Bus 003 Device 010: ID 0bb4:0cac HTC (High Tech Computer Corp.) </span><br />
Bus 003 Device 002: ID 1abc:0abc Lite-On Technology Corp.<br />
Bus 003 Device 001: ID 1abc:0abc Linux Foundation 2.0 root hub<br />
<br />
<br />
Here the vendor id is 0bb4, and the product id is : 0cac <br />
<br />
Now open file<br />
<br />
sudo vim /etc/udev/rules.d/51-android.rules<br />
<br />
And add the following lines:<br />
<br />
# fastboot protocol on manta (HTC Incredible S)<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="<vendor id>", ATTR{idProduct}=="<product id>", MODE="0600", OWNER="viki"<br />
<br />
Unplug the device and re-plug it.<br />
<br />
Step6: Open Eclipse and re-run the application.<br />
It should open up in the device.<br />
<br />
And questions or suggestions please leave them in the comments below.<br />
<br />
---<br />
Thanks<br />
viki</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-34184085593028455842014-01-05T02:22:00.000-08:002014-01-05T02:22:15.211-08:00Locating mysql sock file <div dir="ltr" style="text-align: left;" trbidi="on">
Locating mysqld.sock file :<br />
<br />
Its a simple step but may give you a hard time when you are a beginner.<br />
<br />
Simply open : vim /etc/mysql/my.cnf<br />
<br />
#Content of the file---<br />
<br />
[client]<br />
port = 3306<br />
socket = /var/run/mysqld/mysqld.sock<br />
<div>
<br /></div>
<div>
here is the default port and default sock file</div>
<div>
<br /></div>
<div>
==========</div>
<div>
<br /></div>
<div>
I found the need for this file when i had to connect to mysql db from my rails app</div>
<div>
<br /></div>
<div>
to configure database.yml </div>
<div>
<br /></div>
<div>
<div>
development:</div>
<div>
adapter: mysql</div>
<div>
encoding: utf8</div>
<div>
database: application</div>
<div>
username: appuser</div>
<div>
password: password</div>
<div>
socket: /var/run/mysqld/mysqld.sock</div>
</div>
<div>
<br /></div>
<div>
Hope you found what you were looking for</div>
<div>
--Cheers</div>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-74820654452634319382013-12-20T12:44:00.002-08:002013-12-20T12:45:24.459-08:00Download list of songs from grooveshark<div dir="ltr" style="text-align: left;" trbidi="on">
A simple Js to download the list of song from grooveshark.<br />
<br />
Here is the GitHub Link for this Project : <a href="https://github.com/vi3k6i5/grooveshark-song-list">https://github.com/vi3k6i5/grooveshark-song-list</a><br />
<br />
Steps:<br />
<br />
1. Copy <a href="https://raw.github.com/vi3k6i5/grooveshark-song-list/master/grooveshark_song_list.js">js</a> from the linked source.<br />
<br />
2. Open <a href="http://grooveshark.com/#!/popular">grooveshark page</a> that has a song list.<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrIHnnnRDDOUFbqcbrMYRLOOOaMrHjpVJDVQuK_yu5MXdy7-vWRFEHRLq_n3pKM4AH2C3KIQUq3e-PWL59r7K0LKr8kFkJm1KP0cXiTvW3cwJ8lXWzEkwSQpQczmIKavzFP3wOpL6GlyWe/s1600/groovesharkSongList-0.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgrIHnnnRDDOUFbqcbrMYRLOOOaMrHjpVJDVQuK_yu5MXdy7-vWRFEHRLq_n3pKM4AH2C3KIQUq3e-PWL59r7K0LKr8kFkJm1KP0cXiTvW3cwJ8lXWzEkwSQpQczmIKavzFP3wOpL6GlyWe/s1600/groovesharkSongList-0.png" height="356" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
3. Open the JavaScript Console from chrome developer tools. </div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDHXR6T6PZRf6A9brd1dhBovZJAEtlJkxe9WT0WHs-9XHDgtdYQN6zsdsyKIHT0OCIJvte9ra3HfyYGxaOGa0a6oa_VMDFlBOJeNptwFH6GhmufBco_1msBVs7epNwjiw9KYu-MK9ucPlO/s1600/groovesharkSongList-1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgDHXR6T6PZRf6A9brd1dhBovZJAEtlJkxe9WT0WHs-9XHDgtdYQN6zsdsyKIHT0OCIJvte9ra3HfyYGxaOGa0a6oa_VMDFlBOJeNptwFH6GhmufBco_1msBVs7epNwjiw9KYu-MK9ucPlO/s1600/groovesharkSongList-1.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
4. Paste the JS in the console and Press Enter.</div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5BijbMo7cMv9Up62VyYVt8YVUqX0081MHqB8zhGH68poCuLV41BWD5JZKSADuwQvFM-uS3ryrXUvAByiRqolAxTPSK6uFuP7rhYPaBHEk6YSBPkNuEXbVRAscAL1YUKxo4WvJ1pfU9bRW/s1600/groovesharkSongList-2.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5BijbMo7cMv9Up62VyYVt8YVUqX0081MHqB8zhGH68poCuLV41BWD5JZKSADuwQvFM-uS3ryrXUvAByiRqolAxTPSK6uFuP7rhYPaBHEk6YSBPkNuEXbVRAscAL1YUKxo4WvJ1pfU9bRW/s1600/groovesharkSongList-2.png" height="358" width="640" /></a></div>
<br />
<br />
5. Leave it for some time as the process for downloading the list of songs is lengthy and takes time.<br />
<br />
6. At the end of the script execution a list of songs will be printed on console in JSON format.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQdGsljSw6Hg9U9xC4ihq9OZ6pZ6g2eOwEmTaRCm_HWR_W999yMMtodL88NUJLvijbXYz9xYt_NKu0Szrt1-7pHBnHSEZjkgBUxV4wO5ipJU2Q4VWkcvhjx4ibERK6usz1xOvSLGP229JL/s1600/groovesharkSongList-3.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQdGsljSw6Hg9U9xC4ihq9OZ6pZ6g2eOwEmTaRCm_HWR_W999yMMtodL88NUJLvijbXYz9xYt_NKu0Szrt1-7pHBnHSEZjkgBUxV4wO5ipJU2Q4VWkcvhjx4ibERK6usz1xOvSLGP229JL/s1600/groovesharkSongList-3.png" height="358" width="640" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: left;">
6. Copy the list and you may organize the list at your favorite Json Processor. </div>
<div class="separator" style="clear: both; text-align: left;">
</div>
<div class="separator" style="clear: both; text-align: left;">
Like <a href="http://www.jsoneditoronline.org/" style="text-align: left;">http://www.jsoneditoronline.org/</a> or <a href="http://pro.jsonlint.com/" style="text-align: left;">http://pro.jsonlint.com/</a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIds7EtlmTxfr7DiT1qE3OoOcOtWnnUOi-08JhV5oeZ-RvKJMJcntaIx5AcWnrSxF12auPLE8VQqFnlUHA5v4bH65LX285chzsYqBoow0WlpiV-4lFiAjMmNOEsHXxxa-EmCfZFixSZb8r/s1600/groovesharkSongList-4.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgIds7EtlmTxfr7DiT1qE3OoOcOtWnnUOi-08JhV5oeZ-RvKJMJcntaIx5AcWnrSxF12auPLE8VQqFnlUHA5v4bH65LX285chzsYqBoow0WlpiV-4lFiAjMmNOEsHXxxa-EmCfZFixSZb8r/s1600/groovesharkSongList-4.png" height="358" width="640" /></a></div>
<br />
Thanks,<br />
<br />
PS: I did this project because grooveshark does not provide a direct means to download the list of songs. Also at any point of time they only load 40 songs on the page. Hence it was a little challenging to download the list, and so this JS came into being.<br />
<br />
Cheers </div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com4tag:blogger.com,1999:blog-1796750639231272453.post-88202459363885090582013-11-24T06:57:00.003-08:002013-11-24T09:45:00.958-08:00Highlight HTML Element on page<div dir="ltr" style="text-align: left;" trbidi="on">
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="headers">
Demo: Click on Highlight
</div>
<br />
<br />
<style>
code {
font-size: 14px;
}
.code-background {
background-color: #fff;
border: 1px solid gray;
border-radius: 4px;
padding: 10px;
height: 500px;
overflow: scroll;
}
.headers
{
margin-top: 0px;
margin-left: 0px;
font-family:Georgia,serif;
color:#4E443C;
font-variant: small-caps;
text-transform: none;
font-weight: 100;
margin-bottom: 0;
font-size: 20px;
}
.inline-div{
display: inline-block;
text-align: center;
height: 50px;
width: 50px;
vertical-align: middle;
line-height: 50px;
}
.new-div {
display: inline-block;
}
.margin-div {
margin:10px 10px 10px 10px;
}
.container-div {
margin: 0px auto;
width: 178px;
border: 1px groove;
}
</style>
<script>
var transitionTime = 1000,
transitionEffect = 'box-shadow 1s',
shadowEffect = 'inset 0px 0px 7px 0px #FF0000, 0px 0px 7px 0px #FF0000',
removeShadow = function(element) {
$(element).css({
boxShadow: 'inset 0px 0px 0px 0px #000, 0px 0px 0px 0px #000'
});
},
resetShadow = function(element) {
$(element).css({
boxShadow: ''
});
},
removeTransition = function(element) {
$(element).css({
transition: ''
});
}
var highlight = function(element) {
$(element).css({
transition: transitionEffect,
boxShadow: shadowEffect
});
setTimeout(function() {
removeShadow(element);
setTimeout(function() {
resetShadow(element);
removeTransition(element);
}, transitionTime);
}, transitionTime);
}
var highlightFunction = function() {
var elements = $(".highlight-ele");
for(var i=0; i< elements.length; i++) {
highlight(elements[i]);
}
}
</script>
<br />
<div dir="ltr" style="text-align: left;" trbidi="on">
<div class="container-div">
<div class="margin-div">
<div class="inline-div highlight-ele" id="div1">
How
</div>
<div class="inline-div highlight-ele" id="div2">
you
</div>
<div class="inline-div highlight-ele" id="div3">
doin?
</div>
</div>
<div class="margin-div">
<div class="new-div">
<input class="highlight-ele" style="border: 1px solid black;" />
</div>
</div>
<div class="margin-div">
<button onclick="highlightFunction()" style="height: 25px; width: 153px;">Highlight</button>
</div>
<div>
</div>
</div>
<br />
<br />
<div class="headers">
Code: How to achieve this effect :
</div>
<br />
JavaScript:
<br />
<div class="code-background">
<code class="prettyprint lang-js">
var transitionTime = 1000,<br />
<br />
transitionEffect = 'box-shadow 1s',<br />
<br />
shadowEffect = 'inset 0px 0px 7px 0px #FF0000, 0px 0px 7px 0px #FF0000',<br />
<br />
removeShadow = function(element) {<br />
$(element).css({<br />
boxShadow: 'inset 0px 0px 0px 0px #000, 0px 0px 0px 0px #000' <br />
});<br />
},<br />
<br />
resetShadow = function(element) {<br />
$(element).css({<br />
boxShadow: ''<br />
});<br />
},<br />
<br />
removeTransition = function(element) {<br />
$(element).css({<br />
transition: ''<br />
});<br />
},<br />
<br />
highlight = function(element) {<br />
$(element).css({<br />
transition: transitionEffect,
boxShadow: shadowEffect <br />
});<br />
setTimeout(function() {<br />
removeShadow(element);<br />
setTimeout(function() {<br />
resetShadow(element);<br />
removeTransition(element);<br />
}, transitionTime);<br />
}, transitionTime );<br />
},<br />
<br />
highlightFunction = function() {<br />
var elements = $(".highlight-ele");<br />
for(var i = 0; i < elements.length; i++) {<br />
highlight(elements[i]);<br />
}<br />
}</code>
</div>
<br />
HTML:
<br />
<div class="code-background">
<code class="prettyprint lang-html">
<div class="container-div"><br /> <div class="margin-div"><br /> <div class="inline-div highlight-ele" id="div1"><br /> How<br /> </div><br />
<br /> <div class="inline-div highlight-ele" id="div2"><br /> you<br /> </div><br />
<br /> <div class="inline-div highlight-ele" id="div3"><br /> doin?<br /> </div><br /> </div><br /> <div class="margin-div"><br /> <div class="new-div"><br /> <input class="highlight-ele" style="border : 1px solid black"> </input><br /> </div><br /> </div><br /> <div class="margin-div"><br /> <button onclick="highlightFunction()" style="height: 25px; width: 153px;"><br /> Highlight<br /> </button><br /> </div><br />
</div>
</code>
</div>
<br />
<br />
CSS:
<br />
<div class="code-background">
<code class="prettyprint lang-cs">
.inline-div{<br />
display: inline-block;<br />
text-align: center;<br />
height: 50px;<br />
width: 50px;<br />
vertical-align: middle;<br />
line-height: 50px;<br />
}<br />
<br />
.new-div {<br />
display: inline-block;<br />
}<br />
<br />
.margin-div {<br />
margin:10px 10px 10px 10px;<br />
}<br />
<br />
.container-div {<br />
margin: 0px auto;<br />
width: 178px;<br />
border: 1px groove;<br />
}
</code>
<br />
<br />
<br /></div>
</div>
<br />
<br />
<div class="headers">
jquery plugin:</div>
<br />
I have created a jquery plugin to achieve the same effect <a href="http://plugins.jquery.com/highlighter/">Highlighter Plugin for jquery</a>
<br />
<br />
Just include the js in your code and call highlight method on your selector
<code class="prettyprint lang-js">
$(".highlight-ele").highlight();</code>
<br />
<code class="prettyprint lang-js"><br /></code></div>
It is hosted on Github : <a href="https://github.com/vi3k6i5/jquery-highlighter">jquery-highlighter on GitHub</a><br />
<br /></div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com2tag:blogger.com,1999:blog-1796750639231272453.post-80564098639276333782013-10-02T11:04:00.001-07:002013-10-05T01:30:53.331-07:00SoftWare List for Linux. <style type="text/css">
/* ------------------
styling for the tables
------------------ */
body
{
line-height: 1.6em;
}
#headers
{
margin-top: 0px;
margin-left: 0px;
font-family:Georgia,serif;
color:#4E443C;
font-variant: small-caps;
text-transform: none;
font-weight: 100;
margin-bottom: 0;
font-size: 24px;
}
#background-image
{
font-family: "Lucida Sans Unicode", "Lucida Grande", Sans-Serif;
font-size: 12px;
margin-top: 10px;
margin-left: 45px;
width: 90%;
text-align: left;
border-collapse: collapse;
background: url('https://dl.dropboxusercontent.com/s/0xkvhvfjjt5ls2g/blurry.png') right top no-repeat;
}
#background-image th
{
padding: 12px;
font-weight: normal;
font-size: 14px;
color: #339;
}
#background-image td
{
padding: 9px 12px;
color: #669;
border-top: 1px solid #fff;
}
#background-image tfoot td
{
font-size: 11px;
}
#background-image tbody td
{
background: url('https://dl.dropboxusercontent.com/s/71bdhzwq2pv07f2/back.png');
}
* html #background-image tbody td
{
/*
----------------------------
PUT THIS ON IE6 ONLY STYLE
AS THE RULE INVALIDATES
YOUR STYLESHEET
----------------------------
*/
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='table-images/back.png',sizingMethod='crop');
background: none;
}
#background-image tbody tr:hover td
{
color: #339;
background: none;
}
.spinning {
/*General*/
transform: rotate(-90deg);
/*Firefox*/
-moz-transform: rotate(-90deg);
/*Microsoft Internet Explorer*/
-ms-transform: rotate(-90deg);
/*Chrome, Safari*/
-webkit-transform: rotate(-90deg);
/*Opera*/
-o-transform: rotate(-90deg);
/*alter opacity*/
}
#spin1,#spin2,#spin3,#spin4,#spin5,#spin6,#spin7,#spin8,#spin9,#spin10 {
margin-top: 10px;
margin-bottom: -10px;
margin-left: 10px;
/*general version*/
transition: 1s;
/*browser specific versions*/
-moz-transition: 1s;
-ms-transition: 1s;
-webkit-transition: 1s;
-o-transition: 1s;
}
.reversespinning {
/*General*/
transform: rotate(0deg);
/*Firefox*/
-moz-transform: rotate(0deg);
/*Microsoft Internet Explorer*/
-ms-transform: rotate(0deg);
/*Chrome, Safari*/
-webkit-transform: rotate(0deg);
/*Opera*/
-o-transform: rotate(0deg);
/*alter opacity*/
}
</style>
<script language="javascript" type="text/javascript">
function manageMenu(menu, imgobj) {
var toggledUp = $('#' + menu).is(":visible");
if (toggledUp == false) {
toggledUp = true;
$('#' + menu).fadeIn(1000);
$('#' + imgobj).removeClass("spinning").addClass("reversespinning");
}
else {
toggledUp = false;
$('#' + menu).fadeOut(1000);
$('#' + imgobj).removeClass("reversespinning").addClass("spinning");
}
}
</script>
<div >
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin2" onclick="manageMenu('menu2','spin2')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu2','spin2')">
Communication
</span>
</span>
<div id="menu2" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Email Client
</td>
<td>
Outlook
</td>
<td>
Thunderbird/Evolution
</td>
</tr>
<tr>
<td>
Messaging Client
</td>
<td>
Google Talk Yahoo msg
</td>
<td>
Pidgin
</td>
</tr>
<tr>
<td>
Web browser,
</td>
<td>
Firefox
</td>
<td>
Chromium
</td>
</tr>
<tr>
<td>
Voice Over IP
</td>
<td>
Skype
</td>
<td>
QuteCom
</td>
</tr>
<tr>
<td>
Proxy browsing
</td>
<td>
</td>
<td>
Tor
</td>
</tr>
<tr>
<td>
Video Over IP
</td>
<td>
</td>
<td>
Skype
</td>
</tr>
<tr>
<td>
Cloud file storage service
</td>
<td>
</td>
<td>
Dropbox
</td>
</tr>
<tr>
<td>
Torrent Client
</td>
<td>
</td>
<td>
Transmission/Deluge
</td>
</tr>
<tr>
<td>
ssh connection
</td>
<td>
</td>
<td>
OpenSSH
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin3" onclick="manageMenu('menu3','spin3')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu3','spin3')">
Productivity
</span>
</span>
<div id="menu3" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
PDF reader
</td>
<td>
Adobe Reader
</td>
<td>
PDF Creator
</td>
</tr>
<tr>
<td>
Office Suite
</td>
<td>
MS Office
</td>
<td>
LibreOffice
</td>
</tr>
<tr>
<td>
Text editing
</td>
<td>
NotePad++
</td>
<td>
Sublime Text
</td>
</tr>
<tr>
<td>
Dictionary
</td>
<td>
WordNet
</td>
<td>
Artha
</td>
</tr>
<tr>
<td>
Personal organizer
</td>
<td>
WunderList
</td>
<td>
Getting Things Gnome
</td>
</tr>
<tr>
<td>
to-do list
</td>
<td>
</td>
<td>
Wunderlist
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin4" onclick="manageMenu('menu4','spin4')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu4','spin4')">
Drawing
</span>
</span>
<div id="menu4" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Basic Paint
</td>
<td>
Ms-Paint
</td>
<td>
gnome-paint
</td>
</tr>
<tr>
<td>
Advance Paint
</td>
<td>
</td>
<td>
Pinta
</td>
</tr>
<tr>
<td>
Image Editing
</td>
<td>
Adobe Photoshop
</td>
<td>
Inkscape
</td>
</tr>
<tr>
<td>
Image Editing
</td>
<td>
Adobe Photoshop
</td>
<td>
Gimp
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span id="games" style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin5" onclick="manageMenu('menu5','spin5')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu5','spin5')">
Games
</span>
</span>
<div id="menu5" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Bike Chalange
</td>
<td>
</td>
<td>
MotorBike
</td>
</tr>
<tr>
<td>
First-person Shooter
</td>
<td>
Quake/Doom/Unreal
</td>
<td>
Sauerbraten Warsow Tremulous Nexuiz
</td>
</tr>
<tr>
<td>
Plateform runner
</td>
<td>
Mario
</td>
<td>
Secret Maryo Chronicles
</td>
</tr>
<tr>
<td>
Bunch of fun games
</td>
<td>
</td>
<td>
humble-indie-bundle
</td>
</tr>
<tr>
<td>
Bunch of awesome games
</td>
<td>
</td>
<td>
Steam for Linux
</td>
</tr>
<tr>
<td>
Strategy game
</td>
<td>
</td>
<td>
Conquest
</td>
</tr>
<tr>
<td>
Puzzle game
</td>
<td>
</td>
<td>
Clockwork Man
</td>
</tr>
<tr>
<td>
Physics based puzzle
</td>
<td>
</td>
<td>
World of Goo
</td>
</tr>
<tr>
<td>
Story with puzzles
</td>
<td>
</td>
<td>
Machinarium
</td>
</tr>
<tr>
<td>
Space military(Online)
</td>
<td>
</td>
<td>
Vendetta Online
</td>
</tr>
<tr>
<td>
First Person Shooter
</td>
<td>
Doom
</td>
<td>
Prey
</td>
</tr>
<tr>
<td>
First person shooter
</td>
<td>
</td>
<td>
Enemy Territory Quake Wars (ETQW)
</td>
</tr>
<tr>
<td>
Real time strategy
</td>
<td>
</td>
<td>
Oil Rush
</td>
</tr>
<tr>
<td>
Flight simulator
</td>
<td>
</td>
<td>
FlightGear
</td>
</tr>
<tr>
<td>
Online role playing
</td>
<td>
</td>
<td>
Wakfu
</td>
</tr>
<tr>
<td>
Survival horror
</td>
<td>
</td>
<td>
Amnesia series
</td>
</tr>
<tr>
<td>
indie game
</td>
<td>
</td>
<td>
Minecraft
</td>
</tr>
<tr>
<td>
Turn-based artillery game
</td>
<td>
Worms
</td>
<td>
Wormux
</td>
</tr>
<tr>
<td>
Strategy games
</td>
<td>
Civilization/Age of empires
</td>
<td>
FreeCiv/FreeCol
</td>
</tr>
<tr>
<td>
Real time Strategy games
</td>
<td>
</td>
<td>
0 A.D.
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin6" onclick="manageMenu('menu6','spin6')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu6','spin6')">
Multimedia
</span>
</span>
<div id="menu6" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Video player
</td>
<td>
</td>
<td>
Vlc
</td>
</tr>
<tr>
<td>
3D Animation
</td>
<td>
Maya
</td>
<td>
Blender/Wings 3D
</td>
</tr>
<tr>
<td>
Video editor
</td>
<td>
Movie Maker
</td>
<td>
OpenShot
</td>
</tr>
<tr>
<td>
DVD Rip
</td>
<td>
</td>
<td>
Handbrake
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin7" onclick="manageMenu('menu7','spin7')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu7','spin7')">
Audio
</span>
</span>
<div id="menu7" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Audio Editing
</td>
<td>
Adobe Audition
</td>
<td>
Audacity
</td>
</tr>
<tr>
<td>
MP3 Ripper
</td>
<td>
Exact Audio Copy
</td>
<td>
CDex
</td>
</tr>
<tr>
<td>
Audio Player
</td>
<td>
Winamp
</td>
<td>
Audacious/Nightingale
</td>
</tr>
<tr>
<td>
Audio Player
</td>
<td>
Winamp
</td>
<td>
Banshee/Nuvola/Clementine
</td>
</tr>
<tr>
<td>
Audio Mixer
</td>
<td>
Virtual DJ
</td>
<td>
Mixxx
</td>
</tr>
<tr>
<td>
MP3 Ripper
</td>
<td>
Exact Audio Copy
</td>
<td>
CDex
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin8" onclick="manageMenu('menu8','spin8')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu8','spin8')">
Engineering
</span>
</span>
<div id="menu8" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Numerical Processor,Matlab
</td>
<td>
Scilab
</td>
<td>
Octave
</td>
</tr>
<tr>
<td>
Programming IDE
</td>
<td>
</td>
<td>
Aptana/Eclipse
</td>
</tr>
<tr>
<td>
Planetarium
</td>
<td>
Starry Night
</td>
<td>
Stellarium
</td>
</tr>
<tr>
<td>
Typing Tutor
</td>
<td>
Typing Master
</td>
<td>
Tux Typing
</td>
</tr>
<tr>
<td>
Web server
</td>
<td>
ISS
</td>
<td>
Apache
</td>
</tr>
<tr>
<td>
Text Editor
</td>
<td>
</td>
<td>
Vim
</td>
</tr>
<tr>
<td>
Private Telephone exchange
</td>
<td>
</td>
<td>
asterisk
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin9" onclick="manageMenu('menu9','spin9')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu9','spin9')">
Financial
</span>
</span>
<div id="menu9" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Personal Accounting
</td>
<td>
Microsoft Money
</td>
<td>
HomeBank
</td>
</tr>
<tr>
<td>
Small Business Accounting
</td>
<td>
</td>
<td>
GnuCash
</td>
</tr>
</tbody>
</table>
</div>
<div><br></div>
<span style="display:block;">
<image src="https://dl.dropboxusercontent.com/s/67r23hp1glxiiuc/pointericon.png" alt="picture" id="spin10" onclick="manageMenu('menu10','spin10')" style="border-style:none;-webkit-box-shadow: none;-moz-box-shadow: none;box-shadow: none;background-color:transparent;"/>
<span id="headers" onclick="manageMenu('menu10','spin10')">
Utility
</span>
</span>
<div id="menu10" style="display:block">
<table id="background-image" summary="Software List">
<thead>
<tr>
<th scope="col">
Usage
</th>
<th scope="col">
Compare To
</th>
<th scope="col">
Software
</th>
</tr>
</thead>
<tbody>
<tr>
<td>
Running windows applications
</td>
<td>
</td>
<td>
Wine
</td>
</tr>
<tr>
<td>
Tweak the interface
</td>
<td>
</td>
<td>
Ubuntu-Tweak
</td>
</tr>
<tr>
<td>
Virtual PC emulator
</td>
<td>
Virtual PC
</td>
<td>
VirtualBox
</td>
</tr>
<tr>
<td>
Tweaking gui interface
</td>
<td>
</td>
<td>
Unity Tweak Tool
</td>
</tr>
<tr>
<td>
Live cd/USB maker
</td>
<td>
</td>
<td>
Unetbootin
</td>
</tr>
<tr>
<td>
File/Directory compare
</td>
<td>
</td>
<td>
Meld
</td>
</tr>
<tr>
<td>
Firewall
</td>
<td>
windows Firewall
</td>
<td>
GUFW
</td>
</tr>
<tr>
<td>
Recovery Tool
</td>
<td>
</td>
<td>
Mondorescue/safecopy
</td>
</tr>
<tr>
<td>
Backup
</td>
<td>
</td>
<td>
CrashPlan/rsync
</td>
</tr>
<tr>
<td>
File encryption
</td>
<td>
</td>
<td>
TrueCrypt
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div><br></div>
Leave a comment with any software you think should be On this list.Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-77613744948136427932013-08-04T22:39:00.002-07:002013-08-04T22:40:08.728-07:00Fix for identifier of an instance of was altered from [parameters... = values...] to null<div dir="ltr" style="text-align: left;" trbidi="on">
Recently while using hibernate with java and Mysql i got this error.<br />
<br />
java.lang.RuntimeException: identifier of an instance of <class> was altered from PrimaryKeyClass [parameters... = values...] to null<br />
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)<br />
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)<br />
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)<br />
at java.lang.reflect.Method.invoke(Method.java:597)<br />
<br />
The error was simple to resolve but time taking to figure out.<br />
<br />
The mistake that i made was in the setter for the primary key.<br />
<br />
I had the code as :<br />
<br />
private void setPk(Pk pk)<br />
{<br />
pk = pk;<br />
}<br />
<br />
While the correct code should be :<br />
<br />
private void setPk(Pk pk)<br />
{<br />
this.pk = pk;<br />
}<br />
<br />
so if you get a error like this don't forget to take a closer look at the setters too.</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-65710999394737618062013-06-07T11:24:00.000-07:002013-11-13T00:09:30.887-08:00Configuring JAD decompiler and jadclipse for Eclipse in Ubuntu 13.04 / Linux<div dir="ltr" style="text-align: left;" trbidi="on">
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
<span style="font-size: 15px; font-weight: normal; line-height: 24px;">How to setup Jad and Jadclipse for Eclipse on a Linux machine. </span></h2>
<h2 style="border: 0px; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; font-weight: normal; line-height: 24px;">Personally i have had problems with this setup many times in the past So i have put together this guidelines to do the setup in a hassle free manner.</span></span></h2>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
<span style="font-size: 15px; font-weight: normal; line-height: 24px;">Though this guidelines have been tested only on Ubuntu 13.04 and 12.04. They should work on generally any Linux machine.</span></h2>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
<span style="font-size: 15px; font-weight: normal; line-height: 24px;">Now i am assuming you have eclipse Installed. If not please install that first.</span></h2>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 1</h2>
<div style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px; padding: 0px 0px 20px; vertical-align: baseline;">
Download jad from this location <a href="http://www.varaneckas.com/jad/">JAD Java Decompiler Download Mirror</a> and extract the file.<br />
<br />
<br />
<ul>
<li>Download the Linux version
Jad 1.5.8e for Linux on Intel platform [For me this didn't work]</li>
<li>Jad 1.5.8e for Linux (statically linked) So i downloaded this one. </li>
<li>[don't worry about it being 32Bit/64bit.]</li>
</ul>
</div>
<div style="border: 0px; padding: 0px 0px 20px; vertical-align: baseline;">
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 2</h2>
<div style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
Testing that Jad is working. [Optional but Recommended] </div>
<div style="font-size: 15px;">
<br /></div>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>Arrange for any .class file. It ok to either make one by yourself.</li>
<li>Or copy any eclipse path/plugins/*.jar file and extract it and you will find many .class there.</li>
<li>put the class file in the jad folder</li>
<li>Then go to the folder </li>
</ul>
<div style="font-size: 15px;">
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;"><code> cd jad158e.linux.static/ </code></span></div>
<div style="font-size: 15px;">
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;"><code><br /></code></span>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;"><code> ./jad <class file name></code></span></div>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>A .jad file should have gotten created as classFileName.jad.</li>
<li>[If not please post a comment i will try to help you out]</li>
</ul>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 3</h2>
<div>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>Move the extracted jad folder to a proper location. I recoment /opt/</li>
</ul>
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; line-height: 24px;"><code> sudo mv ~/Downloads/jad158e.linux.static /opt/</code></span></span>
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; line-height: 24px;"><code><br /></code></span></span>
<br />
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 4 [install jadclipse]</h2>
</div>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>Download jadclipse from <a href="http://sourceforge.net/projects/jadclipse/">http://sourceforge.net/projects/jadclipse/</a></li>
<li>copy it to you eclipse/plugins directory. </li>
</ul>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><code> </code></span><span style="color: #777777; font-family: monospace;"><span style="font-size: 15px; line-height: 24px;">sudo mv </span></span><span style="color: #777777; font-family: monospace; font-size: 15px; line-height: 24px;">~/Downloads/</span><span style="color: #777777; font-family: monospace; font-size: 15px; line-height: 24px;">net.sf.jadclipse_3.3.0.jar /opt/eclipse/plugins/net.sf.jadclipse_3.3.0.jar</span><br />
<div>
<br /></div>
<div>
<br />
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 5</h2>
</div>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>Change working directory to eclipse directory. Mine is </li>
</ul>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><code> cd /opt/eclipse </code></span><br />
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><code> </code></span><br />
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><code> eclipse -clean
</code></span></div>
<div style="border: 0px; padding: 0px 0px 20px; vertical-align: baseline;">
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;">This should start eclipse </span></li>
</ul>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 6</h2>
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;">Go to Window -> Preferences
Select Java-> JadClipse </span></li>
<li><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; line-height: 24px;">set Path to de-compiler as </span></li>
</ul>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><code> /opt/jad158e.linux.static/jad </code></span></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFjD0AjWefRNL45aOzhlJZv_YcDgMHZinPuF9BenmGTgb2QYBB3h4-QkYxkztX6o7bPD44fH29b_Q4AildNqiggZI5_qFl9BR2M3wITwqlVqrPd_4gZVg8RUGKqRPmq6EreKbGOFfV2u7d/s1600/jad+settings.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiFjD0AjWefRNL45aOzhlJZv_YcDgMHZinPuF9BenmGTgb2QYBB3h4-QkYxkztX6o7bPD44fH29b_Q4AildNqiggZI5_qFl9BR2M3wITwqlVqrPd_4gZVg8RUGKqRPmq6EreKbGOFfV2u7d/s1600/jad+settings.png" height="515" width="640" /></a></div>
<div style="border: 0px; padding: 0px 0px 20px; vertical-align: baseline;">
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; line-height: 24px;"><br /></span></span>
<br />
<ul style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">[I renamed my folder for ease so its looking a little different in the screen shot] </span></li>
<li><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">Apply changes </span></li>
</ul>
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 7 [This is the most important step]</h2>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"></span><br />
<br />
<ul><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li> Select General->Editors ->File Associations </li>
</span></ul>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiToTr7VJ5mdRghRDsD7WM9htRocxmlEt9T9AJTRAR2RBZiVV5UCGJANHoanl78kyqpvdpKi2TLxXhBxl-HEfr6IHK0Ag1SpfxVTG6_pvnK7Z-CCQdS3JRfNA3u6QYO8aFVNgqwRnNTKEDd/s1600/jad+class+file+viewer+default.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiToTr7VJ5mdRghRDsD7WM9htRocxmlEt9T9AJTRAR2RBZiVV5UCGJANHoanl78kyqpvdpKi2TLxXhBxl-HEfr6IHK0Ag1SpfxVTG6_pvnK7Z-CCQdS3JRfNA3u6QYO8aFVNgqwRnNTKEDd/s1600/jad+class+file+viewer+default.png" height="358" width="640" /></a></div>
<ul><span style="font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li><span style="color: #777777;">Ensure that you have selected the "</span><span style="color: red;">*.class without sources</span><span style="color: #777777;">" in the upper box. This is where i make mistake most of the time.</span></li>
<li style="color: #777777;">Select class without source on the top box
Select "jadClipse Class File Viewer". </li>
<li><span style="color: #777777;">Set it as "</span><span style="color: red;">default</span><span style="color: #777777;">" viewer for class files without sources. This is also very important step. </span></li>
<li style="color: #777777;">Apply changes </li>
</span></ul>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
</span>
<br />
<h2 style="border: 0px; color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 1.3em; line-height: 1.4; margin: 26px 0px 12px; padding: 0px; vertical-align: baseline;">
Step 8</h2>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"></span><br />
<br />
<ul><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>Now close this window and open any java library file.</li>
</span></ul>
<br />
<div class="separator" style="clear: both; text-align: center;">
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; line-height: 24px;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwyn0sWVXE00BdHYXPgJHm8O-uUjj68Q-cA677BHbEQuAOTvFc0FQbjbim7zLP0WWuIV4oC8WltsNA8aXR6-7ZBn9CBZcKwSDUNpjCnNSdmefl2hIbVZf_z3S2jbc51L5i37vLC9f8q6QF/s1600/jad+working.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjwyn0sWVXE00BdHYXPgJHm8O-uUjj68Q-cA677BHbEQuAOTvFc0FQbjbim7zLP0WWuIV4oC8WltsNA8aXR6-7ZBn9CBZcKwSDUNpjCnNSdmefl2hIbVZf_z3S2jbc51L5i37vLC9f8q6QF/s1600/jad+working.png" height="356" width="640" /></a></span></span></div>
<span style="color: #777777; font-family: Droid Sans, arial, sans-serif;"><span style="font-size: 15px; line-height: 24px;">
</span></span><br />
<ul><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
<li>De-compiler should be working fine now. </li>
</span></ul>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
</span><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"></span>
<br />
<div style="border: 0px; padding: 0px 0px 20px; vertical-align: baseline;">
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;"><br /></span></span></div>
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">
Please leave comment, any Question below. I Will be happy to answer. </span></div>
<div style="border: 0px; padding: 0px 0px 20px; vertical-align: baseline;">
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">-- </span><br />
<span style="color: #777777; font-family: 'Droid Sans', arial, sans-serif; font-size: 15px; line-height: 24px;">Dasvidaniya </span></div>
<ol>
</ol>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com20tag:blogger.com,1999:blog-1796750639231272453.post-27628711608295338782013-05-08T11:58:00.000-07:002013-05-08T22:44:26.064-07:00Installing Google Chrome in Arch Linux/KDE while keeping it SimpleThe Actual process to get this done is very simple.<br />
<br />
Open address : <a href="https://aur.archlinux.org/packages/google-chrome/">https://aur.archlinux.org/packages/google-chrome/ </a><br />
<br />
in the right side you will find <span style="color: #222222; font-family: sans-serif; font-size: 1.15em; line-height: 1.4;">Package Actions</span><br />
<br />
Download tarball.<br />
<br />
Extract the tarball.<br />
<br />
Open this location on terminal (konsole).<br />
<br />
Type : makepkg<br />
<br />
<div style="text-align: justify;">
[ This command executes the file PKGBUILD, if you are interested in what it does then simply open the</div>
<div style="text-align: justify;">
file and look at the commands. They are simple to understand and you may run those commands directly</div>
<div style="text-align: justify;">
on the terminal doing the same process by yourself.]</div>
<div style="text-align: justify;">
<br /></div>
then<br />
<br />
as root : pacman -U google-chrome-stable....pkg.tar.xz<br />
<br />
[ makepkg command will build a .pkg.tar.xz file which may be used to install the software using the command written above.]<br />
<br />
or<br />
<br />
makepkg -i<br />
<br />
<br />
This should get your chrome installed.<br />
<br />Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com2tag:blogger.com,1999:blog-1796750639231272453.post-15073190885966237032013-04-25T12:47:00.000-07:002013-04-25T12:47:11.986-07:00keyboard is typing in numbers istead of character like u is typing 4 how to resolve ?Recently I faced this issue.<br />
<br />
Some keys on my keyboard were typing numbers.<br />
Like 'u' was typing 4 and 'i' was tying 5 instead.<br />
<br />
I assumed that Ubuntu has considered the function key is pushed down. And for some reason it has got locked in that position.<br />
<br />
The issue however was very simple .<br />
<br />
I had by mistake turned the 'NumLk' On.<br />
<br />
I disable the Key and the issue was resolved.<br />
<br />
--<br />
<br />Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-63965378561323374852013-04-25T12:38:00.002-07:002013-04-25T12:38:57.730-07:00Ubuntu 13.04 how to enable Multitouch gesture control on touchpadThis is fairly simple :<br />
<br />
Open Dash and Type 'Mouse'<br />
<br />
Open 'Mouse and Touch-pad'<br />
<br />
Selection the option 'Two finger scroll'.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivqJZNEayRPrF8B_ZLc5rCKzr4ZYdqfC16j2gmvi4571YgD_snJrRUq6l_GCNX0XKThgLU2NFom7sVzZuwE1EzJ1t8FFDXkg0Dm2Z3JehNwiP39pfdGZRtIZ0p_1t8Pf-KCpJSWHOdOXR-/s1600/ubuntu+multi+touch+.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEivqJZNEayRPrF8B_ZLc5rCKzr4ZYdqfC16j2gmvi4571YgD_snJrRUq6l_GCNX0XKThgLU2NFom7sVzZuwE1EzJ1t8FFDXkg0Dm2Z3JehNwiP39pfdGZRtIZ0p_1t8Pf-KCpJSWHOdOXR-/s1600/ubuntu+multi+touch+.png" height="362" width="640" /></a></div>
<br />
Go ahead and try it out.<br /><br />--<br />
CheersVikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-29070444756806298612013-04-06T12:19:00.001-07:002013-04-08T05:36:54.558-07:00Linux and Ubuntu have caught up to windows and are soon going to leave Microsoft behind<div style="text-align: justify;">
I am in love with Ubuntu and GNU/Linux. I have been using it for years now and i am far from being fully satisfied with its performance. But at the same time, i am happier than i have been ever before.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
</div>
<a href="http://t2.gstatic.com/images?q=tbn:ANd9GcRV2ylbFCEdFCCf-0cFtUO0tohNQR9CAcIYB0ntDwYBq5YlnysT" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://t2.gstatic.com/images?q=tbn:ANd9GcRV2ylbFCEdFCCf-0cFtUO0tohNQR9CAcIYB0ntDwYBq5YlnysT" height="200" width="200" /></a>Actually last year i bought a new laptop that shipped with Windows 7 Home Basic. I had no plans to use the basic edition. As we all know Microsoft purposefully slows down the Basic and starter editions so that they perform exceptionally slow. Microsoft charges a lot of money for this crappy edition and also if you wish to upgrade to a better edition you need to pay handsomely. So its kind of a trick to rip people off and to force them to buy extra expensive licenses.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So to save money and be able to play games and all i decided to buy the Universally-Rejected Widows 8 using the <a href="http://www.windowsupgradeoffer.com/">windows upgrade offer</a>. It's common knowledge today that windows 8 super awful.</div>
<div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
As of today's time I would say Linux distro's are way more advanced than Windows in many ways and is quickly catching up in the rest of the parameters.</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Trebuchet MS, sans-serif;">Here is one such case that i noticed recently:</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://1.bp.blogspot.com/Ud4XECvO5Gis--3epvYJoL7X574JMADpouSxB5xv5P4KDc28x2K8sZigBofrEbA0uww=w705" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="http://1.bp.blogspot.com/Ud4XECvO5Gis--3epvYJoL7X574JMADpouSxB5xv5P4KDc28x2K8sZigBofrEbA0uww=w705" height="156" width="320" /></a>Few days back i tried getting my laptop online with my HTC Android mobile. To achieve this i was required to download HTC sync software. Surely i could have used Wi-fi hot-spot, but i like the freedom of choosing between every possible option.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So i tried the same thing in My Ubuntu 12.10. And it worked brilliantly. No extra driver needed. Just i connected my HTC and selected USB tethering and 2 sec later i was online. This is Linux moving forward in terms of driver support.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
In 2008-2010 the scenario was reverse of this. We were forced to go to windows for hardware/driver support and in 2012 the situation has flipped. That's how far Ubuntu has come in 4 years. And widows has come from Windows 7 to Windows 8. Which is a steep fall.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Now the way i see it. In four years Ubuntu will be far far advanced in terms of what it will be capable of doing. And i am pretty sure Windows 9 is going to be awesome. But the rate at which Ubuntu and other Linux distro's are evolving It is soon going to become impossible for Microsoft to catch up.<br />
<br /></div>
<div style="text-align: justify;">
</div>
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">You might disagree with what i just said, but i have solid grounds to support my statement.</span><br />
<div style="text-align: justify;">
<br /></div>
<div>
<a href="http://upload.wikimedia.org/wikipedia/en/d/df/Encarta2008Premium.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em; text-align: justify;"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/d/df/Encarta2008Premium.png" height="190" width="320" /></a><br />
<div style="text-align: justify;">
You remember Microsoft prior 2000 Launched a super application called Encarta. It invested a lot of money for its development and paid a lot of professionals to write awesome articles for it. I loved this application back then.</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div>
<a href="http://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em; text-align: justify;"><img border="0" src="http://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg" /></a><br />
<div style="text-align: justify;">
This was all propitiatory and controlled by Microsoft so it had a good run in the beginning. And then came the super awesome Wikipedia and BOOM!.</div>
</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
How did it catch up so fast? How could it take over such an awesome application and today in just 10 years time people don't even remember Encarta that awesome app is trash.<br />
<br />
Well this happened mainly because Wikipedia is free and open source and people are self motivated to contribute to it. Money can only take you to a certain level but if you want to go further you need passion. And the passion involved in this things development is great. People love it. From students to kids to teachers to professionals. It adds to our life our freedom our choice. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
End of the day its things like this that define us humans contributions to the world. It feels great to be a part of a community that you can say is your's. It's not someone else's decisions from inside a board room meeting. It's ours. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This is why Linux is growing both in force and mass and is gaining momentum. You may argue that Linus controls Linux development and Mark control which direction Ubuntu head's. That is true. But there is a major difference, these people take decisions with the community for the community and not for controlling the community.</div>
<div style="text-align: justify;">
<br />
<br /></div>
<div style="text-align: justify;">
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">Here is another reason that favors Ubuntu greatly:</span></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Windows has a major release in about every 4 years. Now every alternate major release has been awesome till date. But all the even releases have sucked greatly. And there is a reason for that. In 4-5 years of time technology advances greatly and Graphics and hardware all grow up in major ways. So a OS has to catch up to those changes.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<a href="http://t0.gstatic.com/images?q=tbn:ANd9GcRJX8PR6alto-L9Y3IdGcvHgsSKcvOrtxQydnMTJY97rFeXp4kgLA" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://t0.gstatic.com/images?q=tbn:ANd9GcRJX8PR6alto-L9Y3IdGcvHgsSKcvOrtxQydnMTJY97rFeXp4kgLA" height="173" width="200" /></a>Same thing happened in between windows xp and Vista. Vista had major graphic changes. In fact the entire graphic system was moved from Pixel to <a href="http://en.wikipedia.org/wiki/Vector_graphics">Vector Graphics</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
What this kind of change need is a change in the core infrastructure. This causes the system to become much more bug prone and for a propitiatory software the 4 years development cycle is simply not enough for all the testing that it needs. Hence the system only properly evolves after 8 years. 2 Version releases.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But the same thing is not true for Ubuntu. Ubuntu's release cycle is 2 times a year. Mostly any new version that comes out does not have too much change between 1 version to the next. It does have a lot of bug fixes and major upgrades in drivers though.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I personally have notices that when i installed Ubuntu 12.04 soon after it was released. I notices lots of issues. But as i kept on updating the system (unlike what i do in windows) I notices those issues getting resolved with subsequent updates. Many gesture support that i was expecting it to have, came within weeks.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Also for any major changes Ubuntu makes you can chose to simple reject them. For example i didn't switch to Unity when it came out at first. I continued using Gnome. Even when they removed Gnome Interface in the default installation, i downloaded its package and continued using it. But since 12.04 i found unity to be better suited and growing faster than Gnome so i switched. This freedom is what makes Linux systems so great to use. I chose what i want to run on my system.</div>
<div style="text-align: justify;">
<br />
<a href="http://upload.wikimedia.org/wikipedia/commons/2/2c/Ubuntu-smartphone.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="http://upload.wikimedia.org/wikipedia/commons/2/2c/Ubuntu-smartphone.png" height="200" width="103" /></a>These are just a couple of major reasons out of the countless reasons why Linux is catching up so fast in the desktop environment and once <a href="http://vi3k6i5.blogspot.com/2013/03/why-we-are-so-excited-about-Ubuntu-Touch.html">Ubuntu Touch comes</a> out we will have more Linux share in Tablet market then ever before.<br />
<br />
<br /></div>
<div style="text-align: justify;">
Freedom is in the DNA of all living creatures and we are on all days attracted towards it. So we will push for things that add to our freedom.</div>
<div style="text-align: justify;">
<br />
PS: If you don't believe in the title just look around you and notice one thing: Android (Linux) caught up to I-OS ages ago. And what we are seeing now is a failing I-OS which is far less-featured in comparison to Android.<br />
<br /></div>
<div style="text-align: justify;">
---</div>
<div style="text-align: justify;">
Game on.</div>
<div style="text-align: justify;">
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com3tag:blogger.com,1999:blog-1796750639231272453.post-52345937864050609802013-03-11T07:32:00.000-07:002013-03-11T07:57:27.419-07:00Why we are So excited about the Ubuntu Touch<div style="text-align: justify;">
As a human being i can say i am hardwired for curiosity. Curiosity regarding anything that new or different from everything i have ever seen before. If it can offer something different than i would like to check it out. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
True that sometimes such curiosity burs and hurts. But that's the risk i decided to take when i was born.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
So Ubuntu bring it on, What have you got new to offer?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Well, quite a lot.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
1. <span style="color: #134f5c;">It's Interface</span>: </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
It's unique cos of its consistency across devices.<br />
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0k_d-Z3DUbIkYKmrqOtjbHoSHo86RLC0b9SPMGhJ4XDQJrRktePyQndaMydTtM1IbjWip5JzIFIW_QWWcvqd9PFcUAZyjKe9MGonHPW5gGW3i161OwcCsQbbHXbpbCcPbLY5c6MQsoMD_/s1600/ubuntu+devices-family.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0k_d-Z3DUbIkYKmrqOtjbHoSHo86RLC0b9SPMGhJ4XDQJrRktePyQndaMydTtM1IbjWip5JzIFIW_QWWcvqd9PFcUAZyjKe9MGonHPW5gGW3i161OwcCsQbbHXbpbCcPbLY5c6MQsoMD_/s1600/ubuntu+devices-family.png" height="171" width="400" /></a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
This facility is currently nowhere. Widows in the Past has drastically failed at trying this same thing and currently is failing again. Whereas Canonical with Ubuntu and Unity has found a way to make it work. Which is awesome :)<br />
<br />
The possibilities with this is simply limitless.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
2. <span style="color: #134f5c;">Open Source and Free</span>:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Being Entirely open source Ubuntu Touch OS has a lot of advantage. It has a wide community of developers.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
It's more free than Android. How?</div>
<div style="text-align: justify;">
Well Devices can use and run Android OS for free. Where as using Android play-store requires a license agreement for OEM. And software up-loaders need to pay a fee of 25$ to Google to upload there apps. Whereas Ubuntu has this same service for free.</div>
<div style="text-align: justify;">
I agree that Android play store has 800,000+ apps and catching up to that for Ubuntu will be tough. But developer world is growing and if Important and high performance apps get ported to Ubuntu Store then developers can be made to use Ubuntu devices and once they come, more apps will definitely follow. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
3. <span style="color: #134f5c;">Power to User</span>:</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Android currently does not offer a lot of power to its users. Even in rooted mode there is only so much you can do. I agree that you can do a lot more with rooted android by creating a wide range of apps that would support more features. But the features supported with the Apps will only be the features provided currently by Android Operating System Infrastructure and API. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
With Ubuntu you can expect wider access for your applications. This will result in Apps with power matching the level of desktop Applications to come to phone and tablets. Already Ubuntu demonstrated the photo editor app that was capable of doing a lot more than an average app. And it says that them main Ubuntu desktop OS core technologies and Touch OS core technologies are the same. So basically all apps that may run on <a href="http://en.wikipedia.org/wiki/Ubuntu_Touch">desktop-Ubuntu can also run on Ubuntu-Phone</a>. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Android OS Apps runs on <a href="http://en.wikipedia.org/wiki/Dalvik_(software)">Dalvik</a> virtual machine but that's not going to be the case with Ubuntu touch OS. Ubuntu Apps wont run on a virtual machine making them faster and more powerful. So it wont be totally outlandish to expect the power difference like C and Java ( representing Ubuntu Touch and Android respectively).</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<div>
4. <span style="color: #134f5c;">Secure </span>:<br />
</div>
<div>
We all know Linux is more secure then any other system. And Ubuntu brings more Power of Linux In comparison to Android. Android though being Linux has limitations. It's kernel is based on Linux but modified a lot to suit the Android OS needs. It's apps run on a Virtual machine. Making its kernel more susceptible to bugs.</div>
<div>
<br /></div>
<div>
Ubuntu Touch OS kernel will be much closer to Ubuntu desktop OS kernel. So difference from Android Kernel but it will surely be major. Hence more security is expected. </div>
<div>
<br /></div>
<div>
<br /></div>
</div>
<div style="text-align: justify;">
<u><span style="color: #134f5c;">Possible Fail points :</span></u> Lack of GUI apps.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Ubuntu currently Does not have many GUI applications. Many of the major tasks we do is still based on terminal. I personally feel it would be awesome to be able to use terminal on my phone without rooting it. But i cant say the same for an average and most Digital device users.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
<div>
<div style="text-align: justify;">
<span style="color: #134f5c;"><u>Downside for Ubuntu:</u></span> Actually the downside is huge which people have simply chosen to ignore. </div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Ubuntu was and is a very flexible operating system. couple of years back it decided to change its UI and today we are mostly using Unity and loving it for all that it has to offer. But this change came with a massive opposition from its user community. Many disliked unity in its initial days and some dislike it even today.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But Canonical still went ahead with its decision to support Unity. And toady it's reaping off the benefit it has gotten from that decision.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Such decision are rare in Software Industries mainly because it requires massive change is all current applications to support the new Interface.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
But as i mentioned in the 1st point this is the core power of Ubuntu. How could this be a downside for Ubuntu and Canonical in future?</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Well simply because the more the device get entangled into one consistent UI-Ecosystem. The more the applications will evolve on that. The more stable they will become. And hence decisions like such we saw from Gnome to Unity will become more difficult to make. Canonical will be despised more by the Community and user base for any such decisions they make. Ultimately they may or may not be able to make such crucial 'keep moving forward' decisions.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And in future such decisions will be needed more often and more strongly. Such decisions are vital for maintaining market lead and keeping up with the latest and greatest technology and going forward with innovation.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
And any company (Nokia-Symbian, Microsoft with its resource hungry kernel) that does not take such decision in time suffer the consequences.<br />
<br />
<br />
Still Ubuntu is quite new in this domain and it's previous attempts have not been fruit full. But don't get disheartened. I am sure this time Ubuntu will pick up pace fast. And in a few Years the void in the Tablet Industry that is desperately asking for a Powerful tablet will be filled by Ubuntu running devices.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
I believe with Ubuntu Touch's power it should target the Tablet market like crazy and bring it down first.</div>
<div style="text-align: justify;">
<br />
--</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
May the force be with you.</div>
</div>
Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-74833942660212525682013-03-07T21:16:00.001-08:002013-03-07T22:00:26.897-08:00Why cant you simply download Android source code and install it on your phone?Ok, To begin with, this is a very basic and good question.<br />
<br />
Android as we know is open source. That means its source code is available some where on the internet, <a href="http://source.android.com/">Hosted</a> by Google. So it should not be a big deal to download the source code. Compile it using a compiler and install it on your phone.<br />
<br />
Well this is very much valid.<br />
<br />
You have the power to do this same thing with most of the other Open source software's available out there. So why not with android?<br />
<br />
And why is this not so easy ?<br />
<br />
Why can't i simply download the Jelly beans 4.2.2 and install it on my phone?<br />
<br />
Well for the following reasons :<br />
<br />
<a name='more'></a><br /><br />
<span style="color: #134f5c;">1</span>. Android is an OS. So what it has is a kernel and programs that manage and run on the kernel. But no where does it implicitly contains the Drivers to manage the bunch of hardware that your device has. Like GPS, Bluetooth, Display device, Audio, GMS antenna etc..<br />
<br />
And as all companies who make android devices may chose to buy these devices from different vendors. So all those devices may need different drivers.<br />
<br />
And android does not come packaged with all those drivers.<br />
<br />
<span style="color: #134f5c;">2</span>. But the current Android OS installed in your phone has those drivers in it. So it should just be a matter of pulling those drivers out and packaging the right drivers with the Android OS.<br />
<br />
Well this is closer to reality.<br />
<br />
The drivers and OS is compiled and assembled together with great amount of effort. It is extremely difficult to take out the OS from your phone and separate all the drivers from it. It will take a lot of effort and trying it would be waste if you are not interested such hacking.<br />
<br />
<span style="color: #134f5c;">3</span>. If you somehow manage to pull all these Drivers and the source code together then also there is one more limitation. The mobile device communication system is very sophisticated and you most probably cant arrange your own GSM tower and debug you devices working. All those debugging that your device manufacturer can perform as they are rich companies. So you wont be able to easily find bugs.<br />
<br />
<span style="color: #134f5c;">4</span>. If you find bugs. Fixing them would be very difficult because most probably the drivers will not be open source source code format. They will probably be in binary (machine executable) codes form. So you wont be able to make changes in them. :(<br />
<br />
If you manage to pull through these difficulties then also there is no guarantee that the device would work properly. All in all its no use trying it if you don't find such tasks interesting and love such near impossible challenges :)<br />
<br />
As the above mentioned steps are humanly possible so its natural to assume that a whole lot of people love to do these tasks and hence, Some geeks have already done it. They have built custom ROM's for many mobile devices. So its possible to get the latest build of Android for your phone. You have the option to download Custom built ROM'f from multiple sources and Install them on your phone :<br />
<br />
Sources like :<br />
<a href="http://www.xda-developers.com/">xda-developers have prepared custom ROM option for many android phones</a><br />
<br />
These people use device drivers they pull from multiple places and compile it with android source to prepare custom suited ROM's.<br />
<br />
They also have an Excellent piece on how Android ROM is built : <a href="http://xda-university.com/as-a-developer/introduction-how-an-android-rom-is-built">Putting a ROM together</a><br />
Please note that such ROM's may be buggy.<br />
<br />
--<br />
I Love Open Source :)Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com1tag:blogger.com,1999:blog-1796750639231272453.post-80449248628505331342013-03-07T02:31:00.000-08:002013-03-07T22:01:09.033-08:00Is Google+ running slow on Google chromeFor me Yes. <br />
<br />
My Google+ has been very slow on Google Chrome for quite some time now. When i try the Explore option it scrolls like a snail moving up on a tree for me. And quite recently (Today) it became unbearable. So i decided i have to do something about it. Hence i Goggled it. <br />
<br />
Found a couple of good solutions and tried them all.<br />
<br />
<u><span style="color: #134f5c;">Here is solution #1:</span></u><br />
<a name='more'></a><u><br /></u><br />
Open a new tab in Chrome and go to : chrome://plugins/<br />
<br />
And disable the heck out of the plugins. <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7XsfRuFosVQsZWk8udAClyKNKZDs7jEG-KNGvEQSEEjDK5LYF-oDGaTDxUAUD305uRbcJjE6TrR4P6lmmy3uKhPWEHwHzpkgwdNztmxu3uwbv47vARkWfUvyulZghgPxOa3KgtvPHxkY3/s1600/disable+plugins.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7XsfRuFosVQsZWk8udAClyKNKZDs7jEG-KNGvEQSEEjDK5LYF-oDGaTDxUAUD305uRbcJjE6TrR4P6lmmy3uKhPWEHwHzpkgwdNztmxu3uwbv47vARkWfUvyulZghgPxOa3KgtvPHxkY3/s1600/disable+plugins.png" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi7XsfRuFosVQsZWk8udAClyKNKZDs7jEG-KNGvEQSEEjDK5LYF-oDGaTDxUAUD305uRbcJjE6TrR4P6lmmy3uKhPWEHwHzpkgwdNztmxu3uwbv47vARkWfUvyulZghgPxOa3KgtvPHxkY3/s1600/disable+plugins.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
As you can see i disabled almost all plugins i can continue live without 'After Earth'. Didn't help 1 bit.<br />
<br />
<span style="color: #134f5c;"><u><span style="font-size: small;"><span style="font-family: Georgia,"Times New Roman",serif;">So i moved on to solution #2:</span></span></u></span><br />
<br />
Open a new tab in Chrome and go to : chrome://flags/<br />
<br />
And was greeted with this warning : <br />
<br />
<blockquote class="tr_bq">
<div id="header" style="-webkit-padding-start: 75px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-image: -webkit-image-set(url(data:image/png; background-position: 0% 50%; background-repeat: no-repeat no-repeat; box-sizing: border-box; color: black; data: image/png; display: table; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; margin-bottom: 1.05em; min-height: 67px; orphans: auto; overflow: hidden; position: relative; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<div id="title-spacer" style="display: table-cell; vertical-align: middle;">
<h1 style="font-size: 19px; font-weight: bold; margin: 0px; padding: 0px;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnZt7j7u6w6mj9YmaazqnAwYvM9JM_6BjHvRheb9pKg5DGOS1KSmtc_ZodbySJi0212aWSYgXgj04OkmTod_tZkorFnVEXv3eMiqxJMrpYPuhUnev3YoI45ElxPM9sOnep3bRuog7IcbW-/s1600/nu.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnZt7j7u6w6mj9YmaazqnAwYvM9JM_6BjHvRheb9pKg5DGOS1KSmtc_ZodbySJi0212aWSYgXgj04OkmTod_tZkorFnVEXv3eMiqxJMrpYPuhUnev3YoI45ElxPM9sOnep3bRuog7IcbW-/s1600/nu.png" /></a>
Careful, these experiments may bite</h1>
</div>
</div>
</blockquote>
<div id="blurb-container" style="-webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; color: black; font-family: 'Segoe UI', Tahoma, sans-serif; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; padding-bottom: 1.5em; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px;">
<blockquote class="tr_bq">
<span id="blurb-warning" style="color: red; font-weight: bold;">WARNING</span><span class="Apple-converted-space"> </span>These experimental features may change, break, or disappear at any time. We make absolutely no guarantees about what may happen if you turn one of these experiments on, and your browser may even spontaneously combust. Jokes aside, your browser may delete all your data, or your security and privacy could be compromised in unexpected ways. Any experiments you enable will be enabled for all users of this browser. Please proceed with caution.</blockquote>
<br /></div>
It contained a serious text "Jokes aside". OMG! this is serious stuff..<br />
So i was wondering what to do with it. After some careful consideration i decided to ignore it.<br />
<br />
I went ahead and i tried these 2 things one by one. I had to restarted my browser a couple of times for this.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq9L6SdCKnUezxZFZPVHZg6RLCppJF0Mm0rKJ5PuNWvqcgfBkDzQVpS0djO9iXrPvyeZmEjRgCgUjQOzjhH96Jhd7XsIqX3TqGFb3JYllO3Ehg0igLhnyuZ9J7IlBopRE8FS-IPc7KdDGq/s1600/disable+flags.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjq9L6SdCKnUezxZFZPVHZg6RLCppJF0Mm0rKJ5PuNWvqcgfBkDzQVpS0djO9iXrPvyeZmEjRgCgUjQOzjhH96Jhd7XsIqX3TqGFb3JYllO3Ehg0igLhnyuZ9J7IlBopRE8FS-IPc7KdDGq/s1600/disable+flags.png" /></a></div>
<br />
This actually worked a lot better than the default state. The source of this solution which i have mentioned below was scrolling much faster for me after this.<br />
<br />
Credits: <a href="https://plus.google.com/103390551025989171727/posts/TUbKACQiMhs">Here is Stormy Henderson post where i found this solution</a><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgb5LudDlqQxZKB_Es-SKVZOCYNI3XzB4-hzbLIDpVCDcbIt1oRnCdiYuh0aFye56iLGar1VpDiVW6KmKczRp75KfQplBVxBXG77EzgqWVAb53xDAcxuLhwwceRRhpxKxbyp5fYKhUQ8OUX/s1600/chrome-logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgSsBi5jqjFmQcMhiUuWuiXIRQlSJBTKcENgAErmZjLsMtOh-l_shDaKjPHzFJMoS5n5jdYI6qxbeIzOrOrItyLpZoMx9OQk6KfYnh-mtrCjwZl7qj0X0Lswzuw-jzHysHkN9eYD_DCt3dD/s1600/chrome+using+a+lot+of+resource.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><br /></a></div>
<br />
But even this didn't improve the situation in Google+ Explore much so finally i took the 3rd solution provided as a hidden solution in the post mentioned above.<br />
<br />
<span style="color: #134f5c;"><u>"Moving on" to solution #3:</u></span><br />
<br />
I changed my web Browser.<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpf5dEPqJwQmi0XXllDQuKv2TEMucFFNXMiK9UUWd6HMawnTQYvpepLjFCyp_IFx2_ii2BagIg3wVAm1bDXvH92peL839jgu5FyFk3cqP1zWwWwUUSZQ3ZMDBG8inxgv-mJJlbWMgy8eQT/s1600/Firefox.png" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgpf5dEPqJwQmi0XXllDQuKv2TEMucFFNXMiK9UUWd6HMawnTQYvpepLjFCyp_IFx2_ii2BagIg3wVAm1bDXvH92peL839jgu5FyFk3cqP1zWwWwUUSZQ3ZMDBG8inxgv-mJJlbWMgy8eQT/s1600/Firefox.png" height="320" width="320" /></a><br />
And the truth : "My Google+ Explore is moving like knife on butter paper".<br />
<br />
OK its not the complete truth. But i bet you its working much much faster in comparision to Google Chrome. <br />
I am not planning on switching to Firefox full time. I will be back to chrome once they have a fix for this problem.<br />
<br />
But lately they have been pretty rough on Resources.
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUmOwINJ8VCL__uiI1v5YYprBLpQfS4iaGJ3hT1ji2cUtm9vUJdj1vMDLdMhEaAFFQ45KGJDGNTta9sYT5VBuXdn8iVysXxYQRDEZzgG1-3rFdSpy5HmiAQLHFUKnEp4uSlWm76HtoM8cI/s1600/chrome+using+a+lot+of+resource.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhUmOwINJ8VCL__uiI1v5YYprBLpQfS4iaGJ3hT1ji2cUtm9vUJdj1vMDLdMhEaAFFQ45KGJDGNTta9sYT5VBuXdn8iVysXxYQRDEZzgG1-3rFdSpy5HmiAQLHFUKnEp4uSlWm76HtoM8cI/s1600/chrome+using+a+lot+of+resource.png" /></a></div>
<br />
All major tabs in Google Chrome take over 50Mb's of space Which is quite a lot: if you have like 10 Google+ tabs you are down by Half a GB of Space.<br />
<br />
I don't know how exactly Google Chrome manages storage but if its all in RAM or even partially in Virtual memory or swap space then also its a lot of memory and that is bound to slow down the system over time. <br />
<br />
I have observed that if i leave a Chrome tab open over night it degrades the System perforamnce so badly that i am forced to restart my system in the morning :(<br />
<br />
Hoping all this will be fixed soon, Or i recieve a Chrom book Pixel as a gift from someone. Either will do for me ;)<br />
<br />
-- <br />
cheers Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com0tag:blogger.com,1999:blog-1796750639231272453.post-73148260341250480062013-03-04T02:55:00.000-08:002013-03-07T22:01:19.085-08:00Linux and VirusesMany people believe that Linux is immune to virus. However it's not true.<br />
<br />
What is true though is that there are far fewer number of virus for Linux in comparison to windows.<br />
<br />
Now why is that so?<br />
<br />
Well for very simple reasons, And I will try to list them here:<br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">1. All system related critical files and folders are well Protected under Linux:-</span><br />
<a name='more'></a><br />
<br />
What this means is that the important folders in Linux that have system software's (folders similar to System32 and Windows of 'MS OS') and other important file are by default readable to user but not modifiable. They may execute the files but not change them. The root user may change this though.<br />
<br />
So what changes because of this. Well simply speaking, if a virus or malware<span style="color: #333333; font-family: Arial, Helvetica, sans-serif;"><span style="font-size: 12px; line-height: 18px;"><i> </i></span></span>try to copy a file (virus) to such folders it wont be able to. you will explicitly have to provide it access by putting root user password. So if user is aware that he is installing a good program then this will protect his computer well.<br />
<br />
System files are Gold mine for virus and they are not accessible to them by default in Linux.<br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">2. Linux has a separate attributes that control if a program or a file may be executed or not. </span><br />
<br />
Linux has another layer of defense provided by the access controls. This 3 digit value tells if the user may read the file modify it or execute it. ( to read more Google chmod)<br />
<br />
This also helps Linux a lot. By default when a file is created or copied its execution bit is set to '0'. So by default its not executable. In Windows on the other hand All executable files '.exe' files can execute using an Autorun file. Hell in XP 'autorun.exe' used to run directly whenever you open the folder it resided in.<br />
<br />
This huge risk is not there in Linux.<br />
Credit: <a href="https://plus.google.com/u/0/102342595285863325267/posts/LgxsrM77Aog">G+ post on this point</a><br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">3. Users are categorized into Groups.</span><br />
<br />
Root user(Admin access [ Everything is possible in this world]). <br />
Then there is the owner of the file. Then his group. And lastly the public user group(the world).<br />
<br />
Also, you may create your own group and limit access to certain files or folders for your group.<br />
<br />
How this helps is that the user can change permission for certain files to be read and executed only by him and by no one else. or read and modified by his group by executed only by him. <br />
<br />
All this helps the user have control over who gets to access files and folders. so virus even when executed by a certain user may not have access to all files and only a certain set of files.<br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">4. '.Exe' files are not the default executable files in Linux</span><br />
<br />
Linux is mostly file extension independent. File extension by default are treated more as a name and not as a specifier to what the file may contain.<br />
<br />
So .exe which is the general extension for executable files on windows may be transferred to Linux system and it may not harm our Linux system at all. Where as in windows a simple double click on such file will cause it to execute.<br />
<br />
<span style="font-family: Helvetica Neue, Arial, Helvetica, sans-serif;">5. Linux system architecture is much different from Windows</span><br />
<br />
Moreover any Virus specifically written for Windows (which is the case for more than 75 % of the virus programs out there) wont work on Linux as the Linux system architecture and file system is much different from that of windows.<br />
<br />
--<br />
Even after all this, Antivirus Programs are available for Linux. Both open source and closed source. What they do in general is that they try and protect our Windows users from any Windows virus getting transferred from Linux system to windows system. As we might unknowingly copy a Windows Virus to a pen drive full of data and give it to our friends. The question that arise next will be " was this done unknowingly or ..."<br />
[Grinning]<br />
<br />
cheers Vikashhttp://www.blogger.com/profile/08240407133203296581noreply@blogger.com2