Monday 19 December 2016

Writing on new indian currency notes makes the note invalid


File system not supported for USB. How to change file system type ?

how to change the format of the pendrive .

different file system types of the pendrive are
1. ext2
2. ext3
3. ext4
4. fat16
4. fat32
5. ntfs

if you are getting an error file format not supported then you need to change its file format.

steps to change the file format are :

1. install gparted
sudo apt-get install gparted
2. select you device
usually /dev/sdc for pendrive
3. delete the allocated memory
4. it shows memory as unallocated
5. right click on unalloted memory and select the file system type
6. click ok

your usb file type is changed







What is DBus

DBus is an inter-process communication (IPC) and remote procedure call (RPC) mechanism that allows communication between multiple computer programs (that is, processes) concurrently running on the same machine.
When there are multiple processes running on a system and each process requires to communicate with several other processes, Then multiple shared channels are required.Establishing an one-to-one shared channel is inefficient.D-Bus provides the communication between several processes by using a single shared channel.
A process can connect to any number of busses if it has an authoried access to it.D-Bus can also be used as a framework. The other implementations of D-Bus are GDBus, QtDBus, dbus-java, sd-bus.

Sunday 18 December 2016

simple way to resolve merge conflicts in git

In most cases, solution to merge-conflict is as simple as discarding local changes or remote/other branch changes.
Following is useful in those cases…
1. Search for all conflicting files.
grep -lr '<<<<<<<' .
2. At this point you may review each files. If solution is to accept local/our version, run:
git checkout --ours PATH/FILE
3. If solution is to accept remote/other-branch version, run:
git checkout --theirs PATH/FILE
4. If you have multiple files and you want to accept local/our version, run:
grep -lr '<<<<<<<' . | xargs git checkout --ours
5. If you have multiple files and you want to accept remote/other-branch version, run:
grep -lr '<<<<<<<' . | xargs git checkout --theirs


How to fix double free or corruption error using valgrind

he double free or corruption error will occur when there is a bad memory usage. Bad memory means you are using a location in memory which is not allocated or it is allocated to some other variable.

It can also occur if you try to free a memory other than the allocated memory.

This will generate segmentation fault. The segmentation fault may not occur sometimes because there are only few processes running in the system. The segmentation fault will usually occur with 100% probability in hardware boards but may not occur sometimes when running on the cpu.

The best ways that I suggest to analyse these crashes are the tools - Valgrind and Gdb.

Consider the example as shown 

#include<stdio.h>
#include<stdlib.h>

int main()
{
    int *p;
    p = (int *)malloc(1*sizeof(int));
    printf(" first free\n");
    free(p);
    printf(" first free done\n");
    printf(" second free\n");
    free(p);
    printf(" second free done\n");
    return 0;
}

1.compile the code with -g flag 
gcc -g memcheck.c 

2. run the executable generated as 
valgrind --tool=memcheck --leak-check=full ./a.out

3. The result/output will be 

==14861== Memcheck, a memory error detector
==14861== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==14861== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==14861== Command: ./a.out
==14861== 
 first free
 first free done
 second free
==14861== Invalid free() / delete / delete[] / realloc()
==14861==    at 0x4C2BDEC: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14861==    by 0x400608: main (memcheck.c:12)
==14861==  Address 0x51fc040 is 0 bytes inside a block of size 4 free'd
==14861==    at 0x4C2BDEC: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==14861==    by 0x4005E8: main (memcheck.c:9)
==14861== 
 second free done
==14861== 
==14861== HEAP SUMMARY:
==14861==     in use at exit: 0 bytes in 0 blocks
==14861==   total heap usage: 1 allocs, 2 frees, 4 bytes allocated
==14861== 
==14861== All heap blocks were freed -- no leaks are possible
==14861== 
==14861== For counts of detected and suppressed errors, rerun with: -v
==14861== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

The result shows that the memory has been freed two times, Hence easy to analyse. 
Use the -g flag during the compilation so that the line number of the double free is also shown.

How to publish android apps for free

Every one are behind Playstore and Amazon store for publishing their apps. If you want to publish your app on google play store, you need to pay $25 for account activation. Once your developer account is activated in play store, You will be able to publish as many apps as you wish for either free or money.

If you are a developer and you want to publish your app without investing on it, There are many other platforms too.

Slideme is one such store where you can create a developer account for free. You can publish your apps for free or earn revenue. There is no limit on the number of apps you publish.
when you register with Slideme you will not be signed in as a developer. Under the my profile option you need to enable your developer option.

you can visit slide me by clicking on the link here
https://slideme.org

Saturday 17 December 2016

Apn settings to increase speed in jio

Steps to increase Jio 4G speed

  • First visit setting option on your phone
  • Then visit the Mobile Networks option from settings
  • Then click on access point name of your reliance Jio Sim
  • You need to select the sim slot of Jio Sim
  • Select Menu which is available at top right corner
  • and choose new APN then click Save

Setting the APN Network to increase jio 4g speed

  • Name – Flipshope.com
  • APN – jionet
  • APN Type – Default
  • Proxy – Not Set
  • Port – Not Set
  • Username – Not Set
  • Password – Not Set
  • Server – www.google.com
  • MMSC – Not Set
  • MMS proxy – Not Set
  • MMS port – Not Set
  • MCC – 405
  • MNC – 857, 863 or 874
  • Authentication type – Not Set
  • APN Protocol – IPv4/IPv6