發表文章

Obtain IP address (Windows / Linux sys.) from Python – plus simple practice

Table of Contents Windows System Linux A Simple Demo Programs operating on different systems make no unique IP address. This can cause problems whenever we specify an exact IP address in services while executing the service programs on other machines/internet. This simple instruction introduces netifaces in Python to flexibly locate IP address depending on Internet and systems of the device/machine.   Windows System Open command line tool (whatever you’d like to run python) and go into Python environment. And then   import netifaces   Run ni_interface = netifaces.interfaces() This will list several interface identifiers of the machine (list of identifiers). One can see different configurations according to machines. The identifier is unique within the subnet and can identify interface of particular node. Well, just a brief note about interface and not knowing details will not prevent us from going for the next few steps. print(ni_interface) From this we see det

Create NFT on Solana (Windows)

圖片
Table of Contents Prerequisite Install Solana Command Line Tool Generate a Solana Wallet Generate Token       -  Mint Fungible Token       -  Mint Non-Fungible Token (NFT) 【Prerequisite】 To create an NFT using command line tool for Windows system, it is suggested to use command prompt (cmd) opened as an Administer .  explorer.solana.com as a web-based tool to interactively manage wallet and crypto assets. 【Install Solana Command Line Tool Suite】 First of all we need to install the Solana tool suite. For Windows system, the command: curl https://release.solana.com/v1.8.6/solana-install-init-x86_64-pc-windows-msvc.exe --output C:\solana-install-tmp\solana-install-init.exe --create-dirs This downloads Solana installer of version 1.8.6 to directory C:\solana-install-tmp for Windows system. Now Solana installer got into that directory with file name solana-install-init.exe. Check the version by solana --version For Linux system we can reference official tutorial . For my person

Pip doesn't work in Python - Ubuntu

To install pip in Ubuntu, a standard package manager, we can run command -  for Ubuntu 16.04 sudo apt install python3-pip To check installation version, we run respectively pip -V pip3 -V and returns pip 20.3.4 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7) And it seems all done. However, this raises a problem before you really start to use the pip.   【 Key Problem 】 The key question here is that the pip version does not specifically locate correct python version which we desire to be python 3.6 in this case whilst now 2.7. This can be an issue for version mismatch because the latest pip version no longer served python 2.7. Hence you will not be able to install dependencies via the pip for python development. You may receive system errors containing     sys.stderr.write( f"ERROR: {exc} " )                                    ^ SyntaxError: invalid syntax   【 Solution 】 run curl -fsSL https://bootstrap.pypa.io/pip/3.5/get-pip.py | python3.6 given your python ver

Create DB on Docker (PPT version)

  This article is to introduce how to create database (DB, in this case MySQL) in Docker container, and link it to phpMyAdmin. With the instruction you will be able to run your MySQL service on Docker, mastering the database by using a web-based DB management tool.