Linux,Unix,BSD 162

[script] Let's Encrypt SSL 인증서 갱신 스크립트

개요 매 3개월 주기별로 Let's Encrypt SSL 인증서를 갱신할 때마다 일일이 명령어를 쳤던 것을 언젠가 스크립트로 만둘어 두어야 겠다고 생각을 했지만, 게을러서 못만들고 있다가 새로 작성한 것을 정리하여 공유합니다. 스크립트 작성 작성한 전체 스크립트 코드는 다음과 같습니다. #!/bin/bash TARGET_DOMAIN='my.domain' HOME_LETS_ENCRYPT='/share/letsencrypt' TARGET_SSL_DIR='/etc/haproxy/ssl' BACKUP_SSL_DIR='/share/backup/ssl' read -ps "https://www.gabia.com/ 을 브라우저로 실행하고 를 입력하세요 :" docker run -it --rm --name certbot..

Linux,Unix,BSD 2022.01.25

[RPi] 고정(static) IP 설정하기

개요 라즈베리파이에서 고정(static) IP 설정하는 방법을 알아 보겠습니다. IP 주소는 다음과 같이 확인할 수 있습니다. pi@raspberrypi:~ $ ifconfig eth0 eth0: flags=4163 mtu 1500 inet 192.168.0.106 netmask 255.255.255.0 broadcast 192.168.0.255 inet6 fe80::fe37:b375:dd8:ff3b prefixlen 64 scopeid 0x20 ether dc:a6:32:8e:1e:ea txqueuelen 1000 (Ethernet) RX packets 1314 bytes 137055 (133.8 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 18..

[shell] 특정 문자열이 포함된 줄 번호 출력하기

개요쉘에서 파일에서 특정 문자열이 포함된 줄 번호를 출력하는 방법을 알아 보겠습니다.시험환경OS : Ubuntu 20.04 LTS x86_64예제 파일Here are some examples of running GNU Hello. This is the output of the command 'hello': Hello, world! This is the output of the command 'hello --traditional': hello, world This is the output of the command 'hello --greeting=hi': hi grep가장 손쉬운 방법으로 "grep" 명령의 "-n" 옵션을 이용하는 방법입니다. 사용법은 다음과 같습니다.$ ..

Linux,Unix,BSD 2021.10.26

git push error - sha1 file '<stdout>' write error: Broken pipe

문제점 및 증상 프로젝트에서 수정 작업을하고 난 후 GitLab 저장소에 이미지 약 100여개를 추가하고, "git push"를 하였더니 아래와 같은 오류가 발생하였습니다. $ git push Enumerating objects: 74, done. Counting objects: 100% (72/72), done. Delta compression using up to 12 threads Compressing objects: 100% (68/68), done. client_loop: send disconnect: Connection reset by peer Wsend-pack: unexpected disconnect while reading sideband packet fatal: sha1 file '' ..

Linux,Unix,BSD 2021.10.05

git push가 안되는 증상 : "fatal: Could not read from remote repository."

문제점 및 증상 OS 재설치 전, git 을 이용한 clone, push, pull 등은 정상적으로 동작하였으나, OS를 재설치한 이후에 push하려고 하면 다음과 같이 "fatal: Could not read from remote repository." 오류가 발생하며 push가 실패하는 문제가 발생하였습니다. > git push fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 원인분석 다음과 같이 ssh 명령으로 직접 GitLab 서버에 접속해 보았더니, 다음과 같이 SSH2_MSG_KEX_ECDH_REPLY 이후에 연결이 끊어..

Linux,Unix,BSD 2021.09.27

[linux] 시스템 재부팅 및 동작시간 확인하기

개요리눅스 시스템이 부팅되어 동작한 시각을 확인할 때는 "uptime" 명령을, 부팅 시각을 확인할 때는 "last reboot" 명령을 이용합니다. 각 명령들에 대하여 자세히 알아 보겠습니다. 사용환경CPUIntel Xeon(R) E5-1620RAM24 GBOSUbuntu 20.04uptime"uptime" 명령은 리눅스 시스템이 부팅되어 동작한 시각을 확인할 수 있습니다. 다음은 간단한 사용예입니다.$ uptime 11:48:52 up 100 days, 1:28, 4 users, load average: 0.02, 0.06, 0.02$ uptime -pup 5 hours, 9 minutes$ uptime -s2020-09-24 07:00:48 "-s" 옵션을 이용하여 uptime으로도 부팅 시각..

Linux,Unix,BSD 2021.09.24

[git] Linux 터미널에서 암호 저장 설정하기

개요 원격의 Linux 터미널에서 개발하여 소스의 버전 관리를 위하여 https로 git을 이용할 경우, 저장소에 대한 비밀번호를 매번 입력해야 하는 불편함이 있습니다. hunature@rock-5b:~/vas2/src$ git pull Username for 'https://git.my.domain': hanwh Password for 'https://hanwh@git.my.domain': Already up to date. https git 저장소를 이용할 경우, VS code에서는 다음과 같이 별도 창에서 사용자 계정 및 비밀번호를 확인하게 됩니다. git에서 입력한 비밀번호를 일정시간 동안 저장하여 개발하는 동안 다시 비밀번호를 묻지 않도록 하는 방법을 알아 보겠습니다. git 암호 저장 설정 단..

Linux,Unix,BSD 2021.09.12

Ubuntu 20.04.2 LTS 에서 랜카드의 속도 확인 방법

우분투 장비에서 네트워크 카드의 물리적 속도를 확인하는 방법을 정리해 둡니다. 구글을 통하여 검색해 보면, 크게 두 가지 방법으로 요약할 수 있습니다. 첫 번째 방법은 아래와 같이 "ip" 명령을 통하여 "qlen" 값을 확인하는 방법입니다. hbesthee@hbesthee-ThinkStation-P500:~$ ip a 1: lo: mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 inet 127.0.0.1/8 scope host lo valid_lft forever preferred_lft forever inet6 ::1/128 scope host..

Linux,Unix,BSD 2021.08.23

[vim] 자주 사용하는 설정: 탭크기, 줄번호 등

개요 vim을 이용하면서 자주 사용하는 설정들을 정리해 둡니다. ~/.vimrc " visual mode hot-key map :set mouse=a map :set mouse-=a " default visual mode disabled set mouse-=a " line number set nu " bottom ruler set ruler set showmatch " tab size set ts=4 탭크기 "set ts" 항목으로 설정합니다. 기본값은 8입니다. 마우스 비주얼 모드 "set mouse" 항목으로 설정합니다. "mouse=a"로 설정하면 비주얼 모드가 활성화 되고, "set mouse-=a"로 설정하면 비주얼 모드가 비활성화 됩니다. .vimrc에 비주얼 모드를 비활성화해 두었습니다. 주..

Linux,Unix,BSD 2021.08.11
728x90