'Linux'에 해당되는 글 766건

  1. 2023.10.18 multitail / tail 2
  2. 2023.10.17 top 로그로 남기기
  3. 2023.09.04 tcpdump
  4. 2023.09.01 dhcpd IP 할당 규칙
  5. 2023.08.30 시스템 audit 로그
  6. 2023.08.28 debian nvme tool
  7. 2023.08.17 edid-read
  8. 2023.08.08 .bashrc 설정 history
  9. 2023.07.27 lvmcache bcache
  10. 2023.07.24 ubutnu file(파일) 에서 삼바 목록 안나오고 부적절한 인수 에러
Linux2023. 10. 18. 10:33

여러개의 로그에 동시 다발적으로 추가되는 내용을

하나의 파일로 합쳐서 보고 싶어서 고민때리고 있었는데

 

어... 라? tail에 파일 인자가 한개가 아니....다?!

NAME
       tail - output the last part of files

SYNOPSIS
       tail [OPTION]... [FILE]...

 

tail -f <file1> <file2>

[링크 : https://unix.stackexchange.com/questions/149017/how-to-tail-multiple-files-using-tail-0f-in-linux-aix]

 

표준(?) tail에서는 지원안해서 multi tail 이라는 별도 유틸리티를 쓰면 된다는데 

gnu tail은 지원한다고 하니 그냥 기억만 해두면 될 듯.

$ multitail
명령어 'multitail' 을(를) 찾을 수 없습니다. 그러나 다음을 통해 설치할 수 있습니다:
sudo apt install multitail

'Linux' 카테고리의 다른 글

리눅스 파일 시스템 캐싱  (0) 2024.01.09
minicom에서 stty로 터미널 폭 조절하기  (0) 2023.10.24
top 로그로 남기기  (0) 2023.10.17
tcpdump  (0) 2023.09.04
dhcpd IP 할당 규칙  (0) 2023.09.01
Posted by 구차니
Linux2023. 10. 17. 19:44

top이 ncurse로 만들어져서

원하는 내용만 파일로 로그 남기기가 쉽지 않다

 

아래처럼 하면 1초에 1번 top을 실행해서 top.log에 쭈욱 쌓아둘수 있다.

$ top -b -d 1 > top.log

 

batch의 b

       -b  :Batch-mode operation
            Starts top in Batch mode, which could be useful for sending output
            from  top  to other programs or to a file.  In this mode, top will
            not accept input and runs until the iterations  limit  you've  set
            with the `-n' command-line option or until killed.

[링크 : https://qkr3232.tistory.com/136]

'Linux' 카테고리의 다른 글

minicom에서 stty로 터미널 폭 조절하기  (0) 2023.10.24
multitail / tail  (2) 2023.10.18
tcpdump  (0) 2023.09.04
dhcpd IP 할당 규칙  (0) 2023.09.01
시스템 audit 로그  (0) 2023.08.30
Posted by 구차니
Linux2023. 9. 4. 10:14

원인불명(?)으로 랜이 엄청나게 깜박여서 확인겸

어떤 소켓이나 어떤 포트로 요청이 들어오나 찾는법을 검색해보는데

tcpdump를 실행하면 된다고 해서 깔아봄

 

2995 packets captured
3250 packets received by filter
239 packets dropped by kernel

[링크 : https://stackoverflow.com/questions/21937162/how-to-find-out-the-number-of-transmitted-received-bytes-for-a-socket]

 

-n 줘서 resolve 안하면 drop이 줄어든다는데

도대체 머가 drop 되는진 어떻게 알 수 있을까?

[링크 : http://www.packetinside.com/2010/11/커널에서-drop-되는-패킷-수가-많다면.html]

'Linux' 카테고리의 다른 글

multitail / tail  (2) 2023.10.18
top 로그로 남기기  (0) 2023.10.17
dhcpd IP 할당 규칙  (0) 2023.09.01
시스템 audit 로그  (0) 2023.08.30
.bashrc 설정 history  (0) 2023.08.08
Posted by 구차니
Linux2023. 9. 1. 15:39

mac의 oui에 따라서 ip 대역을 다르게 할당하는 방법인.. 듯?

class "kvm" {
   match if binary-to-ascii(16,8,":",substring(hardware, 1, 2)) = "56:11";
}

class "local" {
   match if binary-to-ascii(16,8,":",substring(hardware, 1, 2)) = "52:54";
}

host meme {
 fixed-address 10.1.0.254;
}

host server247 {
  hardware ethernet 52:54:00:2f:ea:07;
  fixed-address 10.1.0.247;
}

subnet 10.1.0.224 netmask 255.255.255.224 {
  option routers 10.1.0.225;
  pool {
     allow members of "kvm";
     range 10.1.0.226 10.1.0.235;
  }
  pool {
     allow members of "local";
     range 10.1.0.236 10.1.0.240;
  }
  pool {
     # Don't use this pool. It is really just a range to reserve
     # for fixed addresses defined per host, above.
     allow known-clients;
     range 10.1.0.241 10.1.0.253;
  }
}

[링크 : https://serverfault.com/questions/79748/assign-dhcp-ips-for-specific-mac-prefixes]

 

예 14.3. DHCP를 사용하여 고정 IP 주소

host apex {
   option host-name "apex.example.com";
   hardware ethernet 00:A0:78:8E:9E:AA;
   fixed-address 192.168.1.4;
}

 

예 14.6. “그룹 선언” 에서 시연한 대로 그룹 선언은 선언 그룹에 전역 매개 변수를 적용하는 데 사용됩니다. 예를 들어 공유 네트워크, 서브넷 및 호스트를 그룹화할 수 있습니다.
예 14.6. 그룹 선언

group {
   option routers                  192.168.1.254;
   option subnet-mask              255.255.255.0;
   option domain-search              "example.com";
   option domain-name-servers       192.168.1.1;
   option time-offset              -18000;     # Eastern Standard Time
   host apex {
      option host-name "apex.example.com";
      hardware ethernet 00:A0:78:8E:9E:AA;
      fixed-address 192.168.1.4;
   }
   host raleigh {
      option host-name "raleigh.example.com";
      hardware ethernet 00:A1:DD:74:C3:F2;
      fixed-address 192.168.1.6;
   }
}

[링크 : https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/7/html/networking_guide/sec-dhcp-configuring-server]

'Linux' 카테고리의 다른 글

top 로그로 남기기  (0) 2023.10.17
tcpdump  (0) 2023.09.04
시스템 audit 로그  (0) 2023.08.30
.bashrc 설정 history  (0) 2023.08.08
lvmcache bcache  (0) 2023.07.27
Posted by 구차니
Linux2023. 8. 30. 10:59

audit이 자꾸 먼가 떠서 무슨 내용인지 보려는데 무슨 소리인지 ㅠㅠ

[   11.843605] audit: type=1006 audit(1693798687.793:2): pid=487 uid=0 old-auid1
[   11.856080] audit: type=1300 audit(1693798687.793:2): arch=c00000b7 syscall=)
[   11.882615] audit: type=1327 audit(1693798687.793:2): proctitle="(systemd)"

 

type을 기호로 보여주는건 없나?

 

/* The netlink messages for the audit system is divided into blocks:
 * 1000 - 1099 are for commanding the audit system
 * 1100 - 1199 user space trusted application messages
 * 1200 - 1299 messages internal to the audit daemon
 * 1300 - 1399 audit event messages
 * 1400 - 1499 SE Linux use
 * 1500 - 1599 kernel LSPP events
 * 1600 - 1699 kernel crypto events
 * 1700 - 1799 kernel anomaly records
 * 1800 - 1899 kernel integrity events
 * 1900 - 1999 future kernel use
 * 2000 is for otherwise unclassified kernel audit messages (legacy)
 * 2001 - 2099 unused (kernel)
 * 2100 - 2199 user space anomaly records
 * 2200 - 2299 user space actions taken in response to anomalies
 * 2300 - 2399 user space generated LSPP events
 * 2400 - 2499 user space crypto events
 * 2500 - 2999 future user space (maybe integrity labels and related events)
 *
 * Messages from 1000-1199 are bi-directional. 1200-1299 & 2100 - 2999 are
 * exclusively user space. 1300-2099 is kernel --> user space 
 * communication.
 */

#define AUDIT_LOGIN                1006        /* Define the login id and information */

[링크 : https://sites.uclouvain.be/SystInfo/usr/include/linux/audit.h.html]

 

[링크 : https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/7/html/security_guide/sec-understanding_audit_log_files]

[링크 : https://access.redhat.com/documentation/ko-kr/red_hat_enterprise_linux/7/html/security_guide/chap-system_auditing]

'Linux' 카테고리의 다른 글

tcpdump  (0) 2023.09.04
dhcpd IP 할당 규칙  (0) 2023.09.01
.bashrc 설정 history  (0) 2023.08.08
lvmcache bcache  (0) 2023.07.27
sysfs ethernet link status  (0) 2023.05.17
Posted by 구차니
Linux/Ubuntu2023. 8. 28. 12:27

프리징이 조금씩 걸리는 느낌이라 불안해서 상태보는 걸 찾는 중인데..

nvme 라는 다른 유틸리티로 봐야 하는 듯.. smartctl 로는 안되나?

 

$ sudo apt-get install nvme-cli
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다... 완료
상태 정보를 읽는 중입니다... 완료        
다음 새 패키지를 설치할 것입니다:
  nvme-cli
0개 업그레이드, 1개 새로 설치, 0개 제거 및 3개 업그레이드 안 함.
474 k바이트 아카이브를 받아야 합니다.
이 작업 후 1,136 k바이트의 디스크 공간을 더 사용하게 됩니다.
받기:1 http://kr.archive.ubuntu.com/ubuntu jammy-updates/main amd64 nvme-cli amd64 1.16-3ubuntu0.1 [474 kB]
내려받기 474 k바이트, 소요시간 2초 (229 k바이트/초)
Selecting previously unselected package nvme-cli.
(데이터베이스 읽는중 ...현재 255415개의 파일과 디렉터리가 설치되어 있습니다.)
Preparing to unpack .../nvme-cli_1.16-3ubuntu0.1_amd64.deb ...
Unpacking nvme-cli (1.16-3ubuntu0.1) ...
nvme-cli (1.16-3ubuntu0.1) 설정하는 중입니다 ...
Created symlink /etc/systemd/system/default.target.wants/nvmefc-boot-connections.service → /lib/systemd/system/nvmefc-boot-connections.service.
Created symlink /etc/systemd/system/default.target.wants/nvmf-autoconnect.service → /lib/systemd/system/nvmf-autoconnect.service.
nvmf-connect.target is a disabled or a static unit, not starting it.
Processing triggers for man-db (2.10.2-1) ...


$ sudo nvme list
Node                  SN                   Model                                    Namespace Usage                      Format           FW Rev  
--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- --------
/dev/nvme0n1          S649NL0W000000F      Samsung SSD 980 1TB                      1         229.90  GB /   1.00  TB    512   B +  0 B   3B4QFXO7



$ sudo nvme smart-log /dev/nvme0
Smart Log for NVME device:nvme0 namespace-id:ffffffff
critical_warning : 0
temperature : 41 C (314 Kelvin)
available_spare : 100%
available_spare_threshold : 10%
percentage_used : 0%
endurance group critical warning summary: 0
data_units_read : 483,823
data_units_written : 1,853,867
host_read_commands : 5,443,068
host_write_commands : 31,140,950
controller_busy_time : 94
power_cycles : 48
power_on_hours : 72
unsafe_shutdowns : 9
media_errors : 0
num_err_log_entries : 0
Warning Temperature Time : 0
Critical Composite Temperature Time : 0
Temperature Sensor 1           : 41 C (314 Kelvin)
Temperature Sensor 2           : 40 C (313 Kelvin)
Thermal Management T1 Trans Count : 0
Thermal Management T2 Trans Count : 0
Thermal Management T1 Total Time : 0
Thermal Management T2 Total Time : 0

[링크 : https://linuxhint.com/check-ssd-health-ubuntu/]

[링크 : https://itslinuxfoss.com/test-ssd-hdd-health-in-linux/]

'Linux > Ubuntu' 카테고리의 다른 글

우분투로 공유기 만들기  (2) 2024.02.23
ubuntu pro?  (2) 2024.01.31
edid-read  (0) 2023.08.17
ubutnu file(파일) 에서 삼바 목록 안나오고 부적절한 인수 에러  (0) 2023.07.24
htop graph style  (0) 2023.07.07
Posted by 구차니
Linux/Ubuntu2023. 8. 17. 16:29

리눅스에서 edid를 보는 또 다른 유틸리티. edid-decode 는 순수하게(?) 해석만 한다면

해당 패키지는 get-edid로 모니터로 부터 edid를 수집하고, parse-edid로 해석을 해준다

 

$ sudo get-edid > /tmp/edid
$ parse-edid < /tmp/edid

[링크 : https://unix.stackexchange.com/questions/114359/how-to-get-edid-for-a-single-monitor]

[링크 : https://packages.debian.org/sid/utils/read-edid]

'Linux > Ubuntu' 카테고리의 다른 글

ubuntu pro?  (2) 2024.01.31
debian nvme tool  (0) 2023.08.28
ubutnu file(파일) 에서 삼바 목록 안나오고 부적절한 인수 에러  (0) 2023.07.24
htop graph style  (0) 2023.07.07
mono-complete  (0) 2023.07.05
Posted by 구차니
Linux2023. 8. 8. 12:09

귀찮으니 정리해서 하나 저장해 놔야지 -_-

export HISTTIMEFORMAT="%y/%m/%d %T "
export PROMPT_COMMAND='history -a'
export PROMPT_COMMAND='echo -e "$(tty)\t$(history 1)" >> ~/bash-history-$(date "+%Y-%m-%d").log' 

'Linux' 카테고리의 다른 글

dhcpd IP 할당 규칙  (0) 2023.09.01
시스템 audit 로그  (0) 2023.08.30
lvmcache bcache  (0) 2023.07.27
sysfs ethernet link status  (0) 2023.05.17
리눅스 커맨드 라인에서 몇줄씩 건너뛰고 출력하기  (0) 2023.03.30
Posted by 구차니
Linux2023. 7. 27. 18:58

lvmcache는 logical volume에 대해서 ssd 캐시를 적용하고

bcache는 블럭 디바이스에 직접 ssd 캐시를 적용한다.

lvm을 좋아하진 않으니.. bcache를 나중에 써봐야지

 

[링크 : https://wiki.archlinux.org/title/bcache]

[링크 : https://wiki.archlinux.org/title/LVM#Cache]

 

'Linux' 카테고리의 다른 글

시스템 audit 로그  (0) 2023.08.30
.bashrc 설정 history  (0) 2023.08.08
sysfs ethernet link status  (0) 2023.05.17
리눅스 커맨드 라인에서 몇줄씩 건너뛰고 출력하기  (0) 2023.03.30
bash completion  (0) 2023.03.27
Posted by 구차니
Linux/Ubuntu2023. 7. 24. 17:37

ubuntu 22.04 인데 smb 서버 쪽이 SMB2 ~ SMB3를 지원하도록 되어있는데도 아래와 같은 에러를 뱉어내며 접근이 안되고

smb://ip/share_name 으로 직접 하면 연결이 되는 기현상 발생.

 

영어로는 아래의 메시지 인 듯.

 “Failed to Retrieve Share List from Server: Invalid Argument”

[링크 : https://www.fosslinux.com/117902/dealing-with-failed-to-retrieve-share-list-error-in-linux-smb-share.htm]

 

아무튼 이래저래 찾아보면서 시도해보니 되는건 아래의 하나.

원인은 서버가 smb1을 지원하지 않아도 gvfsd-smb-browse의 버그로 인해서

smb1을 지원하도록 설정을 해야 인자가 맞아서 돌아가는 것으로 보인다.

Because of a bug in gvfsd-smb-browse the initial contact between client and server is with SMB1.

Edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add:

client min protocol = NT1
server min protocol = NT1

[링크 : https://askubuntu.com/questions/1250885/file-sharing-stopped-working-after-20-04-dist-upgrade]

 

테스트 해보니 나의 경우에는

server min protocol = NT1

만 넣어도 되는데 말들이 많으니 두개다 넣는거 추천

'Linux > Ubuntu' 카테고리의 다른 글

debian nvme tool  (0) 2023.08.28
edid-read  (0) 2023.08.17
htop graph style  (0) 2023.07.07
mono-complete  (0) 2023.07.05
ubuntu 22.04 wayland vs x.org on 4K dual  (0) 2023.06.26
Posted by 구차니