기본 콘텐츠로 건너뛰기

2020의 게시물 표시

[linux] start faied ssh server service

$ sudo service ssh start  * Starting OpenBSD Secure Shell server sshd sshd: no hostkeys available -- exiting. /etc/ssh 폴더 아래에 ssh_host_* 파일이 없어서 발생하는 문제 $ ls /etc/ssh total 552 moduli        ssh_config            ssh_config.d              ssh_import_id sshd_config   sshd_config.d $ $ sudo ssh-keygen -A ssh-keygen: generating new host keys: RSA DSA ECDSA ED25519 $ ls /etc/ssh/ moduli        ssh_host_dsa_key      ssh_host_ecdsa_key.pub    ssh_host_rsa_key      sshd_config ssh_config    ssh_host_dsa_key.pub  ssh_host_ed25519_key      ssh_host_rsa_key.pub  sshd_config.d ssh_config.d  ssh_host_ecdsa_key    ssh_host_ed25519_key.pub  ssh_import_id $

vcpkg - VisualC 용 package manager

 node.js 의 npm 처럼 c는 왜 간편한 패키지 설치 관리자 같은게 없나 늘 의문 이었슴. c#(.net)을 위한 nuget 이 있기는 했지만, 이건 c++ 용이 아니라 여러가지가 혼재 되어 있어서 사용하기 애매 하단 느낌이었는데, 자료 검색 중 발견 !!!!!!! 이미 많은 분들이 사용하고 있을 듯, 사용법은 기존 pkg manager 와 비슷 https://github.com/microsoft/vcpkg 위 git 웹이지 설명에는 라고 되어 있었슴. C++ Library Manager for Windows, Linux, and MacOS 해당 페이지에 설치 방법에 대해 설명이 있으니, 가능한 자세히 읽어볼 것. VisualStudio 2019 community 설치(또는 다른 VisualStudio 버전중 택 1) git 프로그램을 통해 해당 주소에서 소스 다운로드하고 윈도우 도스명령창(cmd.exe) 창에서 'bootstrap-vcpkg.bat' 입력후 <enter> 하면 vcpkg.exe 가 생생됨. 아래와 같이 명령을 사용할 수 있으며 >vcpkg version    <- 버젼 확인 >vcpkg list          <- 설치된 패키지 목록 조회 >vcpkg search <pkgname> <- 설치하고픈 이름의 패키지 찾기 >vcpkg install <pkgname>  <- 패키지 설치 >vcpkg remove <pkgname> <- 패키지 삭제 ex) mysql 검색시 G:\vcpkg>vcpkg search mysql gdal[mysql-libmariadb]                Add mysql support using libmariadb libmariadb           3.1.7#2          MariaDB Connector/C is used to connect C/C++ applications to Ma

c++ 현재 시간의 ms 구하는 함수

link:  https://stackoverflow.com/questions/19555121/how-to-get-current-timestamp-in-milliseconds-since-1970-just-the-way-java-gets 현재 시간의 milisecond 단위 구하는 함수, C++ __int64 llTime = 0; std::chrono::milliseconds ms = std::chrono::duration_cast<std::chrono::milliseconds>( std::chrono::system_clock::now().time_since_epoch()); llTime = static_cast<long long>(ms.count());

윈도우 환경변수에 오늘 날짜 구하기

Windows /cmd /batch shell/ save to variable @REM 날짜 프로그램으로 오늘 날짜 추출하여 환경변수에 저장 FOR /F "TOKENS=1 eol=/ DELIMS=/ " %%A IN ('DATE /T') DO SET Y4_M2_D2=%%A SET Y2M2D2=%Y4_M2_D2:~2,2%%Y4_M2_D2:~5,2%%Y4_M2_D2:~8,2% SET TODAY=%Y2M2D2% @REM 또는 다른 형태로 값을 얻어와서 합치기 @REM for /f %%x in ('wmic path win32_localtime get /format:list ^| findstr "="') do set %%x @REM set Y4M2D2_VAR=%Year%%Month%%Day% @REM set Y2M2D2_VAR=%Year:~2,2%%Month%%Day%