영어는 구글 번역기를 이용한 글이다.

English is written using Google Translate.

ssh autologin을 위해 authroized_keys를 등록해도, password를 확인하는 경우가 있다.

Even if authroized_keys is registered for ssh autologin, the password may be checked.

이러한 경우 사용자의 디렉토리의 권한을 확인해보자.

In this case, check the permissions of the user's directory.

$ ls -al
drwxrwxr-x ...
...

사용자 계정 디렉토리 permission 값이 0x750을 over하면 password를 확인 한다.

If the user account directory permission value exceeds 0x750, check the password.

 

$ chmod 750 ${USER_ACCOUNT}

 

'etc' 카테고리의 다른 글

Function and Task dumping to FSDB  (0) 2023.06.08
AMBA protocol의 종류  (0) 2023.06.07
구구단-C  (0) 2023.06.04
프로그램의 메모리 관리 ( Heap, Stack, Bss, Data )  (0) 2023.06.03
move git repository with history (without gerrit)  (0) 2022.11.08

기본적으로 json은 주석을 지원하지 않는 format으로 알고 있다. (필자기준)

주석을 이용하려면 pre processing 해주어야 한다.

def load(jsonpath):
	with open(jsonpath, 'r') as jsonfile:
    	# support C++ type comment
    	r = re.compile('^\s*//.*$')
        jsondata = ''.join ( l for l in jsonfile if r.match(l) is None)
        return json.loads(jsondata)
    return None

위 코드는 현재 사용하고 있는 코드인데, 라인에는 주석만 있는 것을 가정하고 작성한 코드이다.

pre processing 부분의 code를 작성해서 string list를 json.loads로 넘겨주면 되는 것이 중요한 포인트이다.

'python' 카테고리의 다른 글

구구단 - 파이썬  (0) 2023.06.03
Python FTP TLS implicit  (0) 2022.09.24
Python package install ( offline )  (0) 2022.09.24
Python Install ( linux )  (0) 2022.09.24

offline인 상태인 곳에 python package를 install 해야하는 경우가 있다.

또한 package를 업데이트 하고 싶을 수 있다.

필자는 package를 다운로드 한 다음에 offline인 서버에 package를 설치해야하는 경우였다.

아래와 같은 방법을 사용하였다.

Package Download

Offline인 곳에 설치하기 위한 package 다운로드. 아래는 tk, openpyxl package 다운로드 example

python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package tk
python -m pip download --no-binary=:all: -d ./pip-package openpyxl
  • --only-binary : binary 형태 wheel을 다운로드 할 건지
  • --no-binrary : source 코드 (압축) 다운로드 할 건지
  • --platform any : 어떤 os든 설치가능한 버전을 받을 건지
  • --platform ${MY} : 맞는 버전을 다운로드 할 것인지
    • --platform을 찾는 방법
      • https://pypi.org/에서 찾고자하는 package를 검색 및 download page로 이동
      • Build Distributions에서 선택
      • 필자의 경우 설치는 여러가지 해보고 정상설치 되는 것을 찾았다.
    • platform으로 할지 wheel로 할지.. 많은 시도를 해야할 수 있다.

아래는 필자가 현재 사용하는 package 리스트

더보기
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package tk

python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package wheel
::python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pip

:: ---- office ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package xlrd
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package xlrd3
python -m pip download --no-binary=:all: -d ./pip-package openpyxl
python -m pip download --no-binary=:all: -d ./pip-package python-docx
python -m pip download --no-binary=:all: -d ./pip-package docx
python -m pip download --no-binary=:all: -d ./pip-package docxcompose

:: ---- textual ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package textual
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package poetry-core

:: ---- jira ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package setuptools-scm
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package setuptools-rust
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package flit_core
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package SecretStorage
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package jira

:: ---- etc ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package PyJWT
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package chardet
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package psutil
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pbr
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package numpy
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package GitPython
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pycryptodomex
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pycryptodome
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package paramiko
python -m pip download --no-binary=:all: -d ./pip-package pyinstaller
python -m pip download --no-binary=:all: -d ./pip-package atlassian-python-api


python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package wheel
::python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pip

:: ---- office ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package xlrd
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package xlrd3
python -m pip download --no-binary=:all: -d ./pip-package openpyxl
python -m pip download --no-binary=:all: -d ./pip-package python-docx
python -m pip download --no-binary=:all: -d ./pip-package docx
python -m pip download --no-binary=:all: -d ./pip-package docxcompose

:: ---- textual ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package textual
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package poetry-core

:: ---- jira ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package setuptools-scm
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package setuptools-rust
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package flit_core
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package SecretStorage
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package jira

:: ---- etc ----
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package PyJWT
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package chardet
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package psutil
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pbr
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package numpy
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package GitPython
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pycryptodomex
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64 --platform any -d ./pip-package pycryptodome
python -m pip download --only-binary=:all: --platform manylinux2014_x86_64                -d ./pip-package paramiko
python -m pip download --no-binary=:all: -d ./pip-package pyinstaller
python -m pip download --no-binary=:all: -d ./pip-package atlassian-python-api

Package Install

Install은 download에 비해서 굉장히 간단하다.

python3 -m pip install --upgrade --no-index --find-links=${DOWNLOAD_DIR} ${PACKAGE_NAME}

 

'python' 카테고리의 다른 글

구구단 - 파이썬  (0) 2023.06.03
Python FTP TLS implicit  (0) 2022.09.24
How do I add comments to JSON ?  (0) 2022.09.24
Python Install ( linux )  (0) 2022.09.24

아래 python hompage에서 file download.

https://www.python.org/downloads/

 

Download Python

The official home of the Python Programming Language

www.python.org

개인적으로는 gzip source tarball을 선택하여 download.

gzip source tarball을 선택

아래 명령 실행

set download = Python-3.9.12
# 3.9.12 -> 3.9
set symlink = `echo ${util} | sed 's/(.*\)\.[0-9]\+$/\1/'`
# 압축해제
tar xfz ${download}.tgz
# ln -s는 3.9버전 업그레이드를 대비. 3.9로 symbolic 링크
# shell에 path는 3.9를 기준으로 bin을 path에 등록하였다.
pushd ${download} && \
    ./configure --prefix=${INSTALL_DIR}/${download} --enable-shared --enable-optimizations && \
    make && \
    make install && \
    ln -s ${INSTALL_DIR}/${download} ${INSTALL_DIR}/${symlink} \
popd

Shell script에 bin path 및 library path 등록 ( 아래는 cshell 기준으로 ~/.cshrc  )

set path = ( ${INSTALL_DIR}${symlink}/bin $path )
setenv LD_LIBRARY_PATH ${INSTALL_DIR}${symlink}/lib:$LD_LIBRARY_PATH

cshrc를 sourcing 하거나, terminal을 새롭게 ( cshrc를 새롭게 sourcing 하는 효과 ) 실행

source ~/.cshrc

python이 잘 실행되는지 체크

$ which python3
~~~/bin/python3
$ python3
Python 3.9.12 (main, Aug ....
....

'python' 카테고리의 다른 글

구구단 - 파이썬  (0) 2023.06.03
Python FTP TLS implicit  (0) 2022.09.24
How do I add comments to JSON ?  (0) 2022.09.24
Python package install ( offline )  (0) 2022.09.24

+ Recent posts