커맨드


[테이플 이름 확인]
sqlite> .table
[데이터베이스 스키마 확인]
sqlite> .schema

 


sql문


SELECT name FROM sqlite_master WHERE type = 'table';

우분투 18.04 LTS에서 CUDA 9.0을 다운로드받으면서 torch7을 빌드해야 했다.

 

$ cd ~/torch

$ ./install.sh

 

이 명령어로 빌드를 하던 도중에 아래와 같은 에러가 발생했다.

 

 

#error -- unsupported GNU version! gcc versions later than 6 are not supported!

 

$ sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10

$ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10

 

위 명령어로 해결하였다.

 

하지만 또 다른 에러가 발생했다.

 

#error: more than one operator "!=" matches these operands

 

$ export TORCH_NVCC_FLAGS="-D__CUDA_NO_HALF_OPERATORS__"

 

이렇게 하면 정상적으로 빌드가 될 것이다.

[ref link]

gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73

 

CUDA 10.1 Installation on Ubuntu 18.04

CUDA 10.1 Installation on Ubuntu 18.04. GitHub Gist: instantly share code, notes, and snippets.

gist.github.com

 

 

여기서 쭈욱 따라하면 된다.

 

#!/bin/bash
## This gist contains instructions about cuda v10.1 and cudnn 7.6 installation in Ubuntu 18.04 for Tensorflow 2.1.0

### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###

### If you have previous installation remove it first. 
sudo apt-get purge nvidia*
sudo apt remove nvidia-*
sudo rm /etc/apt/sources.list.d/cuda*
sudo apt-get autoremove && sudo apt-get autoclean
sudo rm -rf /usr/local/cuda*


### to verify your gpu is cuda enable check
lspci | grep -i nvidia

### gcc compiler is required for development using the cuda toolkit. to verify the version of gcc install enter
gcc --version

# system update
sudo apt-get update
sudo apt-get upgrade


# install other import packages
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev


# first get the PPA repository driver
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
sudo apt-get update

 # installing CUDA-10.1
sudo apt-get -o Dpkg::Options::="--force-overwrite" install cuda-10-1 cuda-drivers


# setup your paths
echo 'export PATH=/usr/local/cuda-10.1/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-10.1/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc
sudo ldconfig

# install cuDNN v7.6
# in order to download cuDNN you have to be regeistered here https://developer.nvidia.com/developer-program/signup
# then download cuDNN v7.6 form https://developer.nvidia.com/cudnn

CUDNN_TAR_FILE="cudnn-10.1-linux-x64-v7.6.5.32.tgz"
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/7.6.5.32/Production/10.1_20191031/cudnn-10.1-linux-x64-v7.6.5.32.tgz
tar -xzvf ${CUDNN_TAR_FILE}


# copy the following files into the cuda toolkit directory.
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-10.1/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-10.1/lib64/
sudo chmod a+r /usr/local/cuda-10.1/lib64/libcudnn*

# Finally, to verify the installation, check
nvidia-smi
nvcc -V

# install Tensorflow (an open source machine learning framework)
# I choose version 2.1.0 because it is stable and compatible with CUDA 10.1 Toolkit and cuDNN 7.6

sudo pip3 install --user tensorflow-gpu==2.1.0

 

 

혹시 우분투 18.04 LTS에서 9.0 쿠다를 설치해야 된다면

 

[ref link]

mibolee.tistory.com/33

 

[Ubuntu 18.04 LTS] CUDA 9.0 설치

[ref link] gist.github.com/andyweizhao/639e94b60c166f57964aafedeb465e90 cuda 9.0 complete installation procedure for ubuntu 18.04 LTS cuda 9.0 complete installation procedure for ubuntu 18.04 LTS -..

mibolee.tistory.com

 

[ref link]

gist.github.com/andyweizhao/639e94b60c166f57964aafedeb465e90

 

cuda 9.0 complete installation procedure for ubuntu 18.04 LTS

cuda 9.0 complete installation procedure for ubuntu 18.04 LTS - cuda_installation_on_ubuntu_18.04

gist.github.com

 

여기서 쭈욱 따라하면 된다.

 

#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.3 in ubuntu 18.04

### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###

### to verify your gpu is cuda enable check
lspci | grep -i nvidia

### gcc compiler is required for development using the cuda toolkit. to verify the version of gcc install enter
gcc --version

# first get the PPA repository driver
sudo add-apt-repository ppa:graphics-drivers/ppa

# install other import packages
sudo apt-get install g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev

# CUDA 9 requires gcc 6
sudo apt install gcc-6
sudo apt install g++-6

# downoad one of the "runfile (local)" installation packages from cuda toolkit archive 
wget https://developer.nvidia.com/compute/cuda/9.0/Prod/local_installers/cuda_9.0.176_384.81_linux-run

# make the download file executable
chmod +x cuda_9.0.176_384.81_linux-run 
sudo ./cuda_9.0.176_384.81_linux-run --override

# answer following questions while installation begin
# You are attempting to install on an unsupported configuration. Do you wish to continue? y
# Install NVIDIA Accelerated Graphics Driver for Linux-x86_64 384.81? y
# Install the CUDA 9.0 Toolkit? y

# Refer to https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-18-04-bionic-beaver-linux
# Detect the model of nvidia graphic card and recommended driver
ubuntu-drivers devices
sudo ubuntu-drivers autoinstall

# set up symlinks for gcc/g++
sudo ln -s /usr/bin/gcc-6 /usr/local/cuda/bin/gcc
sudo ln -s /usr/bin/g++-6 /usr/local/cuda/bin/g++

# setup your paths
echo 'export PATH=/usr/local/cuda-9.0/bin:$PATH' >> ~/.bashrc
echo 'export LD_LIBRARY_PATH=/usr/local/cuda-9.0/lib64:$LD_LIBRARY_PATH' >> ~/.bashrc
source ~/.bashrc

# install cuDNN v7.3.0
# in order to download cuDNN you have to regeistered here https://developer.nvidia.com/developer-program/signup
# then download cuDNN v7.3 form https://developer.nvidia.com/cudnn
CUDNN_TAR_FILE="cudnn-9.0-linux-x64-v7.3.0.29"
wget https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.2.1/prod/9.0_20180806/${CUDNN_TAR_FILE}
tar -xzvf ${CUDNN_TAR_FILE}

# copy the following files into the cuda toolkit directory.
sudo cp -P cuda/include/cudnn.h /usr/local/cuda-9.0/include
sudo cp -P cuda/lib64/libcudnn* /usr/local/cuda-9.0/lib64/
sudo chmod a+r /usr/local/cuda-9.0/lib64/libcudnn*

# finally, to verify the installation, check
nvidia-smi
nvcc -V

 

혹시 우분투 18.04 LTS 에서 쿠다 10.1을 설치해야 한다면,

[ref link]

mibolee.tistory.com/34

 

[Ubuntu 18.04 LTS] CUDA 10.1 설치

[ref link] gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 CUDA 10.1 Installation on Ubuntu 18.04 CUDA 10.1 Installation on Ubuntu 18.04. GitHub Gist: instantly share code, notes, and sni..

mibolee.tistory.com

 

문제 : WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

 

일단은 아래 명령어를 입력해서 우분투 서버에서 접근할 수 있도록 오픈해준다.

 

$ sudo apt install openssh-server

$ sudo apt install ssh

$ sudo service ssh start

 

그리고나서, 혹시 이전에 접속했던 기록이 있었다면

방화벽 에러

이러한 에러가 나올 것이다.

 

아래의 명령어로 초기화 해준다.

 

$ ssh-keygen -R [IP or DomainName]

$ ssh HOSTNAME@ipAddress

 

이렇게 물어보면 "yes"!

'프로그래밍 > Linux' 카테고리의 다른 글

[Ubuntu 18.04 LTS] Torch7 빌드 에러  (0) 2020.09.29
[Ubuntu 18.04 LTS] CUDA 10.1 설치  (0) 2020.09.29
[Ubuntu 18.04 LTS] CUDA 9.0 설치  (0) 2020.09.29
using System;
using System.Text.RegularExpressions;

namespace RegexTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string input = "CO < SUB > 1 </ SUB > 안녕 < SUB > 2 </ SUB > 하세요 < SUB > 3 </ SUB >";
            Console.WriteLine(str(input));
        }

        public static string str(string input) 
        {
            return Regex.Replace(input, @"<(.|\n)*?>", string.Empty);
        }
    }
}

 

[실행 결과]

DataView dv = table.DefaultView; // DataTable의 View가 있다.

DataSet ds = new DataSet(); // 데이타 set 객체를 생성하고
ds.Tables.Add(dv.ToTable()); // dataSet에 추가!

Sqlite파일을 만들고, 테이블을 만들고, 여러 쿼리를 넣어서 디비 작업을 했는데

 

막상 그 데이터를 눈으로 직접 보는 방법을 찾다가

 

SQLite 전용 브라우저를 알게 되었다.

 

라이센스도 무료로 제공이 되어, 사용하는데 무리가 없었다.

 

[ref link]

sqlitebrowser.org/dl/

 

Downloads - DB Browser for SQLite

(Please consider sponsoring us on Patreon 😄) Windows Our latest release (3.12.0) for Windows: Note - If for any reason the standard Windows release does not work (e.g. gives an error), try a nightly build (below). Nightly builds often fix bugs reported

sqlitebrowser.org

 

위에 사이트에 들어가서 설치를 진행한다.

 

"DB Brower for SQLite - Standard installer for 64-bit Windows" 클릭한다.

(사용중인 운영체제에 맞게 설치를 진행하면 된다.)

 

동의하고 계속 진행.

 

SQLite에서 데스크톱 메뉴로 데이터만 확인할 것이기 때문에 이 기능만 선택했다.

 

이렇게하면 설치 완료!

 

실행화면

+ Recent posts