'Linux'에 해당되는 글 785건

  1. 2025.09.22 기본 터미널 변경하기
  2. 2025.09.19 proc fs smp_affinity
  3. 2025.09.17 sudo time
  4. 2025.08.12 intel dri 3?
  5. 2025.07.24 dd 로 덤프 하면서 바로 압축하기
  6. 2025.07.17 gpiod - gpiomon
  7. 2025.07.11 csvtool
  8. 2025.07.01 ubuntu dhcp lease log
  9. 2025.06.28 우분투에서 스타크래프트 시도.. 실패
  10. 2025.03.06 netplan
Linux/Ubuntu2025. 9. 22. 22:00

odroid c2 / armbian 쓰는데 termiantor 가 기본 터미널이라 쓸데없이(!) 폰트만 커서 마음에 안들어

변경하는법 찾음. 단축키로는 x-terminal-emulator가 실행되고

이게 연결된 프로그램으로 넘겨주는 듯 한데, gnome-terminal이 간결하고 짱이지 ㅋ

$ sudo update-alternatives --config x-terminal-emulator
대체 항목 x-terminal-emulator에 대해 (/usr/bin/x-terminal-emulator 제공) 2개 선택이 있습니다.

  선택       경로                           우선순� 상태
------------------------------------------------------------
* 0            /usr/bin/terminator               50        자동 모드
  1            /usr/bin/gnome-terminal.wrapper   40        수동 모드
  2            /usr/bin/terminator               50        수동 모드

Press <enter> to keep the current choice[*], or type selection number: 1
update-alternatives: using /usr/bin/gnome-terminal.wrapper to provide /usr/bin/x-terminal-emulator (x-terminal-emulator) in manual mode

[link : https://stackoverflow.com/questions/16808231/how-do-i-set-default-terminal-to-terminator]

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

intel dri 3?  (0) 2025.08.12
csvtool  (0) 2025.07.11
ubuntu dhcp lease log  (0) 2025.07.01
우분투에서 스타크래프트 시도.. 실패  (0) 2025.06.28
netplan  (0) 2025.03.06
Posted by 구차니
Linux2025. 9. 19. 14:44

irq는 0번 cpu에서만 처리하는게 기본이었던 것 같은데

멀티코어 cpu가 기본이 되면서 irqbalance 라는 데몬이 생겨나서

cpu를 옮겨가면서 irq를 처리하는 cpu가 고정되지 않도록 하는 데몬이 생겨났나 보다.

이론적으로야 하나의 cpu가 아닌 돌아가면서 하거나 나눠서 할 것 같은데

옮기면서 처리량이 줄어드는 문제도 있을수 있으니 필요에 따라서는 로드밸런싱을 하지 않는게 유리할수도 있나 보다.

 

sudo systemctl disable irqbalance
sudo systemctl stop irqbalance

[링크 : https://pak-j.tistory.com/56]

[링크 : https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux_for_real_time/9/html/optimizing_rhel_9_for_real_time_for_low_latency_operation/proc_disabling-the-irqbalance-daemon_assembly_binding-interrupts-and-processes]

 

아래는 irq의 cpu 할당(affinity)를 지정하는 명령인데 2005년 꺼라..

irqbalance 데몬이랑 어떻게 엮이려나.. 일단 테스트 해봐야 할 것 같다.

근데.. 내 노트북에서는 eth0가 안보이네 usb라서 그런가?

echo 3 > /proc/irq/31/smp_affinity
cat /proc/interrupts
           CPU0       CPU1       CPU2       CPU3      
   0:    4865302    5084964    4917705    5017077    IO-APIC-edge  timer
   1:        132        108        159        113    IO-APIC-edge  keyboard
   2:          0          0          0          0          XT-PIC  cascade
   8:          0          1          0          0    IO-APIC-edge  rtc
  10:          0          0          0          0   IO-APIC-level  usb-ohci
  14:          0          0          1          1    IO-APIC-edge  ide0
  24:      87298      86066      86012      86626   IO-APIC-level  aic7xxx
  31:      93707     106211     107988      93329   IO-APIC-level  eth0

[링크 : https://blog.naver.com/didorito/60012935114]

[링크 : https://docs.redhat.com/ko/documentation/red_hat_enterprise_linux/6/html/performance_tuning_guide/s-cpu-irq]

'Linux' 카테고리의 다른 글

sudo time  (0) 2025.09.17
dd 로 덤프 하면서 바로 압축하기  (0) 2025.07.24
gpiod - gpiomon  (0) 2025.07.17
scrub  (0) 2025.02.04
Block SCSI generic (bsg) driver  (0) 2024.04.16
Posted by 구차니
Linux2025. 9. 17. 11:14

엥....?? 일반권한이랑 root 권한이랑 출력포맷이 다르네?

무슨 dd 한번 썼다고 시스템 크래시 난 줄 -_-

$ cat nvme.log 
$ sudo time dd if=/dev/zero of=test bs=1G count=1 conv=fsync
1+0 records in
1+0 records out
1073741824 bytes (1.1 GB, 1.0 GiB) copied, 5.92836 s, 181 MB/s
0.00user 1.06system 0:06.00elapsed 17%CPU (0avgtext+0avgdata 1051008maxresident)k
0inputs+2097152outputs (0major+262242minor)pagefaults 0swaps

 

time 자체는 하나인데 권한에 따라서 포맷이나 옵션이 다르게 작동하는 것 같다.

$ whereis time
time: /usr/bin/time /usr/share/man/man7/time.7.gz /usr/share/man/man2/time.2.gz /usr/share/man/man3/time.3am.gz /usr/share/man/man3/time.3avr.gz /usr/share/man/man1/time.1.gz /usr/share/info/time.info.gz

 

$ sudo whereis time
time: /usr/bin/time /usr/share/man/man7/time.7.gz /usr/share/man/man2/time.2.gz /usr/share/man/man3/time.3am.gz /usr/share/man/man3/time.3avr.gz /usr/share/man/man1/time.1.gz /usr/share/info/time.info.gz

 

$ ls -al /usr/bin/time
-rwxr-xr-x 1 root root 27160  3월 25  2022 /usr/bin/time

 

일반 유저는 -v를 쓸 수 없는 것 같고

$ time ls

real 0m0.004s
user 0m0.001s
sys 0m0.003s

 

root 에서 -p를 주면 원래 보면 포맷이긴 한데 시간 정밀도가 떨어진다. 왜지?

$ sudo time -p ls
real 0.00
user 0.00
sys 0.00

 

$ sudo time ls
0.00user 0.00system 0:00.00elapsed 66%CPU (0avgtext+0avgdata 2432maxresident)k
0inputs+0outputs (0major+106minor)pagefaults 0swaps

 

$ sudo time -v ls
Command being timed: "ls"
User time (seconds): 0.00
System time (seconds): 0.00
Percent of CPU this job got: 90%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:00.00
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 2432
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 107
Voluntary context switches: 1
Involuntary context switches: 0
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0

 

도움말에 먼가 보이긴 한데..

언제부터 이렇게 바뀐겨? root로 시간 측정할 일이 없으니.. 당황했네

$ man time
FORMATTING THE OUTPUT
       The format string FORMAT controls the contents of the time output.  The
       format string can be set using the `-f' or `--format', `-v' or
       `--verbose', or `-p' or `--portability' options.  If they are not
       given, but the TIME environment variable is set, its value is used as
       the format string.  Otherwise, a built-in default format is used.  The
       default format is:
         %Uuser %Ssystem %Eelapsed %PCPU (%Xtext+%Ddata %Mmax)k
         %Iinputs+%Ooutputs (%Fmajor+%Rminor)pagefaults %Wswaps

'Linux' 카테고리의 다른 글

proc fs smp_affinity  (0) 2025.09.19
dd 로 덤프 하면서 바로 압축하기  (0) 2025.07.24
gpiod - gpiomon  (0) 2025.07.17
scrub  (0) 2025.02.04
Block SCSI generic (bsg) driver  (0) 2024.04.16
Posted by 구차니
Linux/Ubuntu2025. 8. 12. 12:14

xorg 에서 4k 모니터 사용시 화면찢어짐이 발생해서 검색해보는데

dri 3 사용하면 해결된다고 해서 찾아보는 중.

 

검색해보니 리눅스 진영에서 만들은 일종의.. 리눅스용 direct X 같은 가속 구조로 봐야하나?

The Direct Rendering Infrastructure (DRI) is the framework comprising the modern Linux graphics stack which allows unprivileged user-space programs to issue commands to graphics hardware without conflicting with other programs.[6] The main use of DRI is to provide hardware acceleration for the Mesa implementation of OpenGL. DRI has also been adapted to provide OpenGL acceleration on a framebuffer console without a display server running.[7]
DRI implementation is scattered through the X Server and its associated client libraries, Mesa 3D and the Direct Rendering Manager kernel subsystem.[6] All of its source code is open-source software.

[링크 : https://en.wikipedia.org/wiki/Direct_Rendering_Infrastructure]

 

intel arc 아니면 안되나?

 

$ inxi -G
Graphics:
  Device-1: Intel CometLake-U GT2 [UHD Graphics] driver: i915 v: kernel
  Device-2: Generic 720p HD Camera type: USB driver: uvcvideo
  Display: wayland server: X.Org v: 1.22.1.1 with: Xwayland v: 22.1.1
    compositor: gnome-shell v: 42.9 driver: X: loaded: modesetting
    unloaded: fbdev,vesa gpu: i915 resolution: 1: 2160x3840~30Hz
    2: 1920x1080~60Hz 3: 1920x1080~60Hz
  OpenGL: renderer: Mesa Intel UHD Graphics (CML GT2)
    v: 4.6 Mesa 23.2.1-1ubuntu3.1~22.04.3

[링크 : https://www.dedoimedo.com/computers/linux-intel-graphics-video-tearing.html]

[링크 : https://askubuntu.com/questions/1234026/screen-tearing-on-ubuntu-xorg-20-04-with-intel-graphics]

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

기본 터미널 변경하기  (0) 2025.09.22
csvtool  (0) 2025.07.11
ubuntu dhcp lease log  (0) 2025.07.01
우분투에서 스타크래프트 시도.. 실패  (0) 2025.06.28
netplan  (0) 2025.03.06
Posted by 구차니
Linux2025. 7. 24. 11:30

용량이 부족해서 dd로 디스크 이미지 뜨며 바로 압축하는 걸 찾아보게 됨

대개 dd if= of= 해서 썼는데 if만 하고 파이프로 넘기는 것도 지원했었나 보다.

 

sudo bash -c "dd if=/dev/sda2 | gzip > /media/disk/sda2-backup-10august09.gz"

[링크 : https://serverfault.com/questions/52260/compressing-dd-backup-on-the-fly]

'Linux' 카테고리의 다른 글

proc fs smp_affinity  (0) 2025.09.19
sudo time  (0) 2025.09.17
gpiod - gpiomon  (0) 2025.07.17
scrub  (0) 2025.02.04
Block SCSI generic (bsg) driver  (0) 2024.04.16
Posted by 구차니
Linux2025. 7. 17. 17:11

gpio를 매번 읽지 않고 이벤트 방식으로 확인할 수 있는 유틸리티

#  gpiomon -c 0 14                                             
224.921879250   rising  gpiochip0 14                                            
226.677878000   falling gpiochip0 14                                            
228.376900625   rising  gpiochip0 14                                            
230.884914250   falling gpiochip0 14   

[링크 : https://stackoverflow.com/questions/78070072/gpiod-not-detecting-rising-edge-but-sysfs-implementation-did]

[링크 : https://github.com/brgl/libgpiod/blob/master/tools/gpiomon.c]

'Linux' 카테고리의 다른 글

sudo time  (0) 2025.09.17
dd 로 덤프 하면서 바로 압축하기  (0) 2025.07.24
scrub  (0) 2025.02.04
Block SCSI generic (bsg) driver  (0) 2024.04.16
lsusb -v 로 본 장치(HID MT, mouse)  (0) 2024.03.08
Posted by 구차니
Linux/Ubuntu2025. 7. 11. 18:05

awk로 쇼할 바에는 이게 최고구만

[링크  https://packages.debian.org/search?keywords=csvtool]

 

+

2025.07.31

csv 파일에서 특정 셀을 뽑아내서 합계를 구하려는데

mlr과 csvtool을 gpt가 추천해줘서 찾아보게 됨

 

NAME
       csvtool - tool for performing manipulations on CSV files from shell
       scripts

SYNOPSIS
       csvtool [options] command [command-args] input.csv...

 

$ csvtool --help
csvtool - Copyright (C) 2005-2006 Richard W.M. Jones, Merjis Ltd.
        - Copyright (C) 2007- Richard W.M. Jones & Christophe Troestler

csvtool is a tool for performing manipulations on CSV files from shell scripts.

Summary:
  csvtool [-options] command [command-args] input.csv [input2.csv [...]]

Commands:
  col <column-spec>
    Return one or more columns from the CSV file.

    For <column-spec>, see below.

      Example: csvtool col 1-3,6 input.csv > output.csv

  namedcol <names>
    Assuming the first row of the CSV file is a list of column headings,
    this returned the column(s) with the named headings.

    <names> is a comma-separated list of names.

      Example: csvtool namedcol Account,Cost input.csv > output.csv

  width
    Print the maximum width of the CSV file (number of columns in the
    widest row).

  height
    Print the number of rows in the CSV file.

    For most CSV files this is equivalent to 'wc -l', but note that
    some CSV files can contain a row which breaks over two (or more)
    lines.

  setcolumns cols
    Set the number of columns to cols (this also makes the CSV file
    square).  Any short rows are padding with blank cells.  Any
    long rows are truncated.

  setrows rows
    'setrows n' sets the number of rows to 'n'.  If there are fewer
    than 'n' rows in the CSV files, then empty blank lines are added.

  head rows
  take rows
    'head n' and 'take n' (which are synonyms) take the first 'n'
    rows.  If there are fewer than 'n' rows, padding is not added.

  drop rows
    Drop the first 'rows' rows and return the rest (if any).

      Example:
        To remove the headings from a CSV file with headings:
          csvtool drop 1 input.csv > output.csv

        To extract rows 11 through 20 from a file:
          csvtool drop 10 input.csv | csvtool take 10 - > output.csv

  cat
    This concatenates the input files together and writes them to
    the output.  You can use this to change the separator character.

      Example: csvtool -t TAB -u COMMA cat input.tsv > output.csv

  paste
    Concatenate the columns of the files together and write them to the
    output.

      Example: csvtool paste input1.csv input2.csv > output.csv

  pastecol <column-spec1> <column-spec2> input.csv update.csv
    Replace the content of the columns referenced by <column-spec1> in the
    file input.csv with the one of the corresponding column specified by
    <column-spec2> in update.csv.

      Example: csvtool pastecol 2-3 1- input.csv update.csv.csv > output.csv

  join <column-spec1> <column-spec2>
    Join (collate) multiple CSV files together.

    <column-spec1> controls which columns are compared.

    <column-spec2> controls which columns are copied into the new file.

      Example:
        csvtool join 1 2 coll1.csv coll2.csv > output.csv

        In the above example, if coll1.csv contains:
          Computers,$40
          Software,$100
        and coll2.csv contains:
          Computers,$50
        then the output will be:
          Computers,$40,$50
          Software,$100,

  square
    Make the CSV square, so all rows have the same length.

      Example: csvtool square input.csv > input-square.csv

  trim [tlrb]+
    Trim empty cells at the top/left/right/bottom of the CSV file.

      Example:
        csvtool trim t input.csv    # trims empty rows at the top only
        csvtool trim tb input.csv   # trims empty rows at the top & bottom
        csvtool trim lr input.csv   # trims empty columns at left & right
        csvtool trim tlrb input.csv # trims empty rows/columns all around

  sub r c rows cols
    Take a square subset of the CSV, top left at row r, column c, which
    is rows deep and cols wide.  'r' and 'c' count from 1, or
    from 0 if -z option is given.

  replace <column-spec> update.csv original.csv
    Replace rows in original.csv with rows from update.csv.  The columns
    in <column-spec> only are used to compare rows in input.csv and
    update.csv to see if they are candidates for replacement.

      Example:
        csvtool replace 3 updates.csv original.csv > new.csv
        mv new.csv original.csv

  transpose input.csv
    Transpose the lines and columns of the CSV file.

  format fmt
    Print each row of the files according to the format 'fmt'.
    Each occurrence of "%i" or "%(i)" (where 'i' is a number) in
    'fmt' is replaced by the content of column number 'i' (remember
    that the leftmost column is numbered 1 in the traditional
    spreadsheet fashion).  A literal percent is obtained by doubling it.
    The usual escape sequences \n, \r, and \t are recognized.

      Example:
        csvtool format '%(1) -> %8%%\n' input.csv

  call command
    This calls the external command (or shell function) 'command'
    followed by a parameter for each column in the CSV file.  The
    external command is called once for each row in the CSV file.
    If any command returns a non-zero exit code then the whole
    program terminates.

      Tip:
        Use the shell command 'export -f funcname' to export
        a shell function for use as a command.  Within the
        function, use the positional parameters $1, $2, ...
        to refer to the columns.

      Example (with a shell function):
        function test {
          echo Column 1: $1
          echo Column 2: $2
        }
        export -f test
        csvtool call test my.csv

        In the above example, if my.csv contains:
          how,now
          brown,cow
        then the output is:
          Column 1: how
          Column 2: now
          Column 1: brown
          Column 2: cow

  readable
    Print the input CSV in a readable format.

Column specs:
  A <column-spec> is a comma-separated list of column numbers
  or column ranges.

    Examples:
      1                       Column 1 (the first, leftmost column)
      2,5,7                   Columns 2, 5 and 7
      1-3,5                   Columns 1, 2, 3 and 5
      1,5-                    Columns 1, 5 and up.

  Columns are numbered starting from 1 unless the -z option is given.

Input files:
  csvtool takes a list of input file(s) from the command line.

  If an input filename is '-' then take input from stdin.

Output file:
  Normally the output is written to stdout.  Use the -o option
  to override this.

Separators:
  The default separator character is , (comma).  To change this
  on input or output see the -t and -u options respectively.

  Use -t TAB or -u TAB (literally T-A-B!) to specify tab-separated
  files.

Options:
  -t Input separator char.  Use -t TAB for tab separated input.
  -u Output separator char.  Use -u TAB for tab separated output.
  -o Write output to file (instead of stdout)
  -z Number columns from 0 instead of 1
  -help  Display this list of options
  --help  Display this list of options

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

기본 터미널 변경하기  (0) 2025.09.22
intel dri 3?  (0) 2025.08.12
ubuntu dhcp lease log  (0) 2025.07.01
우분투에서 스타크래프트 시도.. 실패  (0) 2025.06.28
netplan  (0) 2025.03.06
Posted by 구차니
Linux/Ubuntu2025. 7. 1. 12:31

gpt 가라사대

cat /var/lib/dhcp/dhclient.leases

 

dhclient를 실행하고 나서 생성되는 로그인듯 하다.

 

아무튼 어쩌다 보니(?) 유선은 문제 없어 보이는데 무선의 경우 dhcp 대역이 이상해서 확인해보니

dhcp 서버가 예상한 192.168.10.1이 아닌 10.75로 설정되어있는것을 확인

아.. dhcp 서버가 두개 있어서 이놈들이 헤까닥 했구나..

lease {
  interface "wlo1";
  fixed-address 192.168.10.163;
  option subnet-mask 255.255.0.0;
  option routers 192.168.10.1;
  option dhcp-lease-time 86400;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.10.1;
  option dhcp-server-identifier 192.168.10.75;
  option host-name "minimonk-notebook";
  option domain-name "vyos.net";
  renew 2 2025/07/01 12:34:49;
  rebind 3 2025/07/02 00:07:12;
  expire 3 2025/07/02 03:07:12;
}

 

+

sudo dhclient wlo1

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

intel dri 3?  (0) 2025.08.12
csvtool  (0) 2025.07.11
우분투에서 스타크래프트 시도.. 실패  (0) 2025.06.28
netplan  (0) 2025.03.06
ubuntu 24.04 네트워크 연결 중 문제  (0) 2025.02.26
Posted by 구차니
Linux/Ubuntu2025. 6. 28. 13:52

lutris 까진 설치했는데 battle.net 에서 45%를 못 넘기고 뻗는다.

걍 윈도우 설치하는게 속 편하려나..

찾아보니 윈도우 보다 사양이 많이 올라간다고 하니 흐음...

 

[링크 : https://leedaeeun.tistory.com/108]

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

csvtool  (0) 2025.07.11
ubuntu dhcp lease log  (0) 2025.07.01
netplan  (0) 2025.03.06
ubuntu 24.04 네트워크 연결 중 문제  (0) 2025.02.26
ubuntu evince(pdf 뷰어/문서보기), gedit 검색  (0) 2024.11.25
Posted by 구차니
Linux/Ubuntu2025. 3. 6. 15:14

우분투 서버 설치하는데 netplan-zz 이런식으로 이름이 붙길래 먼가 해서 찾아봤더니

2018 이후 부터 netplan이 적용되었고 /etc/network/interfaces를 대체한다고 한다.

 

[링크 : https://feelsogoodcamp.tistory.com/35]

[링크 : https://bongjasee.tistory.com/4]

[링크 : https://documentation.ubuntu.com/server/explanation/networking/about-netplan/index.html]

[링크 : https://netplan.io/]

Posted by 구차니