RSS

Author Archives: vivekjib

About vivekjib

I'm a man with rules. But I like to break rules after accomplishing objective. I usually solve problems for coding. I like to gether new tech knowledge, new development, new tricks to do some funny hacking. Sometimes I feel good to play football. "If you do works without feeling its important, you will never get its true RESULT" --By Me

http-server in Ubuntu

http-server in Ubuntu

For ubuntu users, just install node.js and npm ( node.js package manager). Node.js is available in universe so no need to add any repo.

sudo apt-get install nodejs npm

After that install http-server globally

sudo npm install http-server -g

To start http-server of yours, just type

http-server

in your terminal.

 
Leave a comment

Posted by on January 24, 2017 in tech geak, Ubuntu

 

Tags: , ,

Android Studio : Upgrading Gradle and Its Plugin

Android Studio : Upgrading Gradle and Its Plugin

androidstudiohero

Hey there, you might have caught in error message in Android Studio. Here, it says

Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to “XXXX”

Here, it also stops working. This starts giving pain and delays your work. Tackling this is simple if you know how to do it. So, here we are ->

1. Upgrading Gradle

Go to gradle-wrapper.properties and change

distributionUrl=https\://services.gradle.org/distributions/gradle-2.12-bin.zip

Refer this link always before changing to get latest or which version you need. The change you need to perform is change underlined part only by the new one. So, this update may also need new plugin.

After this you must clean and rebuild the project.

2. Upgrading Gradle Plugin

Go to build.gradle and perform a change in

classpath ‘com.android.tools.build:gradle:2.1.0-alpha3

Refer this link to find out newest versions of Gradle plugin. Now change the underlined part as  you need them. After this you must clean and rebuild the project.

3. Solving the error without updating gradle and its plugin

You may need set an environment variable with the specified value. On OSX this looks as follows:

launchctl setenv ANDROID_DAILY_OVERRIDE <your-value-on-error-message>

Afterwards, clean the project, restart AS, and build again.

 

 
Leave a comment

Posted by on March 26, 2016 in Android, tech geak

 

Tags: , , , , , ,

How do I Create a Self-Signed Certificate for an Android App?

How do I Create a Self-Signed Certificate for an Android App?

Introduction

The Android release system requires that all applications installed on user devices are digitally signed with certificates whose private keys are held by the developer of the applications. The certificates allow the Android system to identify the author of an application and establish trust relationships between developers and their applications. The certificates are not used to control which applications the user can and cannot install.

Locating Keytool

Keytool is a key generation application that is made available through your Java SDK installation. You should be able to access the tool using a Terminal on your Mac or through the Command Prompt on your Windows machine.

The location of keytool is included in the directory search path on standard Mac installations but may have to be configured on Windows machines.

You can typically find the keytool application in the following or similar location under windows: C:\Program Files\Java\jdk1.6.0_24\bin\, if you followed the default installation process. You can either run keytool.exe from this location or add the relevant path to your search paths.

To add the path to your existing search paths, open your Control Panel and navigate to System and Security -> System -> Advanced system settings. This opens the System Properties window with the Advanced tab. Select Environment Variables… to open the Environment Variables window. Then select Path from the System variables panel and selectEdit… . This opens the Edit System Variable dialog in which you can add the new path to the existing list of search paths. Make sure that you separate each new path with a semicolon, as is shown in the figure of this step.

Creating the Key

media_1305634695518_display

Open your Terminal or Command Prompt and execute the command keytool. If the application is found, it is executed and a list of the available command line options is returned. This provides you with information on how you can configure the key generation process. The following example should allow you to generate an appropriate key:

keytool.exe -genkey -v -keystore release.keystore -alias TicTacToe -keyalg RSA -keysize 2048 -validity 10000

The application is interactive and command line driven, requesting that you enter a number of parameters. Do not worry if you make mistakes when entering parameters, you can enter them again.

Once you have created your key, it is stored in a .keystore file with its location shown at the end of the output, generated by the keytool. You should make a copy of your .keystore and keep it and the passwords in a safe place.

Note: -alias TicTacToe is specific to an application that is being signed to your application. You may want to change this to something that is more meaningful to the application you are working on.

Note: The Android website: http://developer.android.com/guide/publishing/app-signing.html has a lot of information and recommendations on how to create your private key. It is strongly recommended that you review that information in addition to what is covered in this lesson.

………………………………………………………………………………………………………….Source

 
Leave a comment

Posted by on March 2, 2016 in Android, tech geak

 

Tags: , , , ,

RAM a working table for all apps

RAM a working table for all apps

Think of the file system and its files as a big cabinet with lots of physical folders in an office of bureaucrats. The sheets in the folders are arranged in fixed ways such that every bureaucrat knows exactly where to expect which information before taking the folder out of the cabinet.

RAM

A RAM IN YOUR LAPTOP

Not let us assume that a bureaucrat (a program) performs a certain operation on a folder/file. It will take the folder to the desk, spread the sheets on the desk, cut certain things out, glue them together, paint marking son certain sheets, translates the text of a sheet to a new one, discards sheets entirely, add sheets, and do all kinds of crazy stuff on the data on the desk in the way that the bureaucrat wants it to do. After all that, the bureaucrat puts the relevant sheets nicely back into the folder such that everything is orderly, puts the folder back into the cabinet and then throw everything that is left on the desk back into the trash bin.

Note that the bureaucrat’s desk is the RAM in this analogy. Now how are things stored on the desk? Well, that depends on what precise step the bureaucrat performs at a time instant. Even more, different bureaucrats doing essentially the same task may do things in a different order. So we can’t really say anything about the organization of a bureaucrat’s/program’s desk/RAM other than whatever is put back into the cabinet/file system is put there orderly. In between, it is up to the bureaucrat how things are stored and in which encoding.

For most data in the RAM, the question how it is encoded does however make sense. However, this encoding can change frequently. For example, when a web browser receives text from a server, it may change the encoding multiple times before the data is actually displayed.


I hope that this analogy helps clearing things up. It has its limits, though, as in a computer, folders are not taken out of the cabinet, but they are rather copied and later overwritten, as this is cheaper in a computer than it is in real life. Also, because the memory sizes of the processes in a computer are not fixed, there is memory management going on, and one can say something about where memory allocation information is stored and how that information is encoded.

After knowing this  a new question arises about what is format of processing data in ram?

The format is whatever the program you are currently executing deems to be appropriate. Your question is like asking how things are arranged on a kitchen table – at every point in time, there is some kind of order, but how things are arranged depends so strongly on what someone is doing are doing at the moment and who is doing that so that no universal answer can be given.

…………Source

 
Leave a comment

Posted by on December 27, 2015 in tech geak, Uncategorized

 

Tags: , ,

Adding Your Project To Git By Command Line Interface

Add existing project to Github

 So, you have been working on a project locally and then decide you really should version control it and share it with the world. One option would be to create the repository on Github, clone it locally and then copy all the files across. But it does not have to be so messy. Here is how you add an existing project to Github without cloning it first.

Create git repo locally

We need to add a repository for your project. Git is a distributed version control system, so each machine has its own repository. This is different to centralised version control systems like Subversion, which have a single, central, repository.

Go to your project

$ cd my_project

Initialise the repository

$ git init

You should see the following message:

Initialized empty Git repository in /path/to/my_project/.git/

Add all your files to the repo:

$ git add *

Check to see that there are changes to be committed:

$ git status

You should see something like this:

# On branch master
#
# Initial commit
#
# Changes to be committed:
#   (use "git rm --cached <file>..." to unstage)
#
#   new file:   my_project.info
#   new file:   my_project.module
#

In this case, my_project.info and my_project.module are the files I have in my project.

Commit the files.

$ git commit -m "First commit"

You should see something like this:

[master (root-commit) 8201309] First commit
 2 files changed, 74 insertions(+), 0 deletions(-)
 create mode 100644 my_project.info
 create mode 100644 my_project.module

Now , you should go online and create a repository.There you will get repo link to copy.

Just copy it .

Add this as the remote origin:

 $ git remote add origin https://github.com/yourname/my_project.git

Pull from Github to local:

$ git pull origin master

And finally, push the code to Github:

$ git push origin master

You should see something like this:

Counting objects: 80, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (77/77), done.
Writing objects: 100% (80/80), 456.53 KiB | 0 bytes/s, done.
Total 80 (delta 4), reused 0 (delta 0)
To https://github.com/yourname/my_project.git
 ba2316b..3dae654  master -> master
 
Leave a comment

Posted by on October 1, 2015 in Uncategorized

 

Tags: , , ,

Kali Linux commands cheat sheet

All basic commands from A to Z in Kali Linux has been listed below.

A
apropos : Search Help manual pages (man -k)
apt-get : Search for and install software packages (Debian/Ubuntu)
aptitude : Search for and install software packages (Debian/Ubuntu)
aspell : Spell Checker
awk : Find and Replace text, database sort/validate/index
B
basename : Strip directory and suffix from filenames
bash : GNU Bourne-Again SHell
bc : Arbitrary precision calculator language
bg : Send to background
break : Exit from a loop
builtin : Run a shell builtin
bzip2 : Compress or decompress named file(s)
C
cal : Display a calendar
case : Conditionally perform a command
cat : Concatenate and print (display) the content of files
cd : Change Directory
cfdisk : Partition table manipulator for Linux
chgrp : Change group ownership
chmod : Change access permissions
chown : Change file owner and group
chroot : Run a command with a different root directory
chkconfig : System services (runlevel)
cksum : Print CRC checksum and byte counts
clear : Clear terminal screen
cmp : Compare two files
comm : Compare two sorted files line by line
command : Run a command – ignoring shell functions •
continue : Resume the next iteration of a loop •
cp : Copy one or more files to another location
cron : Daemon to execute scheduled commands
crontab : Schedule a command to run at a later time
csplit : Split a file into context-determined pieces
cut : Divide a file into several parts
D
date : Display or change the date & time
dc : Desk Calculator
dd : Convert and copy a file, write disk headers, boot records
ddrescue : Data recovery tool
declare : Declare variables and give them attributes •
df : Display free disk space
diff : Display the differences between two files
diff3 : Show differences among three files
dig : DNS lookup
dir : Briefly list directory contents
dircolors : Colour setup for `ls’
dirname : Convert a full pathname to just a path
dirs : Display list of remembered directories
dmesg : Print kernel & driver messages
du : Estimate file space usage
E
echo : Display message on screen •
egrep : Search file(s) for lines that match an extended expression
eject : Eject removable media
enable : Enable and disable builtin shell commands •
env : Environment variables
ethtool : Ethernet card settings
eval : Evaluate several commands/arguments
exec : Execute a command
exit : Exit the shell
expect : Automate arbitrary applications accessed over a terminal
expand : Convert tabs to spaces
export : Set an environment variable
expr : Evaluate expressions
F
false : Do nothing, unsuccessfully
fdformat : Low-level format a floppy disk
fdisk : Partition table manipulator for Linux
fg : Send job to foreground
fgrep : Search file(s) for lines that match a fixed string
file : Determine file type
find : Search for files that meet a desired criteria
fmt : Reformat paragraph text
fold : Wrap text to fit a specified width.
for : Expand words, and execute commands
format : Format disks or tapes
free : Display memory usage
fsck : File system consistency check and repair
ftp : File Transfer Protocol
function : Define Function Macros
fuser : Identify/kill the process that is accessing a file
G
gawk : Find and Replace text within file(s)
getopts : Parse positional parameters
grep : Search file(s) for lines that match a given pattern
groupadd : Add a user security group
groupdel : Delete a group
groupmod : Modify a group
groups : Print group names a user is in
gzip : Compress or decompress named file(s)
H
hash : Remember the full pathname of a name argument
head : Output the first part of file(s)
help : Display help for a built-in command
history : Command History
hostname : Print or set system name
I
iconv : Convert the character set of a file
id : Print user and group id’s
if : Conditionally perform a command
ifconfig : Configure a network interface
ifdown : Stop a network interface
ifup : Start a network interface up
import : Capture an X server screen and save the image to file
install : Copy files and set attributes
J
jobs : List active jobs
join : Join lines on a common field
K
kill : Stop a process from running
killall : Kill processes by name
L
less : Display output one screen at a time
let : Perform arithmetic on shell variables
ln : Create a symbolic link to a file
local : Create variables
locate : Find files
logname : Print current login name
logout : Exit a login shell
look : Display lines beginning with a given string
lpc : Line printer control program
lpr : Off line print
lprint : Print a file
lprintd : Abort a print job
lprintq : List the print queue
lprm : Remove jobs from the print queue
ls : List information about file(s)
lsof : List open files
M
make : Recompile a group of programs
man : Help manual
mkdir : Create new folder(s)
mkfifo : Make FIFOs (named pipes)
mkisofs : Create an hybrid ISO9660/JOLIET/HFS filesystem
mknod : Make block or character special files
more : Display output one screen at a time
mount : Mount a file system
mtools : Manipulate MS-DOS files
mtr : Network diagnostics (traceroute/ping)
mv : Move or rename files or directories
mmv : Mass Move and rename (files)
N
netstat : Networking information
nice Set : the priority of a command or job
nl Number : lines and write files
nohup : Run a command immune to hangups
notify-send : Send desktop notifications
nslookup : Query Internet name servers interactively
O
open : Open a file in its default application
op : Operator access
P
passwd : Modify a user password
paste : Merge lines of files
pathchk : Check file name portability
ping : Test a network connection
pkill : Stop processes from running
popd : Restore the previous value of the current directory
pr : Prepare files for printing
printcap : Printer capability database
printenv : Print environment variables
printf : Format and print data •
ps : Process status
pushd : Save and then change the current directory
pwd : Print Working Directory
Q
quota : Display disk usage and limits
quotacheck : Scan a file system for disk usage
quotactl : Set disk quotas
R
ram : ram disk device
rcp : Copy files between two machines
read : Read a line from standard input
readarray : Read from stdin into an array variable
readonly : Mark variables/functions as readonly
reboot : Reboot the system
rename : Rename files
renice : Alter priority of running processes
remsync : Synchronize remote files via email
return : Exit a shell function
rev : Reverse lines of a file
rm : Remove files
rmdir : Remove folder(s)
rsync : Remote file copy (Synchronize file trees)
S
screen : Multiplex terminal, run remote shells via ssh
scp : Secure copy (remote file copy)
sdiff : Merge two files interactively
sed : Stream Editor
select : Accept keyboard input
seq : Print numeric sequences
set: Manipulate shell variables and functions
sftp : Secure File Transfer Program
shift : Shift positional parameters
shopt : Shell Options
shutdown : Shutdown or restart linux
sleep : Delay for a specified time
slocate : Find files
sort : Sort text files
source : Run commands from a file `.’
split : Split a file into fixed-size pieces
ssh : Secure Shell client (remote login program)
strace : Trace system calls and signals
su : Substitute user identity
sudo : Execute a command as another user
sum : Print a checksum for a file
suspend : Suspend execution of this shell
symlink : Make a new name for a file
sync : Synchronize data on disk with memory
T
tail : Output the last part of file
tar : Tape ARchiver
tee : Redirect output to multiple files
test : Evaluate a conditional expression
time : Measure Program running time
times : User and system times
touch : Change file timestamps
top : List processes running on the system
traceroute : Trace Route to Host
trap : Run a command when a signal is set(bourne)
tr : Translate, squeeze, and/or delete characters
true : Do nothing, successfully
tsort : Topological sort
tty : Print filename of terminal on stdin
type : Describe a command
U
ulimit : Limit user resources
umask : Users file creation mask
umount : Unmount a device
unalias : Remove an alias
uname : Print system information
unexpand : Convert spaces to tabs
uniq : Uniquify files
units : Convert units from one scale to another
unset : Remove variable or function names
unshar : Unpack shell archive scripts
until : Execute commands (until error)
uptime : Show uptime
useradd : Create new user account
userdel : Delete a user account
usermod : Modify user account
users : List users currently logged in
uuencode : Encode a binary file
uudecode : Decode a file created by uuencode
V
v : Verbosely list directory contents (`ls -l -b’)
vdir : Verbosely list directory contents (`ls -l -b’)
vi : Text Editor
vmstat : Report virtual memory statistics
W
wait : Wait for a process to complete
watch : Execute/display a program periodically
wc : Print byte, word, and line counts
whereis : Search the user’s $path, man pages and source files for a program
which : Search the user’s $path for a program file
while : Execute commands
who : Print all usernames currently logged in
whoami : Print the current user id and name (`id -un’)
wget : Retrieve web pages or files via HTTP, HTTPS or FTP
write : Send a message to another user
x
xargs : Execute utility, passing constructed argument list(s)
xdg-open : Open a file or URL in the user’s preferred application.

 
Leave a comment

Posted by on August 28, 2015 in Uncategorized

 

How Java Differs From C And C++

Although Java was modeled after C and C++ languages, it differs from C and C++ in many ways. Java does not i a number of features available in C and C++. For the benefit of C and C++ programmers, we point out here a few major differences between C/C++ and Java language
How Java Differs From C:
Java and C
1.Java is not lot like C but the major difference between Java and C is that Java is and object-oriented language and has mechanism to define classes and objects. In an effort to build a simple and safe language, the Java team did not include some of the C features in Java.
2.Java does not include the C unique statement keywords sizeof, and
typedef.
3.Java does not contain the data type
struct and union.
4.Java does not define the type modifiers keywords
auto,extern,register,signed, and
unsigned.
5.Java does not support an explicit pointer type.
6.Java does not have a preprocessor and therefore we cannot use #
define, # include, and # ifdef statements.
7.Java requires that the functions with no arguments must be declared with empty parenthesis and not with the
void keyword as done in C.
8.Java adds new operators such as instanceof and >>>.
9.Java adds labelled break and
continue statements.
10.Java adds many features required for object-oriented programming.
How Java Differs From C++ :
Java and C++
Java is a true object-oriented language while C++ is basically C with object-oriented extension. That is what exactly the increment operator ++ indicates. C++ has maintained backward compatibility with C. Is is therefore possible to write an old style C program and run it successfully under C++. Java appears to be similar to C++ when we consider only the “extensions” part of C++. However, some object -oriented features of C++ make the C++ code extremely difficult to follow and maintain.

Listed below are some major C++ features that were intentionally omitted from java or significantly modified.
1.Java does not support operator overloading.
2.Java does not have template classes as in C++.
3.Java does not support multiple inheritance of classes. This is accomplished using a new feature called “Interface”.
4.Java does not support global variables. Every variable and method is declared within classes and forms part of that class.
5.Java does not use pointers.
6.Java has replaced the destructor function with a finalize() function.
7.There are no header files in Java.
8.Java also adds some new features. 9.While C++ is a superset of C, Java is neither a superset nor a subset of C or C++. Java may be considered as a first cousin of C++ and a second cousin of C.

So, you  got real overview on all of them.

 
Leave a comment

Posted by on August 18, 2015 in Uncategorized

 
 
%d bloggers like this: