[WinMerge] Linux Kernel 디렉토리 비교를 위한 Filter

커널은 빌드하면 .cmd 같은게 나와서 디렉토리로 비교하면 저런거 때문에 더럽다.

그래서 필터에 .cmd 같은거 추가해서 쓰면 된다~

다음을 Linux.flt 같은걸로 저장해서 필터 있는데다 같이 넣어주자~

## This is a directory/file filter template for WinMerge
name: Linux
desc: for Linux kernel
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
## Filters for filenames begin with f:
## Filters for directories begin with d:
## (Inline comments begin with ” ##” and extend to the end of the line)
f: \.o$
f: \.lib$
f: \.bak$ ## backup
f: \.cmd$
d: \\cvs$ ## CVS control directory

 

[Linux] shell 에서 메일 보내기

이용 가능한 SMTP가 있는 경우 shell 에서도 메일을 보낼 수 있다. 쉘 스크립트 상에서 메일을 보내거나 할 때 유용하다. 가장 편한 방법이 sendemail 을 이용하는 것 같다.
다음과 같이 하면 된다. 아래 예제는 무인증 SMTP를 이용할 경우의 예제이다.

$ sendEmail -f “보내는이@메일” -s <SMTP 서버 주소> -t “받는이@메일” -u “메일 제목” -m “메일 내용”

Perl script 를 이용해서도 간편히 보낼 수 있는데, 예제는 다음과 같다.

#!/usr/bin/perl -w
use Net::SMTP;
$smtp = Net::SMTP->new(‘<SMTP 서버 주소>’);
$smtp->mail(‘보내는이@메일’);
$smtp->to(‘받는이@메일’);
$smtp->data();
$smtp->datasend(“To: dasomoli\n”);
$smtp->datasend(“Subject: A simple test mail subject\n”);
$smtp->datasend(“\n”);
$smtp->datasend(“A simple test message\n”);
$smtp->datasend(“A simple test message 2\n”);
$smtp->dataend();
$smtp->quit;

한글 메일을 보내고 싶으면 perl 스크립트로 아래와 같이 MIME::Lite 를 사용하면 된다.

$ sudo apt-get install libmime-lite-perl

#!/usr/bin/perl -w
use MIME::Lite;
### Create a new multipart message:
$msg = MIME::Lite->new(
                From    => ‘보내는이@메일’,
                To      => ‘받는이@메일’,
                Subject => ‘Hangul test’,
                Data    => ‘한글’,
                );
$msg->attr(‘content-type.charset’ => ‘UTF-8’);
### Add parts (each “attach” has same arguments as “new”):
### use Net:SMTP to do the sending
$msg->send(‘smtp’, ‘<SMTP 서버 주소>’, Debug=>1 );

참고 : 
http://nixcraft.com/shell-scripting/11895-shell-script-send-email-via-smtp-username-password.html
http://caspian.dotconf.net/menu/Software/SendEmail/
http://perldoc.perl.org/Net/SMTP.html
http://search.cpan.org/~rjbs/MIME-Lite-3.028/lib/MIME/Lite.pm

[Windows7] 도구 모음 대신 Rocket Dock

Windows 7으로 업그레이드하면서 Windows XP 에서 사용하던 자주 사용하는 프로그램 바로가기를 도구모음으로 바탕화면 오른쪽에 띄워놓고 필요할 때마다 사용하던 것이 불가능해졌다. 내가 모르는건가…
별도 프로그램을 이용하지 않고 사용할 수 있어서 매우 편리했는데 없어지니 매우 불편해서 어떻게 할까 하다가 Dock 프로그램을 사용해서 같은 방법으로 사용하기로 했다. 작업 상 효율적이던 습관을 바꿀 필요는 없으니까.
Dock이라고 검색하자마자 나온 Rocket Dock을 설치해서 사용해봤는데 뜨는 위치를 두번째 모니터의 오른쪽으로 위치를 변경하면 거의 동일하게 사용할 수 있다.

기존에 폴더의 바로가기를 아이콘으로 등록할 때 경로로 등록해야 한다는 점과 등록한 아이콘 이름을 조금 수정해줘야 한다는(ddms.bat라면 DDMS로, putty.exe라면 iPutty로, mspaint.exe를 그림판으로 등등) 점을 제외하면 꽤 괜찮은 거 같다.

확대되는 효과가 보기에는 좋지만 클릭하려고 할 때 뭔가 위치를 혼동시키는 느낌이라 확대되는 효과를 없애고,
폰트를 조정해 글자색을 윤곽색과 같은 색으로 지정하고 나니 아이콘 이름도 잘 보인다.

그리고 일단, 예전 밋밋한 도구모음보다 예쁘다^^

http://rocketdock.com/download
 

socat을 이용해서 gitproxy 사용하는 방법

* http://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/ 참고
* 아래 스크립트를 gitproxy라는 이름으로 저장함. 사용법은 아래 코멘트 참조. (socat 툴이 깔려 있어야 함 http://www.dest-unreach.org/socat/)


#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config –global core.gitproxy gitproxy
#
# More details at http://tinyurl.com/8xvpny

# Configuration. Common proxy ports are 3128, 8123, 8000.
_proxy=<IP:xxx.xxx.xxx.xxx>
_proxyport=<PORT:8080>


exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport

[Linux] Xming 접속 후 프로그램 실행하는 .xlaunch 만들기

0. 한글 입력이 필요할 경우 다음과 같은 스크립트를 ~/bin 아래에 적당한 이름으로 작성합니다.


#!/bin/bash
export LANG=ko_KR.EUC-KR
export LC_ALL=ko_KR.EUC-KR
export XMODIFIERS=”@im=nabi”
export GTK_IM_MODULE=hangul3f
export GDK_USE_XFT=1
nabi &
절대경로의 실행 프로그램 파일

1. “시작” -> “프로그램” -> “Xming” -> “XLaunch”
2. “Multiple windows” 선택 -> “다음(N)”

3. “Start a program” 선택 -> “다음(N)”
4. “Start program” 에 실행한 파일 이름을 적고(필요하면 절대 경로 포함),
(한글 설정 스크립트의 경우 ~/bin/스크립트명)
“Run Remote” 에 “Using PuTTY(plink.exe)” 를 선택하고,
“Connect to computer” 에 host 주소를, “Login as user” 에 id를, “Password” 에 말 그대로 password를 적는다
-> “다음(N)”
5. PuTTY가 설치된 경로(한글 PuTTY의 경우 C:\Program Files\iPutty)에서 plink.exe 를 선택한다.

6. Font dpi 설정을 위해 “Addtional parameters for Xming” 에 “-dpi 100” 을 적는다. -> “다음(N)”
7. “Save configuration” 을 눌러 바탕화면에 “runStart.xlaunch” 와 같이 저장한다. -> “마침”
 “Include PuTTY password as insecure clear text” 에 체크하면 패스워드를 입력할 필요는 없지만 저장된 파일 안에 패스워드가 그대로 저장되어 보이게 되므로, 취향에 따라 체크하도록 한다.