Installation of odoo-10 from source and to run it parallel with other versions

Step 1. Install git, eclipse and bzr

sudo apt-get install git-core
sudo apt-get install eclipse
sudo apt-get install bzr

Read More »

Advertisements

Using apktool to decompile android apk

Step 1. Install apktool
sudo apt install apktool

Step 2. Decompile apk file
apktool d -r -s FDroid.apk

Note:
d, –decompile    Decompile Code
-r,–no-res           Do not decode resources.
-s,–no-src           Do not decode sources.

If you also want to decompile resources and sources, then use
apktool d FDroid.apk

Python Running from Command line

To run Python on Unbutu Command line

run command
$ python2.7
or
$ python3.5
or simply
$ python

Note: The last one (python) command will start the default version…
You will see below screen
python3.5
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type “help”, “copyright”, “credits” or “license” for more information.
>>>
Enter Python Code directly
>>> print (“Write on Console”)
Write on Console

Running Python file from command line
Enter command
$ python2.7 myfile.py
or
$ python3.5 myfile.py
or simpy
$ python myfile.py

To get argument from command line
Enter command
$ python myfile.py arg1, arg2, arg3

and your code in file should look like;

import sys
print (sys.argv)
file_name = sys.argv[0]
num1 = int(sys.argv[1])
num2 = int(sys.argv[2])
sum = num1 + num2
print (str(num1) + " + " + str(num2) + " = " + str(sum))

Note: the first argument will always be the name of a file, to get arguments other than file, use >> sys.agrv[1:]
Note: All argument are sent as of string data type.

Arguments Handling

import sys
print ("All Args: " + str(sys.argv))
print ("File Name: " + sys.argv[0])
print ("Other Args: " + str(sys.argv[1:]))

Running Postgresql Queries from Linux Command’s Terminal

To Access Postgresql Interface, Enter command

$ psql db_name

You will be switched to shell below

psql (9.5.5)
Type “help” for help.

db_name=#

Now run your queries as:

Queries for Information Schemas
db_name=# select table_name from information_schema.tables;
db_name=# select table_name from information_schema.tables where table_name is like ‘%cms%’;
db_name=# select table_name from information_schema.columns where table_name = ‘res_users’;

Queries for User Defined Tables
db_name=# select name, father_name from cms_entryregis where id in (1,2,3,4,5);