http_proxy나 https_proxy 같은 환경 변수를 설정해서 사용하는 경우 bypass하고 싶은 주소들, 예를 들면 localhost 혹은 망 내부 주소들을 설정하고 싶은 경우, no_proxy 환경 변수를 설정한다.
no_proxy는 hostname을 suffix를 받아들인다.
IP주소의 경우 대역이나 *를 통해 다수를 한번에 설정하는 것은 안된다.
하나하나 추가한다. 여러개를 추가할 때는 ‘,’를 사용한다.
http_proxy나 https_proxy 같은 환경 변수를 설정해서 사용하는 경우 bypass하고 싶은 주소들, 예를 들면 localhost 혹은 망 내부 주소들을 설정하고 싶은 경우, no_proxy 환경 변수를 설정한다.
no_proxy는 hostname을 suffix를 받아들인다.
IP주소의 경우 대역이나 *를 통해 다수를 한번에 설정하는 것은 안된다.
하나하나 추가한다. 여러개를 추가할 때는 ‘,’를 사용한다.
가장 큰 차이점은 operands의 순서이다.
Intel-syntax가 mnemonic destination, source 인데 반해, AT&T Syntax의 일반적인 형식은 다음과 같다.
mnemonic source, destination
모든 IA-32 아키텍처의 레지스터 이름은 앞에 ‘%’가 붙는다.
mov %ax, %bx
위의 예제는 16비트 레지스터 AX로부터의 값을 16비트 레지스터 BX로 옮긴다.
모든 상수 값들은 앞에 ‘$’가 붙는다.
mov $100, %bx
mov $A, %al
AT&T 문법에서 메모리는 다음 방식으로 참조된다.
segment-override:signed-offset (base,index,scale)
일부는 생략 가능하다.
%es:100 (%eax,%ebx,2)
offset과 scale은 앞에 ‘$’가 붙으면 안된다.
GAS memory operand NASM memory operand ------------------ ------------------- 100 [100] %es:100 [es:100] (%eax) [eax] (%eax,%ebx) [eax+ebx] (%ecx,%ebx,2) [ecx+ebx*2] (,%ebx,2) [ebx*2] -10(%eax) [eax-10] %ds:-10(%ebp) [ds:ebp-10]
예제
mov %ax, 100 mov %eax, -100(%eax)
첫번째 예제는 ax 레지스터의 값을 (기본인) data segment 레지스터의 offset 100으로 옮기는 것이다.
두번째 예제는 eax 레지스터의 값을 [eax-100]으로 옮기는 것이다.
상수 값을 메모리로 옮길 때, size-of-transfer나 operand-size를 지정할 필요가 있다. 다음 예제에서는 transfer size는 없고, 값 10을 메모리 offset 100으로 옮기는 것만 지정되어 있다.
mov $10, 100
NASM에서는 캐스팅 키워드 byte / word / dword 등을 붙여서 이를 한다. AT&T 문법에서는 이를 instruction에 suffix b/w/l을 붙여서 한다. 예를 들면 다음은 byte 값 10을 [ea:eax] 위치로 옮긴다
movb $10, %es:(%eax)
다음은 long 값 10을 같은 위치로 옮긴다.
movl $10, %es:(%eax)
아래도 그 예제들이다.
movl $100, %ebx pushl %eax popw %ax
jmp, call, ret 같은 instruction들은 프로그램의 한 곳에서 다른 곳으로 제어를 넘긴다. 이는 같은 코드 세그먼트 (near) 로 또는 다른 코드 세그먼트 (far) 로 제어를 넘길 수 있다. 가능한 브랜치 주소 지정 타입은 relative offset (label), register, memory oerand, 그리고 segment-offset pointers이다.
Relative offsets은 아래처럼 labels을 사용한다.
label1:
.
.
jmp label1
Register나 memory operands를 사용하는 브랜치 주소 지정은 ‘*’를 앞에 붙여야만 한다. “far” 제어 넘김을 지정하기 위해서는 ‘ljmp’, ‘lcall’ 등과 같이 ‘l’을 앞에 붙여야 한다. 다음이 그 예제이다.
GAS syntax NASM syntax ========== =========== jmp *100 jmp near [100] call *100 call near [100] jmp *%eax jmp near eax jmp *%ecx call near ecx jmp *(%eax) jmp near [eax] call *(%ebx) call near [ebx] ljmp *100 jmp far [100] lcall *100 call far [100] ljmp *(%eax) jmp far [eax] lcall *(%ebx) call far [ebx] ret retn lret retf lret $0x100 retf 0x100
Segment-offset pointers는 다음 형식을 사용해서 지정한다:
jmp $segment, $offset
다음이 그 예제이다.
jmp $0x10, $0x100000
더 자세한 GNU assembler에 대해서 더 자세히 알고 싶으면 문서를 참고하자.
참고: https://csiflabs.cs.ucdavis.edu/~ssdavis/50/att-syntax.htm
synaptic으로 설치하는데 아래 에러가 나온다.
at-spi2-core 패키지를 설치하면 해결된다고 한다.
(frontend:10029): dbind-WARNING **: 13:54:52.794: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files
참고: https://www.raspberrypi.org/forums/viewtopic.php?p=1297158
Raspbian 설치하고 언어를 바로 Korean으로 설정하고 하라는대로 재부팅하면 폰트가 설치되어 있지 않아서 메뉴가 다 깨져보여서 보기 힘들다. 난 그냥 English를 사용하도록 한 후, 필요한 걸 설치했다.
입력기가 요즘 또 새로운게 생겨서 fcitx를 쓸 수도 있는 것 같던데, ibus-hangul을 설치했다.
sudo apt-get install ibus-hangul
재부팅하면 트레이에 ibus 아이콘이 보인다. 기본은 English다.
우클릭 / “Preferences” / “Input Method” / “Add” / “…” / “Korean” 을 하면 태극 무늬의 “Korean” 이 추가된다.
English는 제거하자.
한영키는 별도 설정없이 기본으로 한영키를 쓰면 한글과 영문이 토글된다.
Shift + space도 된다.
Synaptic 깔고 패키지 설치해보면 아래와 같은 에러가 뜬다.
해결방법은 libgtk3-perl 패키지를 설치해주면 된다.
debconf: unable to initialize frontend: Gnome
debconf: (Can’t locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/arm-linux-gnueabihf/perl/5.28.1 /usr/local/share/perl/5.28.1 /usr/lib/arm-linux-gnueabihf/perl5/5.28 /usr/share/perl5 /usr/lib/arm-linux-gnueabihf/perl/5.28 /usr/share/perl/5.28 /usr/local/lib/site_perl /usr/lib/arm-linux-gnueabihf/perl-base) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151, <> line 3.)
참고: https://www.linuxquestions.org/questions/bodhi-92/can%27t-locate-gtk3-pm-4175657312/
Raspbian 설치 후에 기본 사용자인 pi를 지우고, 내 아이디를 쓰고 싶어서 지워봤다.
ssh 같은거 열면 pi로 막 들어올까봐…
모든 작업은 root로 진행했다.
adduser dasomoli
usermod -aG sudo dasomoli
polkit local authority 설정
vi /etc/polkit-1/localauthority.conf.d/60-desktop-policy.conf
AdminIdentities=unix-group:sudo;unix-user:0
vi /etc/lightdm/lightdm.conf
autologin-user=dasomoli
vi /etc/systemd/system/autologin@.service
ExecStart=-/sbin/agetty –autologin dasomoli –noclear %I $TERM
vi /etc/systemd/system/getty@tty1.service.d/autologin.conf
ExecStart=-/sbin/agetty –autologin dasomoli –noclear %I $TERM
pi 지우기
deluser –remove-home –remove-all-files pi
delgroup pi
참고: https://www.raspberrypi.org/forums/viewtopic.php?t=202618
.vimrc 같은건 대충 필요한 것만 그때 그때 써서 썼는데 새 환경에서 하나하나 쓰려니 귀찮다. 복사해서 쓸 수 있게 여기다 하나 써두고 업데이트하자.
syntax on
set autoindent
set cindent
:set smartindent
set noexpandtab
set nu
set hlsearch
set ts=4
set shiftwidth=4
set laststatus=2
set statusline=\ %<%l:%v\ [%P]%=%a\ %h%m%r\ %F\
set incsearch
colorscheme elflord
set tags=./tags,tags
set tags+=/usr/src/linux/tags
set tags+=../tags
set tags+=../../tags
set tags+=../../../tags
highlight ExtraWhitespace ctermbg=red guibg=red
match ExtraWhitespace /\s\+$/
1> D:\logfile.log 2>&1
어쩌다 가끔 쓰면 또 기억이 안난다….
Windows에서 명령줄을 띄워서 작업할 때, 어떤 에러 메시지 등을 google에서 찾아보고 싶은 경우 같은 때, 나오는 메시지의 언어를 바꾸고 싶을 때가 있다. 이럴 때 “LANG” 환경 변수 등을 바꾸어도 그대로 에러 메시지 등이 우리말로 나온다. 요건 mingw 같은 환경에서 shell을 써도 마찬가지. 한국판 Windows를 깔면 기본이 CP949로 설정되어 에러 메시지 등이 우리말로 나오는 것인데, 다음과 같이 CHCP 명령을 이용하면 된다. 65001은 UTF-8이다.
CHCP 65001
참고: https://superuser.com/questions/269818/change-default-code-page-of-windows-console-to-utf-8