블로그 이미지
훅크선장

카테고리

분류 전체보기 (361)
사진이야기 (23)
펭귄컴퓨팅 (120)
컴퓨터보안 (84)
절름발이 프로그래머 (59)
하드웨어개조 (23)
멀알려줄까 (35)
홈베이킹&홈쿠킹 (2)
잡다한것들 (15)
Total
Today
Yesterday

달력

« » 2020.4
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

공지사항

태그목록

최근에 올라온 글

'2020/04'에 해당되는 글 2건

  1. 2020.04.16 CentOS 7 또는 RHEL 에서 bat 설치하기
  2. 2020.04.14 CentOS 7 또는 RHEL에서 exa 설치

참조 : https://www.ostechnix.com/bat-a-cat-clone-with-syntax-highlighting-and-git-integration/

 

Bat - A Cat Clone With Syntax Highlighting And Git Integration

Bat command is a clone to the cat command, with some additional cool features such as syntax highlighting, git integration and automatic paging etc.

www.ostechnix.com

리눅스에서의 cat 명령어를 대체하는  rust 기반의 bat 이라는 명령어를 설치하는 과정입니다.

 

1. 먼저 rust 환경을 설치합니다.

# curl https://sh.rustup.rs -sSf |sh

# source $HOME/.cargo/env

 

2. 필요 패키지 설치

# yum install clang

 

3. bat 빌드와 설치 

# cargo install bat

 

-----------------------------------------------------------------------------------------

실제 진행상황

[root@server ~]# curl https://sh.rustup.rs -sSf |sh

info: downloading installer

 

Welcome to Rust!

 

This will download and install the official compiler for the Rust

programming language, and its package manager, Cargo.

 

It will add the cargo, rustc, rustup and other commands to

Cargo's bin directory, located at:

 

  /root/.cargo/bin

 

This can be modified with the CARGO_HOME environment variable.

 

Rustup metadata and toolchains will be installed into the Rustup

home directory, located at:

 

  /root/.rustup

 

This can be modified with the RUSTUP_HOME environment variable.

 

This path will then be added to your PATH environment variable by

modifying the profile files located at:

 

  /root/.profile

/root/.bash_profile

 

You can uninstall at any time with rustup self uninstall and

these changes will be reverted.

 

Current installation options:

 

 

   default host triple: x86_64-unknown-linux-gnu

     default toolchain: stable

               profile: default

  modify PATH variable: yes

 

1) Proceed with installation (default)

2) Customize installation

3) Cancel installation

>1

 

info: profile set to 'default'

info: default host triple is x86_64-unknown-linux-gnu

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)

info: downloading component 'cargo'

info: downloading component 'clippy'

info: downloading component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)  11.1 MiB/s in  1s ETA:  0s

info: downloading component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  10.9 MiB/s in  1s ETA:  0s

info: downloading component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.1 MiB/s in  5s ETA:  0s

info: downloading component 'rustfmt'

info: installing component 'cargo'

info: installing component 'clippy'

info: installing component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)   7.4 MiB/s in  1s ETA:  0s

info: installing component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  11.8 MiB/s in  1s ETA:  0s

info: installing component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.5 MiB/s in  5s ETA:  0s

info: installing component 'rustfmt'

info: default toolchain set to 'stable'

 

  stable installed - rustc 1.42.0 (b8cedc004 2020-03-09)

 

 

Rust is installed now. Great!

 

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH

environment variable. Next time you log in this will be done

automatically.

 

To configure your current shell run source $HOME/.cargo/env

[root@server ~]# source $HOME/.cargo/env

[root@server ~]# yum install

clang

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirror.kakao.com

 * extras: mirror.kakao.com

 * updates: mirror.kakao.com

Resolving Dependencies

--> Running transaction check

---> Package clang.x86_64 0:3.4.2-8.el7 will be installed

--> Processing Dependency: llvm(x86-64) = 3.4.2-8.el7 for package: clang-3.4.2-8.el7.x86_64

--> Processing Dependency: libLLVM-3.4.so()(64bit) for package: clang-3.4.2-8.el7.x86_64

--> Running transaction check

---> Package llvm.x86_64 0:3.4.2-8.el7 will be installed

---> Package llvm-libs.x86_64 0:3.4.2-8.el7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=================================================================================================================================================

 Package                            Arch                            Version                                Repository                       Size

=================================================================================================================================================

Installing:

 clang                              x86_64                          3.4.2-8.el7                            extras                           19 M

Installing for dependencies:

 llvm                               x86_64                          3.4.2-8.el7                            extras                          1.3 M

 llvm-libs                          x86_64                          3.4.2-8.el7                            extras                          7.6 M

 

Transaction Summary

=================================================================================================================================================

Install  1 Package (+2 Dependent packages)

 

Total download size: 28 M

Installed size: 93 M

Is this ok [y/d/N]: y

Downloading packages:

(1/3): llvm-libs-3.4.2-8.el7.x86_64.rpm                                                                                   | 7.6 MB  00:00:01     

(2/3): llvm-3.4.2-8.el7.x86_64.rpm                                                                                        | 1.3 MB  00:00:01     

(3/3): clang-3.4.2-8.el7.x86_64.rpm                                                                                       |  19 MB  00:00:03     

-------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                            8.6 MB/s |  28 MB  00:00:03     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : llvm-libs-3.4.2-8.el7.x86_64                                                                                                  1/3 

  Installing : llvm-3.4.2-8.el7.x86_64                                                                                                       2/3 

  Installing : clang-3.4.2-8.el7.x86_64                                                                                                      3/3 

  Verifying  : clang-3.4.2-8.el7.x86_64                                                                                                      1/3 

  Verifying  : llvm-libs-3.4.2-8.el7.x86_64                                                                                                  2/3 

  Verifying  : llvm-3.4.2-8.el7.x86_64                                                                                                       3/3 

 

Installed:

  clang.x86_64 0:3.4.2-8.el7                                                                                                                     

 

Dependency Installed:

  llvm.x86_64 0:3.4.2-8.el7                                            llvm-libs.x86_64 0:3.4.2-8.el7                                           

 

Complete!

[root@server ~]# cargo install bat

    Updating crates.io index

  Installing bat v0.13.0

   Compiling libc v0.2.69

   Compiling memchr v2.3.3

   Compiling proc-macro2 v1.0.10

   Compiling unicode-xid v0.2.0

   Compiling cfg-if v0.1.10

   Compiling syn v1.0.17

   Compiling proc-macro2 v0.4.30

   Compiling lazy_static v1.4.0

   Compiling unicode-xid v0.1.0

   Compiling autocfg v1.0.0

   Compiling serde v1.0.106

   Compiling regex-syntax v0.6.17

   Compiling byteorder v1.3.4

   Compiling bitflags v1.2.1

   Compiling pkg-config v0.3.17

   Compiling log v0.4.8

   Compiling unicode-width v0.1.7

   Compiling version_check v0.1.5

   Compiling glob v0.3.0

   Compiling ucd-trie v0.1.3

   Compiling matches v0.1.8

   Compiling rustc-demangle v0.1.16

   Compiling vec_map v0.8.1

   Compiling ansi_term v0.11.0

   Compiling quick-error v1.2.3

   Compiling strsim v0.8.0

   Compiling smallvec v1.3.0

   Compiling maplit v1.0.2

   Compiling either v1.5.3

   Compiling bindgen v0.50.1

   Compiling syn v0.15.44

   Compiling liquid-error v0.19.0

   Compiling termcolor v1.1.0

   Compiling shlex v0.1.1

   Compiling proc-macro-hack v0.5.15

   Compiling encoding_index_tests v0.1.4

   Compiling peeking_take_while v0.1.2

   Compiling anymap v0.12.1

   Compiling doc-comment v0.3.3

   Compiling crc32fast v1.2.0

   Compiling percent-encoding v1.0.1

   Compiling ryu v1.0.3

   Compiling version_check v0.9.1

   Compiling adler32 v1.0.4

   Compiling deunicode v1.1.0

   Compiling unicode-segmentation v1.6.0

   Compiling safemem v0.3.3

   Compiling itoa v0.4.5

   Compiling percent-encoding v2.1.0

   Compiling xml-rs v0.8.2

   Compiling same-file v1.0.6

   Compiling linked-hash-map v0.5.2

   Compiling fnv v1.0.6

   Compiling lazycell v1.2.1

   Compiling ansi_term v0.12.1

   Compiling shell-words v0.1.0

   Compiling wild v2.0.2

   Compiling unicode-bidi v0.3.4

   Compiling encoding-index-singlebyte v1.20141219.5

   Compiling encoding-index-japanese v1.20141219.5

   Compiling encoding-index-simpchinese v1.20141219.5

   Compiling encoding-index-tradchinese v1.20141219.5

   Compiling encoding-index-korean v1.20141219.5

   Compiling thread_local v1.0.1

   Compiling humantime v1.3.0

   Compiling line-wrap v0.1.1

   Compiling miniz_oxide v0.3.6

   Compiling pest v2.1.3

   Compiling walkdir v2.3.1

   Compiling itertools v0.8.2

   Compiling unicode-normalization v0.1.12

   Compiling yaml-rust v0.4.3

   Compiling encoding v0.2.33

   Compiling aho-corasick v0.7.10

   Compiling bstr v0.2.12

   Compiling content_inspector v0.2.4

   Compiling num-traits v0.2.11

   Compiling num-integer v0.1.42

   Compiling quote v0.6.13

   Compiling nom v4.2.3

   Compiling error-chain v0.12.2

   Compiling quote v1.0.3

   Compiling idna v0.1.5

   Compiling idna v0.2.0

   Compiling clang-sys v0.28.1

   Compiling fxhash v0.2.1

   Compiling base64 v0.10.1

   Compiling pest_meta v2.1.3

   Compiling jobserver v0.1.21

   Compiling atty v0.2.14

   Compiling term_size v0.3.1

   Compiling time v0.1.42

   Compiling flate2 v1.0.14

   Compiling termios v0.3.2

   Compiling clicolors-control v1.0.1

   Compiling dirs-sys v0.3.4

   Compiling textwrap v0.11.0

   Compiling cc v1.0.50

   Compiling url v1.7.2

   Compiling dirs v2.0.2

   Compiling url v2.1.1

   Compiling clap v2.33.0

   Compiling cexpr v0.3.6

   Compiling regex v1.3.6

   Compiling chrono v0.4.11

   Compiling proc-quote-impl v0.2.2

   Compiling pest_generator v2.1.3

   Compiling env_logger v0.6.2

   Compiling console v0.10.0

   Compiling globset v0.4.5

   Compiling proc-quote v0.2.2

   Compiling backtrace-sys v0.1.35

   Compiling libloading v0.5.2

   Compiling libz-sys v1.0.25

   Compiling libgit2-sys v0.12.3+1.0.0

   Compiling ansi_colours v1.0.1

   Compiling serde_derive v1.0.106

   Compiling backtrace v0.3.46

   Compiling pest_derive v2.1.0

   Compiling failure v0.1.7

   Compiling which v2.0.1

   Compiling git2 v0.13.2

   Compiling onig_sys v69.2.0

   Compiling onig v5.0.0

   Compiling liquid-value v0.19.1

   Compiling serde_json v1.0.51

   Compiling plist v0.4.2

   Compiling bincode v1.2.1

   Compiling liquid-interpreter v0.19.0

   Compiling liquid-compiler v0.19.0

   Compiling syntect v3.3.0

   Compiling liquid-derive v0.19.0

   Compiling liquid v0.19.0

   Compiling bat v0.13.0

    Finished release [optimized] target(s) in 1m 43s

  Installing /root/.cargo/bin/bat

   Installed package `bat v0.13.0` (executable `bat`)

[root@server ~]#

 

Posted by 훅크선장
, |

https://www.2daygeek.com/exa-a-modern-replacement-for-ls-command-linux/

 

Exa – A modern and colorful replacement for list(ls) command written in Rust

ls(list) is one of the very basic & essential Linux command for administrator that can be used in most of the actions (in other hands, Linux administrator can’t live without ls command). …

www.2daygeek.com

 

Rust로 쓰여진 ls 명령어의 대체, 새롭고 색상이 다채로운 exa 설치하기 (CentOS 7에서 성공)

 

1. 먼저 사전 필요한 프로그램 환경 설치

# curl https://sh.rustup.rs -sSf |sh

# source $HOME/.cargo/env

 

2. 필요 패키지 설치

# yum install libgit2 cmake git http-parser

 

3. exa 소스코드 다운로드 및 빌드 

# git clone https://github.com/ogham/exa.git && cd exa

# make install

 

-----------------------------------------------------------------------------------------

실제 진행상황

[root@server ~]# curl https://sh.rustup.rs -sSf |sh

info: downloading installer

 

Welcome to Rust!

 

This will download and install the official compiler for the Rust

programming language, and its package manager, Cargo.

 

It will add the cargo, rustc, rustup and other commands to

Cargo's bin directory, located at:

 

  /root/.cargo/bin

 

This can be modified with the CARGO_HOME environment variable.

 

Rustup metadata and toolchains will be installed into the Rustup

home directory, located at:

 

  /root/.rustup

 

This can be modified with the RUSTUP_HOME environment variable.

 

This path will then be added to your PATH environment variable by

modifying the profile files located at:

 

  /root/.profile

/root/.bash_profile

 

You can uninstall at any time with rustup self uninstall and

these changes will be reverted.

 

Current installation options:

 

 

   default host triple: x86_64-unknown-linux-gnu

     default toolchain: stable

               profile: default

  modify PATH variable: yes

 

1) Proceed with installation (default)

2) Customize installation

3) Cancel installation

>1

 

info: profile set to 'default'

info: default host triple is x86_64-unknown-linux-gnu

info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu'

info: latest update on 2020-03-12, rust version 1.42.0 (b8cedc004 2020-03-09)

info: downloading component 'cargo'

info: downloading component 'clippy'

info: downloading component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)  11.1 MiB/s in  1s ETA:  0s

info: downloading component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  10.9 MiB/s in  1s ETA:  0s

info: downloading component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.1 MiB/s in  5s ETA:  0s

info: downloading component 'rustfmt'

info: installing component 'cargo'

info: installing component 'clippy'

info: installing component 'rust-docs'

 12.0 MiB /  12.0 MiB (100 %)   7.4 MiB/s in  1s ETA:  0s

info: installing component 'rust-std'

 17.1 MiB /  17.1 MiB (100 %)  11.8 MiB/s in  1s ETA:  0s

info: installing component 'rustc'

 58.6 MiB /  58.6 MiB (100 %)  11.5 MiB/s in  5s ETA:  0s

info: installing component 'rustfmt'

info: default toolchain set to 'stable'

 

  stable installed - rustc 1.42.0 (b8cedc004 2020-03-09)

 

 

Rust is installed now. Great!

 

To get started you need Cargo's bin directory ($HOME/.cargo/bin) in your PATH

environment variable. Next time you log in this will be done

automatically.

 

To configure your current shell run source $HOME/.cargo/env

[root@server ~]# source $HOME/.cargo/env

[root@server ~]# yum install libgit2 cmake git http-parser

Loaded plugins: fastestmirror

Loading mirror speeds from cached hostfile

 * base: mirror.kakao.com

 * extras: mirror.kakao.com

 * updates: mirror.kakao.com

Package git-1.8.3.1-21.el7_7.x86_64 already installed and latest version

Resolving Dependencies

--> Running transaction check

---> Package cmake.x86_64 0:2.8.12.2-2.el7 will be installed

--> Processing Dependency: libarchive.so.13()(64bit) for package: cmake-2.8.12.2-2.el7.x86_64

---> Package http-parser.x86_64 0:2.7.1-8.el7_7.2 will be installed

---> Package libgit2.x86_64 0:0.26.6-1.el7 will be installed

--> Running transaction check

---> Package libarchive.x86_64 0:3.1.2-14.el7_7 will be installed

--> Finished Dependency Resolution

 

Dependencies Resolved

 

=================================================================================================================================================================================

 Package                                    Arch                                  Version                                           Repository                              Size

=================================================================================================================================================================================

Installing:

 cmake                                      x86_64                                2.8.12.2-2.el7                                    base                                   7.1 M

 http-parser                                x86_64                                2.7.1-8.el7_7.2                                   updates                                 29 k

 libgit2                                    x86_64                                0.26.6-1.el7                                      extras                                 429 k

Installing for dependencies:

 libarchive                                 x86_64                                3.1.2-14.el7_7                                    updates                                319 k

 

Transaction Summary

=================================================================================================================================================================================

Install  3 Packages (+1 Dependent package)

 

Total download size: 7.8 M

Installed size: 29 M

Is this ok [y/d/N]: y

Downloading packages:

(1/4): http-parser-2.7.1-8.el7_7.2.x86_64.rpm                                                                                                             |  29 kB  00:00:00     

(2/4): libgit2-0.26.6-1.el7.x86_64.rpm                                                                                                                    | 429 kB  00:00:00     

(3/4): libarchive-3.1.2-14.el7_7.x86_64.rpm                                                                                                               | 319 kB  00:00:00     

(4/4): cmake-2.8.12.2-2.el7.x86_64.rpm                                                                                                                    | 7.1 MB  00:00:00     

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Total                                                                                                                                            8.0 MB/s | 7.8 MB  00:00:00     

Running transaction check

Running transaction test

Transaction test succeeded

Running transaction

  Installing : libarchive-3.1.2-14.el7_7.x86_64                                                                                                                              1/4 

  Installing : http-parser-2.7.1-8.el7_7.2.x86_64                                                                                                                            2/4 

  Installing : libgit2-0.26.6-1.el7.x86_64                                                                                                                                   3/4 

  Installing : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                   4/4 

  Verifying  : http-parser-2.7.1-8.el7_7.2.x86_64                                                                                                                            1/4 

  Verifying  : libgit2-0.26.6-1.el7.x86_64                                                                                                                                   2/4 

  Verifying  : cmake-2.8.12.2-2.el7.x86_64                                                                                                                                   3/4 

  Verifying  : libarchive-3.1.2-14.el7_7.x86_64                                                                                                                              4/4 

 

Installed:

  cmake.x86_64 0:2.8.12.2-2.el7                           http-parser.x86_64 0:2.7.1-8.el7_7.2                           libgit2.x86_64 0:0.26.6-1.el7                          

 

Dependency Installed:

  libarchive.x86_64 0:3.1.2-14.el7_7                                                                                                                                             

 

Complete!

[root@server ~]# git clone https://github.com/ogham/exa.git && cd exa

Cloning into 'exa'...

remote: Enumerating objects: 6, done.

remote: Counting objects: 100% (6/6), done.

remote: Compressing objects: 100% (6/6), done.

remote: Total 6903 (delta 0), reused 1 (delta 0), pack-reused 6897

Receiving objects: 100% (6903/6903), 3.24 MiB | 1.53 MiB/s, done.

Resolving deltas: 100% (4914/4914), done.

[root@server exa]# make install

cargo build --release --no-default-features --features "default"

    Updating crates.io index

  Downloaded glob v0.3.0

  Downloaded ansi_term v0.12.0

  Downloaded term_grid v0.1.7

  Downloaded locale v0.2.2

  Downloaded env_logger v0.6.2

  Downloaded users v0.9.1

  Downloaded natord v1.0.9

  Downloaded unicode-width v0.1.5

  Downloaded term_size v0.3.1

  Downloaded scoped_threadpool v0.1.9

  Downloaded number_prefix v0.3.0

  Downloaded zoneinfo_compiled v0.4.8

  Downloaded git2 v0.9.1

  Downloaded datetime v0.4.7

  Downloaded libc v0.2.60

  Downloaded num-traits v0.1.43

  Downloaded num_cpus v1.10.1

  Downloaded lazy_static v1.3.0

  Downloaded byteorder v1.3.2

  Downloaded log v0.4.7

  Downloaded termcolor v1.0.5

  Downloaded pad v0.1.5

  Downloaded iso8601 v0.1.1

  Downloaded url v1.7.2

  Downloaded libgit2-sys v0.8.1

  Downloaded humantime v1.2.0

  Downloaded atty v0.2.13

  Downloaded matches v0.1.8

  Downloaded percent-encoding v1.0.1

  Downloaded bitflags v1.1.0

  Downloaded pkg-config v0.3.14

  Downloaded regex v1.1.9

  Downloaded num-traits v0.2.8

  Downloaded idna v0.1.5

  Downloaded cfg-if v0.1.9

  Downloaded libz-sys v1.0.25

  Downloaded nom v1.2.4

  Downloaded cc v1.0.37

  Downloaded quick-error v1.2.2

  Downloaded autocfg v0.1.5

  Downloaded thread_local v0.3.6

  Downloaded unicode-bidi v0.3.4

  Downloaded unicode-normalization v0.1.8

  Downloaded memchr v2.2.1

  Downloaded utf8-ranges v1.0.3

  Downloaded aho-corasick v0.7.4

  Downloaded regex-syntax v0.6.8

  Downloaded ucd-util v0.1.3

  Downloaded smallvec v0.6.10

   Compiling libc v0.2.60

   Compiling autocfg v0.1.5

   Compiling pkg-config v0.3.14

   Compiling cc v1.0.37

   Compiling memchr v2.2.1

   Compiling smallvec v0.6.10

   Compiling unicode-width v0.1.5

   Compiling nom v1.2.4

   Compiling matches v0.1.8

   Compiling log v0.4.7

   Compiling regex v1.1.9

   Compiling cfg-if v0.1.9

   Compiling bitflags v1.1.0

   Compiling byteorder v1.3.2

   Compiling ucd-util v0.1.3

   Compiling lazy_static v1.3.0

   Compiling utf8-ranges v1.0.3

   Compiling percent-encoding v1.0.1

   Compiling quick-error v1.2.2

   Compiling termcolor v1.0.5

   Compiling glob v0.3.0

   Compiling number_prefix v0.3.0

   Compiling ansi_term v0.12.0

   Compiling natord v1.0.9

   Compiling scoped_threadpool v0.1.9

   Compiling unicode-bidi v0.3.4

   Compiling thread_local v0.3.6

   Compiling pad v0.1.5

   Compiling term_grid v0.1.7

   Compiling humantime v1.2.0

   Compiling regex-syntax v0.6.8

   Compiling unicode-normalization v0.1.8

   Compiling iso8601 v0.1.1

   Compiling num-traits v0.2.8

   Compiling aho-corasick v0.7.4

   Compiling locale v0.2.2

   Compiling atty v0.2.13

   Compiling term_size v0.3.1

   Compiling users v0.9.1

   Compiling num_cpus v1.10.1

   Compiling idna v0.1.5

   Compiling num-traits v0.1.43

   Compiling datetime v0.4.7

   Compiling url v1.7.2

   Compiling zoneinfo_compiled v0.4.8

   Compiling exa v0.9.0 (/root/exa)

   Compiling libz-sys v1.0.25

   Compiling libgit2-sys v0.8.1

   Compiling env_logger v0.6.2

   Compiling git2 v0.9.1

    Finished release [optimized] target(s) in 1m 14s

install -m755 -- target/release/exa "/usr/local/bin/"

install -dm755 -- "/usr/local/bin/" "/usr/local/share/man/man1/"

install -m644  -- contrib/man/exa.1 "/usr/local/share/man/man1/"

[root@server exa]# 

Posted by 훅크선장
, |