레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시
레이블이 Linux인 게시물을 표시합니다. 모든 게시물 표시

2023년 3월 8일 수요일

IP 가 여러개인 Linux 에서 디폴트로 사용중인 IP 주소 찾기

 ip route get 8.8.8.8

이러면 8.8.8.8 로 가기 위한 기본 경로를 알려준다

ip route get 8.8.8.8

8.8.8.8 via 1.227.225.1 dev eth0  src 1.227.225.48

    cache  mtu 1500 advmss 1460 hoplimit 64


src 다음에 나오는 IP가 디폴트로 쓰이는 IP가 된다. 


이것만 추출하려면

 ip route get 8.8.8.8 | head -1 | cut -d' ' -f8

또는

ip route get 8.8.8.8 | sed -n 's/^.*src \([0-9.]*\) .*$/\1/p'


ip route get 8.8.8.8 | head -1 | awk '{print $7}'


2023년 2월 13일 월요일

Volumio VMWare esxi 설치

Volumio Image 를 rufus 등을 이용하여 USB Stick 으로 플래쉬하고,  VMWare USB Stick 으로 부팅하면 

아래와 같은 메시지후 진행되지 않는다

findfs: unable to resolve 'UUID=****************...'


이는 USB Stick 이 disk drive 처럼 인식되지 않기 때문이다.


SATA disk 형태로 16GB 정도 만든후

live Linux CD/DVD 등을 준비 하여 Linux Live CD/DVD 로 부팅한다.


터미널을 열어 root 쉘을 얻는다

nc 를 통해 124번 포트를 open 한후 들어오는 데이터를 /dev/sda 로 받는다

nc -l -p 1234 > /dev/sda



다른 서버나 리눅스등을 이용해서 위에 nc 를 open 한 Linux CD/DVD 서버 IP를 확인후 
 Volumio 이미지를 nc를 이용하여 네트워크 전송을 한다

 nc -w 3 192.168.0.77 1234 < Volumio-3.423-2023-01-24-x86_amd64.img

이제 live Linux CD/DVD 등을 제거한후 /dev/sda 로 부팅하면 Volumio 셋업 화면을 볼수 있다.


2022년 4월 11일 월요일

curl 에서 https hostname 방식으로 접근

 

curl 에서는 가상호스트 등을 테스트 할때 hostname 방식으로 접근할때

HTTP 일땐 --header 에 Host 헤더를 이용하여 호스트 명을 명시해서 가능하나

ex) 

hexcode.example.com 이 호스트명이고 

IP 가 10.101.81.200 이라고 가정할때 

curl --header "Host: hexcode.example.com" http://10.101.81.200


HTTPS 일땐 --header 에 Host 헤더를 이용하기가 어렵다. 

아래와 같이 한다.

ex)

hexcode.example.com 이 호스트명이고 

IP 가 10.101.81.200 이라고 가정할때 

curl --resolve hexcode.example.com:443:10.101.81.200 https://hexcode.example.com


또는 전통적인 방법으로 /etc/hosts 를 수정하여 사용하기도 하자

2021년 9월 8일 수요일

dmesg 사람이 보기 쉽게

CentOS6 dmesg 에 찍히는 시간이 uptime 이후 시간이여서 알아보기 힘들다 아래와 같이 uptime - 현재시간 구해서 보면 편하다


 dmesg_human () {

    $(type -P dmesg) "$@" | perl -w -e 'use strict;

        my ($uptime) = do { local @ARGV="/proc/uptime";<>}; ($uptime) = ($uptime =~ /^(\d+)\./);

        foreach my $line (<>) {

            printf( ($line=~/^\[\s*(\d+)\.\d+\](.+)/) ? ( "[%s]%s\n", scalar localtime(time - $uptime + $1), $2 ) : $line )

        }'

}


CentOS7 에서는 간단히 -T 옵션을 사용할 수 있다.

dmesg -T

2021년 1월 6일 수요일

Linux 커널 업그레이드후 vmware 모듈 문제

 Linux 커널 업그레이드 후 vmware 재실행시 모듈이 설치 되지 않았다고 다시 나온다 새 커널 버전에 맞게 모듈을 재 빌드 해야 하며 아래 명령어로 재빌드한다

vmware-modconfig --console --install-all

2020년 4월 13일 월요일

rclone systemd 방식으로 마운트


https://forum.rclone.org/t/rclone-auto-mount/6353/14 에서 참고 했습니다.

# vi /etc/systemd/system/rclonemount.service

[Unit]
Description=RClone Service
After=network-online.target
Wants=network-online.target


[Service]
Type=notify
ExecStart=/usr/bin/rclone mount --allow-other --vfs-read-chunk-size 16M --buffer-size 2G onedrive: /mnt/onedrive
ExecStop=/bin/fusermount -uz /mnt/onedrive
Restart=on-abort
User=users
Group=users

[Install]
WantedBy=default.target


# systemctl daemon-reload
# systemctl enable rclonemount
# systemctl start rclonemount

2020년 4월 4일 토요일

vmware guest 에서 ubuntu / debian 계열 사운드 소리가 작을때

vmware guest 에서 ubuntu / debian 계열 사운드 소리가 작을때

vmware 에서 내장사운드로 Ensoniq AudioPCI  계열로 잡히는데 소리가 매우 작습니다.
Windows 계열은 정상적으로 소리가 나네요

AlsaMixer 를 이용해서 PCM 부분 볼륨을 방향키로 이동해서 높혀주면됩니다.
나올때는 ESC 키 입니다.

명령어는 alsamixer 입니다.


2020년 3월 15일 일요일

ubuntu 데스크탑을 Windows 원격 데스크톱 으로 접속하기

sudo apt install xrdp

그렇지만 Windows 원격 데스크톱으로 로그온 하면
"색상 프로파일을 만들려면 인증이 필요합니다"
메시지가 무한 반복된다.


아래와 같이 권한을 넣어준후 xrdp 데몬 재시작 하면 해결됨

vi /etc/polkit-1/localauthority/50-local.d/45-allow-colord.pkla
[Allow Colord all Users]
Identity=unix-user:*
Action=org.freedesktop.color-manager.create-device;org.freedesktop.color-manager.create-profile;org.freedesktop.color-manager.delete-device;org.freedesktop.color-manager.delete-profile;org.freedesktop.color-manager.modify-device;org.freedesktop.color-manager.modify-profile
ResultAny=no
ResultInactive=no
ResultActive=yes


ubuntu server 데스크탑 환경 및 한글화

한글화를 위해 우선 로케일 설정
sudo apt install language-pack-ko
sudo locale-gen ko_KR.UTF-8

아래명령에서 ko_KR.UTF-8 설치후 선택
sudo dpkg-reconfigure locales

기본 명령 및 메시지까지 한글로 나오게 합
sudo update-locale LANG=ko_KR.UTF-8 LC_MESSAGES=ko_KR.UTF-8

또는 
vi /etc/default/locale
LANG="ko_KR.UTF-8"
LC_MESSAGES=ko_KR.UTF-8
LANGUAGE="ko:en"
LC_NUMERIC="ko_KR.UTF-8"
LC_TIME="ko_KR.UTF-8"
LC_MONETARY="ko_KR.UTF-8"
LC_PAPER="ko_KR.UTF-8"
LC_IDENTIFICATION="ko_KR.UTF-8"
LC_NAME="ko_KR.UTF-8"
LC_ADDRESS="ko_KR.UTF-8"
LC_TELEPHONE="ko_KR.UTF-8"
LC_MEASUREMENT="ko_KR.UTF-8"


이후 데스크탑 패키지 설치
sudo apt install ubuntu-desktop
sudo apt install ubuntu-gnome-desktop

데스크탑 로그온 후 부족한 한글 메시지 관련 패키지 추가 설치

2019년 11월 9일 토요일

adb 로 twrp 리커버리 쉽게 들어가기

샤오미 미패드2 의 경우에 전원키+볼륨하키 조합으로 리커버리 진입이 잘 안된다. 잘 될때가 없었던것 같다. 이럴때 개발자모드로 만든뒤에 USB 디버깅을 허용한다음에 adb를 이용하여 손쉽게 들어갈수 있다. adb reboot recovery

2019년 6월 29일 토요일

VMware ESXi 에서 Realtek Driver 추가

Intel NUC 6세대에 ESXi 를 올리고 싶었으나
VMware ESXi 에는 Realtek 같은 저가 이더넷 카드는 기본적으로 지원하지 않더군요.

Intel NUC 6세대에의 유선 이더넷 카드는 RTL8111HN 칩셋으로서 ESXi 에서 지원하지 않습니다.

설치중 마지막에 "No Network Adapters" 메시지 이후에 설치가 진행 되지 않습니다.

폭풍 구글 검색끝에 아래와 같은 사이트에서 서드파티 ESXi Realtek 드라이버를 제공하고 있습니다. 그러나 VMWare 이미지에 이 드라이버를 넣기가 조금 쉽지는 않습니다.

아래와 같은 순서로 가능합니다.


1. Realtek ESXi 드라이버 다운받기
우선 아래의 Realtek 드라이버는 URL에서 다운로드 가능합니다.

https://vibsdepot.v-front.de/wiki/index.php/Net55-r8168
지원되는 Realtek 칩셋은 위에 URL에서 확인 가능합니다.
(Realtek RTL8111B / RTL8168B / RTL8111/RTL8168 / RTL8111C / RTL8111CP / RTL8111D(L) / RTL8168C / RTL8111DP / RTL8111E / RTL8168E / RTL8111F / RTL8411 / RTL8111G / RTL8111GUS / RTL8411B(N) / RTL8118AS / D-Link DGE-528T)

드라이버파일인 vib File 을 적당한 작업 폴더에 다운받습니다.
http://vibsdepot.v-front.de/depot/RTL/net55-r8168/net55-r8168-8.045a-napi.x86_64.vib

저는 작업폴더를 D:\esxi 폴더로 했습니다.

2. 커스텀이미지를 만들어주는 통합 파워쉘 스크립트 다운받기

위에 vid  형태의 드라이버를 VMware ESXi iso 이미지를 통합시켜주는 파워쉘 스크립트가 필요하며 이 스크립도 같은 작업 폴더에 다운로드 합니다.

https://www.v-front.de/p/esxi-customizer-ps.html

ESXi-Customizer-PS-v2.6.0.ps1 이파일을 드라이버와 같은 작업 디렉토리에 다운로드 합니다.

3. 커스텀 파워쉘 스크립트의 의존성 패키지 다운받기
커스텀 이미지를 만들어주는 ESXi-Customizer-PS-v2.6.0.ps1 파워쉘 스크립트는 많은 패키지 의존성이 있습니다. 의존성이 해결되어야 실행이 됩니다.

파워쉘을 관리자 권한으로 실행합니다.

파워쉘에서 프롬포트에서 아래 명령어로 커스텀 스크립트가 의존하는 패키지를 다운로드 합니다.
PS D:\esxi> Install-Module -Name VMware.VimAutomation.Core -AllowClobber
PS D:\esxi> Install-Module -Name VMware.ImageBuilder  -AllowClobber

4. 드라이버가 포함된 커스텀 이미지 만들기

관리자 권한 파워쉘 프롬포트에 커스텀 이미지를 만들기위해서 커스텀 스크립트 ESXi-Customizer-PS-v2.6.0.ps1 를 실행합니다. 

-v67, -v65 등의 옵션은 ESXi 이미지 만들 버전을 의미하고 최신 버전을 온라인 다운로드 받아서 만듭니다.
미리 받아둔 오프라인 depot 형태의 zip 파일이 있다면 -izip 옵션과 depot 파일 경로를 주면 됩니다.

아래는 ESXi 의 67 버전을 온라인으로 다운로드 받아서 Realtek vid 파일 드라이버를 병합하여 커스텀 이미지를 만드는 과정입니다. 

PS D:\esxi> ESXi-Customizer-PS-v2.6.0.ps1 -v67 -pkgDir D:\esxi\

보안 경고
신뢰하는 스크립트만 실행하십시오. 인터넷의 스크립트는 유용할 수 있지만 사용자 컴퓨터를 손상시킬 수도 있습니다.
스크립트를 신뢰하는 경우 Unblock-File cmdlet을 사용하면 이 경고 메시지 없이 스크립트를 실행할 수 있습니다.
D:\esxi\ESXi-Customizer-PS-v2.6.0.ps1을(를) 실행하시겠습니까?
[D] 실행 안 함(D)  [R] 한 번 실행(R)  [S] 일시 중단(S)  [?] 도움말 (기본값은 "D"): r

This is ESXi-Customizer-PS Version 2.6.0 (visit https://ESXi-Customizer-PS.v-front.de for more information!)
(Call with -help for instructions)

Logging to C:\Users\hexcode\AppData\Local\Temp\ESXi-Customizer-PS-12040.log ...

Running with PowerShell version 5.1 and VMware PowerCLI version 11.3.0.13964826

Connecting the VMware ESXi Online depot ... [OK]

Getting Imageprofiles, please wait ... [OK]

Using Imageprofile ESXi-6.7.0-20190604001-standard ...
(dated 06/20/2019 14:51:56, AcceptanceLevel: PartnerSupported,
Updates ESXi 6.7 Image Profile-ESXi-6.7.0-20190604001-standard)

Loading Offline bundles and VIB files from D:\esxi\ ...
   Loading D:\esxi\net55-r8168-8.045a-napi.x86_64.vib ... [OK]
      Add VIB net55-r8168 8.045a-napi [New AcceptanceLevel: CommunitySupported] [OK, added]

Exporting the Imageprofile to 'D:\esxi\ESXi-6.7.0-20190604001-standard-customized.iso'. Please be patient ...


All done.


작업폴더에 드라이버가 병합된 ESXi-6.7.0-20190604001-standard-customized.iso 파일이 생성되었으며  rufus 등으로 USB 인스톨러 를 만들고 설치하면 됩니다.

2018년 4월 18일 수요일

Check certificates with openssl or curl (check expiration period)

When checking various things such as certificates with curl, you can simply use the following command.

$ curl --insecure -v https://www.google.com

You can simply check the certificate status and check the expiration with the openssl command.

The openssl's  s_client option has many features. -connect Dumps certificate status with a simple function.

$ openssl s_client -connect localhost: 443

Let's check the certificate of google.com by openssl as below.

$ echo | openssl s_client -connect www.google.com:443 2> / dev / null | openssl x509 -noout -dates
notBefore = Nov 29 09:47:51 2017 GMT
notAfter = Feb 21 09:37:00 2018 GMT

$ echo | openssl s_client -connect www.google.com:443 2> / dev / null | openssl x509 -noout -enddate
notAfter = Feb 21 09:37:00 2018 GMT

You can see the status of the certificate simply by using the command below:

$ openssl x509 -in ./your.crt -noout -text | more
$ openssl x509 -in ./your.crt -noout -dates

If you are using the s_client option, you can dump or extract certificates as shown below:

$ openssl s_client -connect www.google.com:443> cert
depth = 2 C = US, O = GeoTrust Inc., CN = GeoTrust Global
verify error: num = 20: unable to get local issuer certificate
verify return: 0

Typing quit in the above state will save it to the cert file.
Save the certificate as PEM with the following command

$ openssl x509 -inform PEM -in cert -text -out cert.crt

The stored PEM type certificate can be checked as below:
$ openssl x509 -in cert.crt -noout -text

2017년 12월 30일 토요일

openssl 또는 curl 로 인증서 체크 (만료기간 체크)

curl 로 인증서등 여러가지 체크를 할때 간단히 아래 명령어로 가능합니다.
$ curl --insecure -v https://www.google.com

openssl 명령어로 간단히 인증서 상태 체크 및 만료 체크를 할수 있습니다.

openssl s_client 옵션에는 많은 기능이 있습니다. -connect 단순 기능만으로 인증서 상태들을 덤프해주죠

$ openssl s_client -connect localhost:443 

아래와 같이 응용을 하여  google.com 의 인증서 체크를 해볼까요?

$ echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -dates
notBefore=Nov 29 09:47:51 2017 GMT
notAfter=Feb 21 09:37:00 2018 GMT 

$ echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -enddate
notAfter=Feb 21 09:37:00 2018 GMT


아래 명령어로 간단히 인증서 상태를 알수 있습니다. 
openssl x509 -in ./your.crt  -noout -text  |more
openssl x509 -in ./your.crt  -noout -dates

s_client 옵션과 응용을 한다면 아래와 같이 인증서를 덤프뜨거나 추출 확인 할수 있겠습니다.

$ openssl s_client -connect www.google.com:443   > cert 
depth=2 C = US, O = GeoTrust Inc., CN = GeoTrust Global CA
verify error:num=20:unable to get local issuer certificate
verify return:0

위의 상태에서 quit 입력 하면 cert 파일에 저장됨 
아래명령어로 인증서를 PEM 형태로 저장

$ openssl x509 -inform PEM -in cert -text -out cert.crt 

저장된 PEM 형태 인증서는 아래와 같이 확인 가능합니다.
$ openssl x509 -in cert.crt  -noout -text

2017년 12월 14일 목요일

Ubuntu (Windows Bash Linux) 에서 JDK apt 로 손쉽게 설치하기


Ubuntu 기본적인 JRE/JDK 설치

기본적으로 Ubuntu 에 포함되어있는 OpenJDK 는 아래와 같이 간단히 설치합니다.

JRE만 설치시
sudo apt-get install default-jre

JDK (Java Development Kit) 가 필요한 경우
sudo apt-get install default-jdk

Oracle JDK 설치
경험상 OpenJDK 에선 불안정하거나 알수없는 문제들이 있어서 Oracle JDK를 프로덕트 환경에서 선호하는 편입니다.

Ubuntu 기본 레포지토리엔 제공하지 않으므로 아래와 같이 Oracle's PPA 레포지토리를 추가하고 레포지토리 업데이트를 해줍니다.
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update

Oracle JDK 8 를 설치하는 경우 :
sudo apt-get install oracle-java8-installer

Oracle JDK 9 를 설치하는 경우 :
sudo apt-get install oracle-java9-installer

Oracle JDK 를 설치시에는 라이센스등을 동의해줘야 합니다.

Java 환경변수등 관리하기

JDK가 여러가지 버전이 설치되어있는 경우 아래와 같은 명령으로 디폴트 JDK를 선택 할수 있습니다.

sudo update-alternatives --config java
대체 항목 java에 대해 (/usr/bin/java 제공) 1개 선택이 있습니다.

  선택       경로                                   우선순 상태
------------------------------------------------------------
  0            /usr/lib/jvm/java-8-oracle/jre/bin/java   1081      자동 모드
* 1            /usr/lib/jvm/java-8-oracle/jre/bin/java   1081      수동 모드


JAVA_HOME 환경변수 세팅하기

/etc/environment 파일에 추가합니다.
ex) Oracle JDK인 경우
JAVA_HOME="/usr/lib/jvm/java-8-oracle"

재로그온 하시거나 아래와 같이 환경변수를 먹인후 확인해봅니다.
source /etc/environment
echo $JAVA_HOME


2017년 12월 9일 토요일

How to make Linux dmesg seconds.nanoseconds to human readable


dmesg 를 통해서 Linux 에 많은 HW 에러등을 찾을때 도움이 되곤합니다.
그러나 라즈베리파이나 우분투 Linux 등지에서 dmesg 를 보면
부팅후 [seconds.nanoseconds] 형식이여서 언제 어떤 이벤트가 있었는지 알기 어렵습니다.

It is helpful to find many HW errors in Linux through dmesg.
But if you look at dmesg in Raspberry or Ubuntu Linux After booting, it is in the format of [seconds.nanoseconds], which makes it difficult to know when an event occurred.


[    7.537158] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[    7.537177] sd 0:0:0:0: [sda] Sense not available.
[    7.537331] sd 0:0:0:0: [sda] Write Protect is off
[    7.537350] sd 0:0:0:0: [sda] Mode Sense: d4 80 75 b3
[    7.537461] sd 0:0:0:0: [sda] No Caching mode page found
[    7.537475] sd 0:0:0:0: [sda] Assuming drive cache: write through
[    7.539243] sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[    7.539264] sd 0:0:0:0: [sda] Sense not available.
[    7.539445] sd 0:0:0:0: [sda] Attached SCSI disk
[    8.766528] usb 1-1.5: new high-speed USB device number 5 using dwc_otg
[    8.899103] usb 1-1.5: New USB device found, idVendor=13fd, idProduct=3940
[    8.899121] usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[    8.899131] usb 1-1.5: Product: External
[    8.899141] usb 1-1.5: Manufacturer: ipTIME
[    8.899152] usb 1-1.5: SerialNumber: S25YJ9CC128314
[    8.900403] usb-storage 1-1.5:1.0: USB Mass Storage device detected
[    8.900966] scsi host0: usb-storage 1-1.5:1.0
[    9.927979] scsi 0:0:0:0: Direct-Access     ipTIME   External         0309 PQ: 0 ANSI: 6
[    9.930214] sd 0:0:0:0: Attached scsi generic sg0 type 0
[    9.931797] sd 0:0:0:0: [sda] Spinning up disk...
[   12.806512] .
[   12.806823] ready
[   12.807177] sd 0:0:0:0: [sda] 1250263727 512-byte logical blocks: (640 GB/596 GiB)
[   12.807868] sd 0:0:0:0: [sda] Write Protect is off
[   12.807888] sd 0:0:0:0: [sda] Mode Sense: 1f 00 10 08
[   12.808565] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[   12.836220]  sda: sda1
[   12.840260] sd 0:0:0:0: [sda] Attached SCSI disk
[   13.264948] EXT4-fs (sda1): recovery complete
[   13.264983] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[   14.684784] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[   14.974647] tun: Universal TUN/TAP device driver, 1.6
[   14.974674] tun: (C) 1999-2004 Max Krasnyansky 
[   15.340674] Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SSFS
[   18.788724] smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[   20.743454] random: crng init done

아래 perl 스크립트로 손쉽게 사람이 알아볼수 있는 시간으로 바꿀수 있습니다.
The following perl script makes it easy to change the time you can recognize.

dmesg.pl


#!/usr/bin/perl
use strict;
use warnings;

my @dmesg_new = ();
my $dmesg = "/bin/dmesg";
my @dmesg_old = `$dmesg`;
my $now = time();
my $uptime = `cat /proc/uptime | cut -d"." -f1`;
my $t_now = $now - $uptime;

sub format_time {
my @time = localtime $_[0];
$time[4]+=1;    # Adjust Month
$time[5]+=1900;    # Adjust Year
return sprintf '%4i-%02i-%02i %02i:%02i:%02i', @time[reverse 0..5];
}

foreach my $line ( @dmesg_old )
{
chomp( $line );
if( $line =~ m/\[\s*(\d+)\.(\d+)\](.*)/i )
{
# now - uptime + sekunden
my $t_time = format_time( $t_now + $1 );
push( @dmesg_new , "[$t_time] $3" );
}
}

print join( "\n", @dmesg_new );
print "\n";

./dmesg.pl 의결과 Below is result of dmesg.pl


[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Sense not available.
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Write Protect is off
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Mode Sense: d4 80 75 b3
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] No Caching mode page found
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Assuming drive cache: write through
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Read Capacity(10) failed: Result: hostbyte=0x01 driverbyte=0x00
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Sense not available.
[2017-12-04 16:02:56]  sd 0:0:0:0: [sda] Attached SCSI disk
[2017-12-04 16:02:57]  usb 1-1.5: new high-speed USB device number 5 using dwc_otg
[2017-12-04 16:02:57]  usb 1-1.5: New USB device found, idVendor=13fd, idProduct=3940
[2017-12-04 16:02:57]  usb 1-1.5: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[2017-12-04 16:02:57]  usb 1-1.5: Product: External
[2017-12-04 16:02:57]  usb 1-1.5: Manufacturer: ipTIME
[2017-12-04 16:02:57]  usb 1-1.5: SerialNumber: S25YJ9CC128314
[2017-12-04 16:02:57]  usb-storage 1-1.5:1.0: USB Mass Storage device detected
[2017-12-04 16:02:57]  scsi host0: usb-storage 1-1.5:1.0
[2017-12-04 16:02:58]  scsi 0:0:0:0: Direct-Access     ipTIME   External         0309 PQ: 0 ANSI: 6
[2017-12-04 16:02:58]  sd 0:0:0:0: Attached scsi generic sg0 type 0
[2017-12-04 16:02:58]  sd 0:0:0:0: [sda] Spinning up disk...
[2017-12-04 16:03:01]  .
[2017-12-04 16:03:01]  ready
[2017-12-04 16:03:01]  sd 0:0:0:0: [sda] 1250263727 512-byte logical blocks: (640 GB/596 GiB)
[2017-12-04 16:03:01]  sd 0:0:0:0: [sda] Write Protect is off
[2017-12-04 16:03:01]  sd 0:0:0:0: [sda] Mode Sense: 1f 00 10 08
[2017-12-04 16:03:01]  sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, supports DPO and FUA
[2017-12-04 16:03:01]   sda: sda1
[2017-12-04 16:03:01]  sd 0:0:0:0: [sda] Attached SCSI disk
[2017-12-04 16:03:02]  EXT4-fs (sda1): recovery complete
[2017-12-04 16:03:02]  EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[2017-12-04 16:03:03]  smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
[2017-12-04 16:03:03]  tun: Universal TUN/TAP device driver, 1.6
[2017-12-04 16:03:03]  tun: (C) 1999-2004 Max Krasnyansky 
[2017-12-04 16:03:04]  Adding 102396k swap on /var/swap.  Priority:-1 extents:1 across:102396k SSFS
[2017-12-04 16:03:07]  smsc95xx 1-1.1:1.0 eth0: link up, 100Mbps, full-duplex, lpa 0xC5E1
[2017-12-04 16:03:09]  random: crng init done

2008년 6월 18일 수요일

Linux 에서 수동으로 무선랜 잡기

root 권한
# /etc/init.d/network restart
# iwlist scanning (AP list 스캐닝)
# ifconfig wlan0 up
# iwconfig wlan0 mode Managed (wlan0 의 모드를 결정)
# iwconfig wlan0 key 12341 (보안키를 쓸대 키값 입력 키 없으면 key off 옵션으로 대체)
# iwconfig wlan0 essid linksys (linksys는 스캔해서 찾은 essid)
# dhcpcd wlan0 (네트워크가 DHCP 일때)
# ifconfig (네트워크가 잡혀있는지 확인)

2008년 1월 22일 화요일

SSH 터널링 팁

유닉스 SSH 명령어 터널링 방법
예제자신의 로컬 포트 2222 로 내부 서버인 특정 서버 특정 포트로 연결할수 있다.
-N IP 옵션은 외부와 연결가능한 서버이다.

예제
외부와 연결할수 있는 192.168.0.10 의 SSH 를 이용하여 내부서버인 192.168.0.72 로 직접 퍼워딩하는 기능
ssh -f -C -L2222:192.168.0.72:22 -N 192.168.0.10

SecureCRT, PuTTY 에서도 가능 하다.


역 터널링 팁

보통의 내부 서버들은 기본적으로 OutBound NAT 정책이 막혀 있어 외부와 통신이 어렵다. 각 내부 서버에서 외부랑 통신이 가능한 GW 서버를 경유하여 외부와 접근이 가능하다.

예제 192.168.0.10 이 외부와 통신가능한 GW 서버이고
192.168.0.72 서버가 외부와 통신이 불가능한 내부통신이다. 이 서버내에 특정 외부 IP 인 192.168.10.17 로 22번 포트를 접속 할수 있다.

192.168.0.72 번 서버내에서 아래와 같은 명령으로 접속 가능
ssh -f -C -L2222:192.168.10.17:22 -N 192.168.0.10

이제 192.168.0,72 번 서버는 Localhost 2222 번 포트를 통해 외부 192.168.10.17 22번 포트와 접속 가능

2008년 1월 11일 금요일

X-Window 에서 한영 키 잡기

/etc/X11/Xmodmap 파일을 열어 아래와 같은 라인 두개 추가 후 X-Window 재시작.

keycode 209 = Hangul_Hanja
keycode 210 = Hangul

VMWare GuestOS 한영키 잡기

X 윈도우가 한영 키보드를 인식하게 설정이 되어야 한다.

/etc/vmware/config 파일에 다음 두 설정 값을 추가한다.

xkeymap.keysym.Hangul = 0x0f2
xkeymap.keysym.Hangul_Hanja = 0x0f1

추가후 VMware 를 재구동하면 VMWare GuestOS 에서도 한영 키가 사용 가능하다.

이 기종간 키보드 마우스 공유하기

Synergy - http://synergy2.sourceforge.net/

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems, each with its own display, without special hardware. It's intended for users with multiple computers on their desk since each system uses its own monitor(s).

Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. Furthermore, it synchronizes screen savers so they all start and stop together and, if screen locking is enabled, only one screen requires a password to unlock them all. Learn more about how it works.

Synergy is open source and released under the GNU Public License (GPL).

System Requirements
  • Microsoft Windows 95, Windows 98, Windows Me (the Windows 95 family)
  • Microsoft Windows NT, Windows 2000, Windows XP (the Windows NT family)
  • Mac OS X 10.2 or higher
  • Unix
    X Windows version 11 revision 4 or up
    XTEST extension(use "xdpyinfo grep XTEST" to check for XTEST)
All systems must support TCP/IP networking.

"Unix" includes Linux, Solaris, Irix and other variants. Synergy has only been extensively tested on Linux and may not work completely or at all on other versions of Unix. Patches are welcome (including patches that package binaries) at the patches page.

The Mac OS X port is incomplete. It does not synchronize the screen saver, only text clipboard data works (i.e. HTML and bitmap data do not work), the cursor won't hide when not on the screen, and there may be problems with mouse wheel acceleration. Other problems should be filed as bugs.

자세한 사용 방법은 아래의 블로그 참조
http://jwmx.tistory.com/833