Saturday, 12 May 2018

Getting error while installing pip or setuptools

Python has weird as well as awesome tool known as pip.

Main precaution to take care is never ever leave half baked python packages installed as they are main reasons for dependency problems.

https://stackoverflow.com/questions/16144934/trouble-install-pip-windows

pip can be upgrde or downgrade using same command:

python -m pip install --upgrade boto3

It looks like a bug in pip where it's assuming its metadata is stored as UTF-8. Instead, your username appears to be encoded as "windows-1255".

You could try the following:

File "C:\Users\name\ AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\_vendor\pkg_resources\__init__.py", line 1616, in get_metadata
    return self._get(self._fn(self.egg_info, name)).decode("utf-8")

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf2 in position 22365: invalid continuation byte
You are using pip version 7.1.2, however version 8.0.2 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

https://stackoverflow.com/questions/35510743/error-while-upgrading-pip-unicodedecodeerror-utf-8-codec-cant-decode-byte

1. Backup: C:\Users\name\AppData\Local\Programs\Python\Python35-32\lib\site-packages\pip\_vendor\pkg_resources\__init__.py
2. Goto line: 1616
3. Change utf-8 to mbcs.
4. Re-run upgrade

Thursday, 26 April 2018

Not detecting any Wireless/Wifi Network in CentOS 7

Here is my experience, for the following reasons:


  1. If you got connected to Wifi network when you have installed CentOS 7.
  2. After CentOS 7 entering into sleep mode OR accidental shutdown due to power
    drainage OR you have restarted & logged into CentOS 7

and if your wifi not working.

Don't install extra kernel module OR install any new packages OR do any tweak.

Just shutdown and boot again in CentOS 7. Your wifi will start working again.


Bottom Line:  This is what I realised after 6 hours of tweaks and tried everything out.

Sunday, 11 March 2018

PostgreSQL 10 windows username and password.

You can refer these blogs to reset password of PostGreSQL as reader has committed sin by installing PGSQL on windows platform because of which they can't get entry into holy Heaven of PostgreSQL.

By the way, default username of PGSQL is  postgres
  1.  https://rationalpie.wordpress.com/2010/02/18/postgresql-reset-root-password/
  2.  https://humaninbox.wordpress.com/2012/12/06/how-to-reset-the-postgres-users-password-in-windows/
If you went mad because of heavy PGSQL console, try this IDE: https://www.heidisql.com/

Hope this helps.

Thursday, 14 September 2017

All Fields Greyed on Unallocated Space

To delete volumes of pen drive giving error of unallocated space

If you are facing error for unallocated space

Go to cmd with administrator privileges

type  DISKPART

type list volume

Check number of removable drive suppose 3.

delete volume 3

And your partition on that drive will be deleted.

Wednesday, 13 September 2017

Basics of Bitcoin and Blockchain

For Blockchain & Bitcoin understanding,


If you are looking for general use of Bitcoins,  https://bitcoin.org/en/

For technical & nontech people, it is always good to understand terms in Plain English.

In case of Bitcoins, it is possible: http://amzn.to/2vTOaMM

These are the books you can refer because reading a tutorial might lead you into Confused state:


For Beginners:            Blockchain Basics: A Non-Technical Introduction in 25 Steps

For implementation:    Blockchain: Blueprint for a New Economy

For Bitcoin & block chain:  Mastering bitcoin programming the open blockchain 2nd edition

For python freaks, here is a treat:  https://github.com/bigchaindb/bigchaindb

If you want to try out Bitcoins for windows, you can download it from here:

https://www.bitcoinunlimited.info/download

Tuesday, 10 January 2017

How to reach from Swargate to Vishrantwadi

If you are arriving in the night at swargate between 9:00 to 10:00 pm, you can reach to vishrantwadi quickly as follows:

  1. Take the Pune station bus from outside of Swargate City bus Depot.

    Cost = Swargate to Pune Station = Rs. 10/-
  2. When conductor will say this is the last stop, board there.
  3. Now you are at the bus stand of Pune station. It is a small one and having 3 tracks which is its identity.
  4. You will get next bus within 10-15 min approx for Vishrantwadi and last bus will be on 11:30 pm.

    Cost = Pune Station to Vishrantwadi = Rs. 15/-
Otherwise, you can wait inside City bus Depot for the bus from Swargate to Vishrantwadi which costs Rs 20/- and a long wait time unless you are lucky ;)


Hope this helps,

Happy Journey!

Tuesday, 19 July 2016

Fix/Solution of MySQL 5.7 warning for SSL in Netbeans/Eclipse

If you are running MySQL 5.7.x and Netbeans 8.1 and you come across this warning,

"WARN: Establishing SSL connection without server's identity verification is not recommended. According to MySQL 5.5.45+, 5.6.26+ and 5.7.6+ requirements SSL connection must be established by default if explicit option isn't set. For compliance with existing applications not using SSL the verifyServerCertificate property is set to 'false'. You need either to explicitly disable SSL by setting useSSL=false, or set useSSL=true and provide truststore for server certificate verification." 
Don't worry! The culprits are:

1. MySQL 5.7.x (Actually its a good feature but really annoying to new users)

2. MySQL Java Connector Jar File

Solution for Culprit 1:

If your traditional code for JDBC is like:

 /*
  * To make java and mysql connectivity
  */
 package com.java.databases;
 import java.sql.*;
 /**
  *
  * @author mayur
  */
 public class Java2MySQL {
   public static void main(String[] args) {
     String dbname = "ram_db";
     String uname = "root";
     String passw = "ramayan";
     String url = "jdbc:mysql://localhost:3306/";
     String driver = "com.mysql.jdbc.Driver";
     try {
       Class.forName(driver);
       System.out.println("Connection is Registered");
       Connection conn = DriverManager.getConnection(url+dbname, uname, passw);
       System.out.println("Connection is Open");
       conn.close();
       System.out.println("Connection is closed");
     } catch (Exception e) {
       System.err.println("Something is wrong!! Please wait while we fix it");// e.printStackTrace();//(Something is wrong!! Please wait while we fix it);
     }
   }
 }

So the modified code is:

 /*
  * To make java and mysql connectivity
  */
 package com.java.databases;
 import java.sql.*;
 /**
  *
  * @author mayur
  */
 public class Java2MySQL {
   public static void main(String[] args) {
     String dbname = "don_db";
     String uname = "root";
     String passw = "";
     String url = "jdbc:mysql://localhost:3306/"+dbname+"?autoReconnect=true&useSSL=false";
     String driver = "com.mysql.jdbc.Driver";
     try {
       Class.forName(driver);
       System.out.println("Connection is Registered");
       Connection conn = DriverManager.getConnection(url, uname, passw);
       System.out.println("Connection is Open");
       conn.close();
       System.out.println("Connection is closed");
     } catch (Exception e) {
       System.err.println("Something is wrong!! Please wait while we fix it");// e.printStackTrace();//(Something is wrong!! Please wait while we fix it);
     }
   }
 }

You will find that we have appended [+dbname+"?autoReconnect=true&useSSL=false" ] to the part after URL of database.

Example:

 Connection con = DriverManager.getConnection
 ("jdbc:mysql://localhost:3306/"+dbname+"?autoReconnect=true&useSSL=false","root","");

Solution for Culprit 2:

Change the driver version of mysql connector other than 5.1.39. I have checked for 5.1.38,5.1.36.

Just use these versions and you program will be free from warning.

I have tested this with Eclipse also.

Hope this will help you !