2014년 3월 25일 화요일

Ubuntu 에서 시스템의 자세한 하드웨어 정보 확인


$ sudo apt-get install lshw
$ sudo lshw
네트워크 카드 정보만 보고 싶다면,
$ sudo lshw -class network

"SIOCSIFFLAGS: 작업이 불가능, RF-kill 때문" 에러 해결

무선랜 카드를 켜기 위한 명령 시에 다음과 같은 에러가 뜰 때 해결방안

$ sudo ifconfig wlan0 up
SIOCSIFFLAGS: 작업이 불가능, RF-kill 때문

또는 "SIOCSIFFLAGS: Operation not possible due to RF-kill" 과 같은 에러가 발생할 때,

linaro@cubietruck:~$ sudo rfkill list all
0: bcm40183: Bluetooth
Soft blocked: yes
Hard blocked: no
1: phy0: Wireless LAN안
Soft blocked: yes
Hard blocked: no
2: brcmfmac-wifi: Wireless LAN
Soft blocked: yes
Hard blocked: no

linaro@cubietruck:~$ sudo rfkill unblock wifi; sudo rfkill unblock all

위 명령 실행 후 block 해제 되었는지 확인 후 재부팅
$ sudo rfkill list
$ sudo reboot

재확인 후 커널이 무선랜 카드를 인식하는지 확인
$ sudo rfkill list
$ sudo lshw -class network

2014년 3월 24일 월요일

Ubuntu에서 Bluetooth 활용

linaro@cubietruck:~$ sudo apt-get install bluez
linaro@cubietruck:~$ sudo hcitool dev
Devices:
hci0 00:1C:34:01:2F:2A

linaro@cubietruck:~$ sudo hciconfig hci0 up
linaro@cubietruck:~$ sudo hcitool scan
Scanning ...
DC:2C:26:D1:82:FB Celluon PK Series

linaro@cubietruck:~$ sudo l2ping DC:2C:26:D1:82:FB
Ping: DC:2C:26:D1:82:FB from 00:1C:34:01:1F:0A (data size 44) ...
44 bytes from DC:2C:26:D1:82:FB id 0 time 17.59ms
44 bytes from DC:2C:26:D1:82:FB id 1 time 6.57ms
44 bytes from DC:2C:26:D1:82:FB id 2 time 6.99ms
44 bytes from DC:2C:26:D1:82:FB id 3 time 7.45ms
44 bytes from DC:2C:26:D1:82:FB id 4 time 6.79ms


linaro@cubietruck:~$ sudo sdptool browse DC:2C:26:D1:82:FB
Browsing DC:2C:26:D1:82:FB ...
Service Name: Bluetooth Wireless Keyboard SDP Server
Service Description: Keyboard
Service RecHandle: 0x0
Service Class ID List:
  "SDP Server" (0x1000)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 1
  "SDP" (0x0001)
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "" (0x0100)
    Version: 0x0100

Service Name: Bluetooth Wireless  Keyboard                        
Service Description: Keyboard
Service Provider:              .  
Service RecHandle: 0x10000
Service Class ID List:
  "Human Interface Device" (0x1124)
Protocol Descriptor List:
  "L2CAP" (0x0100)
    PSM: 17
  "HIDP" (0x0011)
Language Base Attr List:
  code_ISO639: 0x656e
  encoding:    0x6a
  base_offset: 0x100
Profile Descriptor List:
  "Human Interface Device" (0x1124)
    Version: 0x0100



linaro@cubietruck:~$ sudo hidd --connect DC:2C:26:D1:82:FB


linaro@cubietruck:~$ sudo hcitool con
Connections:
< ACL DC:2C:26:D1:82:FB handle 43 state 1 lm MASTER 
linaro@cubietruck:~$


linaro@cubietruck:~$ sudo vim /etc/bluetooth/rfcomm.conf


rfcomm0 {
       # Automatically bind the device at startup
       bind no;

       # Bluetooth address of the device
       device DC:2C:26:D1:82:FB;

       # RFCOMM channel for the connection
       channel 1;

       # Description of the connection
       comment "Example Bluetooth device";
}


cubieborad에서 lubuntu 설치 및 한글화

cubietruck의 경우 http://dl.cubieboard.org/software/a20-cubietruck/lubuntu/ 에서 최근 이미지 다운로드 및 설치

설치메뉴얼은 http://docs.cubieboard.org/tutorials/cb3/start 문서 참조.

이미지 설치가 완료되면 부팅 후, linaro 계정으로 로그인(비밀번호는 아이디와 동일)

지역 로케일 설정 확인
linaro@cubietruck:~$ locale

linaro@cubietruck:~$ sudo apt-get update
linaro@cubietruck:~$ sudo apt-get install language-pack-ko

linaro@cubietruck:~$ sudo locale-gen ko_KR.UTF-8
linaro@cubietruck:~$ sudo dpkg-reconfigure locales
linaro@cubietruck:~$ sudo update-locale LANG=ko_KR.UTF-8

/etc/environment에서 locale 설정 수정
linaro@cubietruck:~$ cat /etc/environment
VDPAU_DRIVER=sunxi
LANG="ko_KR.UTF-8"
LANGUAGE="ko_KR:ko:en_US:en"

타임존 설정 -> TZ='Asia/Seoul'
linaro@cubietruck:~$ sudo tzselect
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#?

linaro@cubietruck:~$ sudo cp /usr/share/zoneinfo/Asia/Seoul /etc/localtime
linaro@cubietruck:~$ sudo ntpdate time.bora.net

한글 폰트 설치
linaro@cubietruck:~$ sudo apt-get install ttf-unfonts-core

재부팅 후, 한글 키보드 설정
linaro@cubietruck:~$ sudo reboot
linaro@cubietruck:~$ sudo apt-get install ibus-hangul
linaro@cubietruck:~$ ibus-setup

linaro@cubietruck:~$ ibus-setup-hangul



ibus 설정 화면에서 Input-Method 에서 "select an input method"에서 "한국어-Korean"을 설정하고, General 탭 메뉴에서 "Keyboard shotcut"을 Hangul 로 설정

Reentrancy Attack: 블록체인 스마트 컨트랙트의 치명적인 취약점

블록체인 기술이 전 세계적으로 주목받으면서 스마트 컨트랙트(Smart Contract)의 사용이 급격히 증가하고 있습니다. 하지만 그만큼 보안 취약점도 함께 늘어나고 있는데, 그 중에서도 Reentrancy Attack(재진입 공격)은 매우 치명적이고...