August 18, 2022

How to call solidity functions with Web3, metamask library

Public view/pure functions can be simply called. However, in other cases, you need to log in because of gas fee. It can be done with metamask.public view/pure 함수는 간단히 호출할 수 있다. 그러나 그 외의 경우는 가스비를 제출해야하므로 로그인이 필요하다. 이를 위해 여기서는 메타마스크를 활용하는 방법을 알아본다.1. public view/pure function <script src="https://cdn.jsdelivr.net/npm/web3@1.7.3/dist/web3.min.js"></script><script>const · · ·

August 17, 2022

How to initialize Web3 library in Javascript

To use Web3, there are two ways to enter an RPC address or use a metamask. Web3를 사용하려면 RPC 주소를 입력하거나 메타마스크를 이용하는 방법이 있다. 1. Using RPC Address (Polygon Network). 1. RPC 주소를 입력하는 방법(폴리곤 네트워크). <script src="https://cdn.jsdelivr.net/npm/web3@1.7.3/dist/web3.min.js"></script><script>const rpcPolygon = "https://polygon-rpc.com"; let web3 = · · ·

February 01, 2022

How to print coordinates on the screen with Python

  import matplotlib.pyplot as pltx = [100, 500, 100, 500 ]y = [100, 500, 500, 100 ]plt.fill(x, y, color="lightgray")plt.show() Using Python's matplotlib module, displaing coordinates is simple. However, the system must support GUI. 파이썬의 matplotlib 모듈을 이용하면 간단히 좌표를 표시할 수 있다. 다만, 시스템이 GUI를 지원해야 한다.  Make two lists to store X, Y coordinates. · · ·

How to convert TTF to TTX(XML) with Python

Converting font files using Python is simple. Just call the saveXML() function of the fontTools module.   파이썬을 이용한 폰트 파일 변환은 간단하다. fontTools 모듈의 saveXML() 함수를 호출하면 된다.from fontTools.ttLib import TTFontfont = TTFont("xxx.ttf")font.saveXML("xxx.ttx")1. Input TTF and create an object with TTFont().2. Call the saveXML() method of the object to save it.3. · · ·

December 13, 2021

How to update WSL1 to WSL2

  WSL1 cannot run 32-bit ELF files, so the update to WSL2 is required. The process is as follows. WSL1은 32비트 ELF 파일을 실행할 수 없으므로 WSL2로 업데이트가 필요하다. 해당 과정은 아래와 같다.   1. Check the version. 버전 확인.> wsl -l -v  NAME            STATE           · · ·

August 20, 2020

How to free TCP port 9001

  If the System process occupies port 9001 as shown in the picture above, the following solution can be helpful.  만약 위 그림과 같이 9001번 포트를 System 프로세스가 점유하고 있다면, 아래와 같은 해결 방법이 도움이 될 수 있다.   Stop "Intel(R) Graphics Command Center Service" from "run → compmgmt.msc → services". Then the occupied port 9001 is released. "실행 → compmgmt.msc · · ·

August 12, 2020

How to use scapy Python module

❑ How to read packets from pcap. pcap 파일로부터 패킷 읽기. from scapy.all import *pks = rdpcap("./filename.pcap")for pk in pks:    if pk.getlayer("IP").sport == 4321:        layerRaw = pk.getlayer("Raw") ❍ getlayer(): Select a specific network layer.특정 네트워크 계층을 선택한다.❍ sport: Source port. 소스 포트. ❑ continue. · · ·