Jump to content

zak100

Senior Members
  • Posts

    233
  • Joined

  • Last visited

Posts posted by zak100

  1. @Sensei Hi,

    I am able to create a user:

    mysql> create user 'pyuser2'@'localhost'identified by 'pyuser22'
        -> ;
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> GRANT ALL PRIVILEGES on mysql.* to 'pyuser2'@'localhost';
    Query OK, 0 rows affected (0.01 sec)
    
    mysql> 

    Please guide me what should be the next step.

     

    Zulfi.

  2. @SenseiHi,

    Thanks for your response. I think I am getting garbage:

    Quote

    mysql> select * from mysql.user;
    +-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
    | Host      | User             | Select_priv | Insert_priv | Update_priv | Delete_priv | Create_priv | Drop_priv | Reload_priv | Shutdown_priv | Process_priv | File_priv | Grant_priv | References_priv | Index_priv | Alter_priv | Show_db_priv | Super_priv | Create_tmp_table_priv | Lock_tables_priv | Execute_priv | Repl_slave_priv | Repl_client_priv | Create_view_priv | Show_view_priv | Create_routine_priv | Alter_routine_priv | Create_user_priv | Event_priv | Trigger_priv | Create_tablespace_priv | ssl_type | ssl_cipher | x509_issuer | x509_subject | max_questions | max_updates | max_connections | max_user_connections | plugin                | authentication_string                     | password_expired | password_last_changed | password_lifetime | account_locked |
    +-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+
    | localhost | root             | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | auth_socket           |                                           | N                | 2022-02-18 23:31:30   |              NULL | N              |
    | localhost | mysql.session    | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | Y          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | N                | 2022-02-18 23:31:31   |              NULL | Y              |
    | localhost | mysql.sys        | N           | N           | N           | N           | N           | N         | N           | N             | N            | N         | N          | N               | N          | N          | N            | N          | N                     | N                | N            | N               | N                | N                | N              | N                   | N                  | N                | N          | N            | N                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | N                | 2022-02-18 23:31:31   |              NULL | Y              |
    | localhost | debian-sys-maint | Y           | Y           | Y           | Y           | Y           | Y         | Y           | Y             | Y            | Y         | Y          | Y               | Y          | Y          | Y            | Y          | Y                     | Y                | Y            | Y               | Y                | Y                | Y              | Y                   | Y                  | Y                | Y          | Y            | Y                      |          |            |             |              |             0 |           0 |               0 |                    0 | mysql_native_password | *71C983FDE1D933E8A278D729FC2F45DAC1CDA37E | N                | 2022-02-18 23:31:32   |              NULL | N              |
    +-----------+------------------+-------------+-------------+-------------+-------------+-------------+-----------+-------------+---------------+--------------+-----------+------------+-----------------+------------+------------+--------------+------------+-----------------------+------------------+--------------+-----------------+------------------+------------------+----------------+---------------------+--------------------+------------------+------------+--------------+------------------------+----------+------------+-------------+--------------+---------------+-------------+-----------------+----------------------+-----------------------+-------------------------------------------+------------------+-----------------------+-------------------+----------------+

    When I use ping localhost, my output is:

    Quote

    $ ping localhost
    PING localhost (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.064 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.066 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.058 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.065 ms
    ^C

    This is the first time, I am executing mysql with Python.

    I am working on Ubuntu 18.04.

    Somebody please guide me.

     

    Zulfi.


    4 rows in set (0.00 sec)

    mysql>

     

  3. Hi,

    I am using pycharm to execute my program, I am getting following error:

    Quote

    /home/PycharmProjects/pythonProjectRev/venv/bin/python /home/zulfi/PycharmProjects/pythonProjectDB/main.py
    Traceback (most recent call last):
      File "/home/PycharmProjects/pythonProjectDB/main.py", line 9, in <module>
        cursorclass=pymysql.cursors.DictCursor)
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/connections.py", line 353, in __init__
        self.connect()
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/connections.py", line 633, in connect
        self._request_authentication()
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/connections.py", line 907, in _request_authentication
        auth_packet = self._read_packet()
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/connections.py", line 725, in _read_packet
        packet.raise_for_error()
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/protocol.py", line 221, in raise_for_error
        err.raise_mysql_exception(self._data)
      File "/home/PycharmProjects/pythonProjectRev/venv/lib/python3.6/site-packages/pymysql/err.py", line 143, in raise_mysql_exception
        raise errorclass(errno, errval)
    pymysql.err.OperationalError: (1698, "Access denied for user 'root'@'localhost'")

    Process finished with exit code 1

    Following is my code:

    import pymysql.cursors
    
    # con = pymysql.connect('zulfi'@'localhost' (password: NO))
    conn = pymysql.connect(host='localhost',
                           user='root',
                           password='',
                           database='db',
                           charset='utf8mb4',
                           cursorclass=pymysql.cursors.DictCursor)

    I have created "db" database in mysql:

    Quote

    mysql> show databases;
    +--------------------+
    | Database           |
    +--------------------+
    | information_schema |
    | db                 |
    | menagerie          |
    | mysql              |
    | performance_schema |
    | pets               |
    | sys                |
    +--------------------+
    7 rows in set (0.00 sec)

     

    Somebody please guide me.

     

    Zulfi.

  4. Hi,

    I want to understand the purpose of tags in EVM assembly and their relationship with Solidity function.

     

    pragma solidity ^0.5.1;
       import './Mod.sol';
       contract MOFTest{
           ModifiedBank mb;
           constructor(address payable addressOfBank, uint amount) public {}
           function deposit (uint amount )  payable public {
           }
      }

    I found that if I have a constructor then Remix IDE will have only 2 tags but now I have 2 functions and I found that there are 5 tags. Kindly explain me what is the purpose of tags and what is their relationship with Solidity functions? Also the tags are appearing in a haphazard manner, first tag1 and tag2 , then again tag1 and tag2, after that Remix IDE shows rag4, and then tag3 & tag5. I have attached an image image in this connection also related to the opcodes generated by the Remix IDE for the code shown above, sorry I can't scroll.

    1157130334_ListofopcodesfromremixIDE.thumb.png.a82537e1f052929e9c2940b3262e471a.png

     

    Somebody please guide me.

     

    Zulfi.

     

  5. Hi,

    <Did you not post on the forum about solidity before?>

    Yes, I posted about this also but no reply.

    <Did you not study it back then and take notes so you can write it now? >

    Never. But sorry why are you asking these questions? Are you against forums? You know this is the advantage of forums that we can learn from each other. I can't understand why are you feeling bad about this. If you don't know no problem. I am not pressing you to tell me.

    <I feel like you are spending way too much time on something that would be a lot easier if you got a cheap course. >goo

    I know about Solidity but I am not good at testing that's why I am posting.

    <I am not an expert in all this blockchain stuff. Surely there is one on Udemy etc but you will have to wait for a sale. >

    Okay no problem, let some other person reply me. But if I am in a position to afford anything, I don't wait for sales.

     

    Zulfi.

     

     

     

     

  6. Maian Tool Repository: How to store contract retrieved from etherscan.io and what is ‘test.sol’

     

     

    Hi,

    Hi,

     

    I am to execute the MAIAN tool from its repository on docker. The link at :

    GITHub Maian tool Issue

     

    The above link provided details of how to execute the MAIAN tool from docker. I am in the MAIAN tool repository on docker.

    They have first tried to access a smart contract from docker using Etherscan.io:


    Accessing smart contract using Etherscan.io

     

    The name of the contract is KaratBankCoin. They have not told where to store the contract.

     

    Later on they used the command:

     

    python maian.py -c 2 --soliditycode test.sol KaratBankCoin

     

    I am getting the error :

     

    ====================================================================================================

    [ ] Compiling Solidity contract from the file test.sol ... [-] Contract file test.sol does NOT exist

    [-] Contract KaratBankCoin does NOT exist

     

    Because I don’t know what is test.sol and I don’t know how and where to store the KaratBankCoin contract retrieved from mainnet using Etherscan.io.

     

    They have not provided any details about test.sol and how to store KaratBanCoin because we are in the Maian tool’s repository.

     

    Somebody please guide me.

     

    Zulfi.

  7. Hi,

    Sorry I don't mean web3.py.

    <That is a CDN for downloading JavaScript to run web3 on a webpage. Similar to jQuery you just need to use the <script> tag. But it won't be available to Python or NodeJS.>

    This is what I am talking about. By web3 I mean web3.nodejs. Its a javascript stuff.
    Kindly look at my following are posts:

    reddit web_js installation

     

    reddit_Ubuntu

    ethereum_stack exchange

     

    Sorry nobody is able to solve my 1 severe vulnerability problem related web3.nodejs

    Zulfi.

     

     

  8. Hi,

    Can you please show me your results for "npm install web3"? They say that 'g' is used for global installation. I got following:

    $ nvm install node
    Downloading and installing node v15.5.0...
    Downloading https://nodejs.org/dist/v15.5.0/node-v15.5.0-linux-x64.tar.xz...
    ######################################################################### 100.0%
    Computing checksum with sha256sum
    Checksums matched!
    Now using node v15.5.0 (npm v7.3.0)
    zulfi@lc2530hz:~$ npm install web3

    removed 1 package, and audited 353 packages in 1s

    1 low severity vulnerability

    Some issues need review, and may require choosing
    a different dependency.

    Run `npm audit` for details.
    zulfi@lc2530hz:~$


    I can't remove this problem:

    reddit web_js installation

    Please guide me how to get rid of this low severity error?

    Also have you tried to run smart contracts after installing web3.nodejs with -g option?

    Zulfi.

  9. Hi,

    I am trying to compile a python code on ubuntu 18.04:

    from __future__ import print_function
    from web3 import Web3, KeepAliveRPCProvider, IPCProvider
    import argparse,subprocess,sys

    At the end I am getting the error:

    Quote

    ModuleNotFoundError: No module named 'web3'

     

    I found one post which says:

    Quote

    You can try to add the web3 script from a CDN like this: cdnjs.com/libraries/web3

    Can the above hint help me to solve the web3 module not found error?

    Please guide me how I can implement the above technique?

     

    Zulfi.

     

  10. Hi,

    I have installed nodejs on my ubuntu machine.

    I am trying to install web3 on my ubuntu 18.04 system. I am using the following command:

    @lc2530hz:~$ sudo npm install -g web3

    but I am getting the error:

    sudo: npm: command not found

    But when I am typing: @lc2530hz:~$ npm --version 6.14.6

    Kindly guide me how to install web3.

    I have got some solution here:

    https://askubuntu.com/questions/1301489/problem-with-installing-web3-using-npm

    But I don't know how to implement it. Somebody please guide me.


     

     

    Zulfi.

     

  11. Hi,

     

     

    Thanks for your response. The link is related to my post.

    I was able to install on the terminal. But I am using PyCharm. If I install anything on Terminal it will not become part of Pycharm. So I have to install the package within the Pycharm environment.

     

    Please guide me.

     

    Zulfi.

  12. Hi,

    I am getting "Tensor Flow" package problem. I am running the code on PyCharm community version3:

    Quote

    Traceback (most recent call last):
      File "/home/zulfi/PycharmProjects/ML/venv/byMule.py", line 5, in <module>
        import tensorflow as tf
    ModuleNotFoundError: No module named 'tensorflow'

    I installed the package on the terminal:

    Quote

    ~$ pip install tensorflow==1.2.0 --ignore-installed
    Collecting tensorflow==1.2.0
      Downloading https://files.py

    But still I am getting error, somebody please guide me.

     

    Zulfi.

     

  13. Hi @The Mule and @Ghideon-Thanks for discussions and providing me the essential steps for creating a python model.

    <bench-marking the performance of some baseline or prototype model that you can train on smaller datasets>

    Yes you are right. First I have to come up with some proto-type mode.

    <Once the major limitation becomes how much data you have, then I would consider the problem of getting a ton of data to be your first priority. However, at the moment,>

    Yes, I would appreciate your help as much as possible.

    I got some idea. I hope once I read the paper, I would know more things.

    < I would think it is more crucial for you to read the articles that me and @Ghideon have discussed. >

    Surely I would look at the articles which you (@The Mule )and @Ghideon have pointed.

    God blesses you.

     

    Zulfi.

  14. Hi,

    I found following definition of a chemical reaction:

    Quote

    a process in which one or more substances, the reactants, are converted to one or more different substances, the products. Substances are either chemical elements or compounds. A chemical reaction rearranges the constituent atoms of the reactants to create different substances as products.

    Based upon this it looks like floating of ice is not a chemical reaction because it is not causing any rearrangement of atoms. But in case of rotting of milk we have rearrangment of atoms, so it is chemical reaction. Is it correct?

    rotting of milk (chemical reaction): formation of acid i.e taste of milk becomes sour

    floating of ice (chemical reaction): none, but there is a physical change i.e. ice is melting.

     

     

     

    Zulfi.

  15. Hi my friend,

    Thanks. Very good reply.  Repository is what I am looking for. But I think we must have more SC(smart contracts). As @Ghideon has point out we need more data. I think one hundred thousand would be enough. 

    <However, before I do this, I am going to need you to describe more about smart contract vulnerability detection. What exactly is this?>

     

    SC are programs which run on the blockchain. They are used for transfer of cryptocurrency. However, they are not faster than credit cards because they are immutable. So for confirming transactions, one has to wait. Because of their programming nature, they can have coding flaws. Bad people can take advantage of this and execute the SC in such a way that the money known as Ether lands into their SC accounts. So before uploading SC on the blockchain one has to make sure that it  does not have flaws so that attacker can't exploit it. My objective is to create a ML(Machine Learning) tool to find out if the SC has a flaw or not.

    For vulnerability detection we have some coding practices and we have to check if the SC follows those best practices or not. If not then SC is a dangerous for use so we won't upload it on the blockchain.

    I don't know how can i contact you, maybe through provate messages. Certainly I need somebody to help because I am not conversant with ML. Also I nedd help in running SC tools. I don't know if Maian is in a working state or not. I have tried several SC tools but only Remix and two other online tools (Securify and Smartcheck) are good. Rest do not work. I appreciate your offer hope to take advantage of it.

     

    God blesses you for providing me all this information.

     

    Zulfi.

     

     

     

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.