Linux/Ubuntu2013. 7. 10. 16:24
korea 에서 Main으로 바꾸니 더욱 빨라진 기분..
(기분이라기 보다는 느낌? ㅋㅋㅋ
바꾸기 전에는 국내 서버에서 30kB/s 이렇게 날아오던던게 메가급으로 날아온다 -_-
어떻게 국내가 더 느려진겨?)

 
Posted by 구차니
Linux/Ubuntu2013. 7. 10. 16:16
비정상 실행시 /etx/X11/xorg.conf.failsafe 파일을 가지고 노는게 나을려나..
$ ll /etc/X11/
total 96
drwxr-xr-x  10 root root  4096 Jul 10 16:00 ./
drwxr-xr-x 127 root root 12288 Jul 10 15:56 ../
lrwxrwxrwx   1 root root    13 Sep  9  2012 X -> /usr/bin/Xorg*
-rwxr-xr-x   1 root root   709 Apr  1  2010 Xreset*
drwxr-xr-x   2 root root  4096 Feb 14 07:09 Xreset.d/
drwxr-xr-x   2 root root  4096 Feb 14 07:09 Xresources/
-rwxr-xr-x   1 root root  3730 Jan 20  2012 Xsession*
drwxr-xr-x   2 root root  4096 Feb 14 07:10 Xsession.d/
-rw-r--r--   1 root root   265 Jul  2  2008 Xsession.options
-rw-r--r--   1 root root   601 Feb 14 07:09 Xwrapper.config
drwxr-xr-x   2 root root  4096 Feb 14 07:10 app-defaults/
drwxr-xr-x   2 root root  4096 Feb 14 07:10 cursors/
-rw-r--r--   1 root root    18 Feb 14 07:09 default-display-manager
drwxr-xr-x   4 root root  4096 Feb 14 07:09 fonts/
-rw-r--r--   1 root root 17394 Dec  3  2009 rgb.txt
drwxr-xr-x   3 root root  4096 Feb 14 07:10 xinit/
drwxr-xr-x   2 root root  4096 Jan 24  2012 xkb/ 

아래 경로로 옮겨진 10-monitor.conf를 생성해서 가지고 노는게 좋으려나?
$ ll /usr/share/X11/xorg.conf.d/
total 36
drwxr-xr-x 2 root root 4096 Feb 14 07:09 ./
drwxr-xr-x 5 root root 4096 Feb 14 07:09 ../
-rw-r--r-- 1 root root 1099 Jan 19 21:39 10-evdev.conf
-rw-r--r-- 1 root root  590 Dec  8  2012 11-evdev-quirks.conf
-rw-r--r-- 1 root root  364 Dec  8  2012 11-evdev-trackpoint.conf
-rw-r--r-- 1 root root 1593 Dec  8  2012 50-synaptics.conf
-rw-r--r-- 1 root root  115 Dec  8  2012 50-vmmouse.conf
-rw-r--r-- 1 root root  842 Dec  8  2012 50-wacom.conf
-rw-r--r-- 1 root root  590 Dec  8  2012 51-synaptics-quirks.conf


아무튼
$ sudo service lightgdm stop 
$ sudo X -configure 
라고 입력하니 $HOME 에 xorg.conf.new 라고 빈내용의 설정파일이 생성된다.

$ cat xorg.conf.new
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        Screen      1  "Screen1" RightOf "Screen0"
        Screen      2  "Screen2" RightOf "Screen1"
        Screen      3  "Screen3" RightOf "Screen2"
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
        ModulePath   "/usr/lib/xorg/modules"
        FontPath     "/usr/share/fonts/X11/misc"
        FontPath     "/usr/share/fonts/X11/cyrillic"
        FontPath     "/usr/share/fonts/X11/100dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/75dpi/:unscaled"
        FontPath     "/usr/share/fonts/X11/Type1"
        FontPath     "/usr/share/fonts/X11/100dpi"
        FontPath     "/usr/share/fonts/X11/75dpi"
        FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
        FontPath     "built-ins"
EndSection

Section "Module"
        Load  "glx"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option      "Protocol" "auto"
        Option      "Device" "/dev/input/mice"
        Option      "ZAxisMapping" "4 5 6 7"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier   "Monitor1"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier   "Monitor2"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Monitor"
        Identifier   "Monitor3"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "NoAccel"                   # [<bool>]
        #Option     "AccelMethod"               # <str>
        #Option     "Backlight"                 # <str>
        #Option     "DRI"                       # [<bool>]
        #Option     "ColorKey"                  # <i>
        #Option     "VideoKey"                  # <i>
        #Option     "Tiling"                    # [<bool>]
        #Option     "LinearFramebuffer"         # [<bool>]
        #Option     "SwapbuffersWait"           # [<bool>]
        #Option     "XvPreferOverlay"           # [<bool>]
        #Option     "HotPlug"                   # [<bool>]
        #Option     "RelaxedFencing"            # [<bool>]
        #Option     "XvMC"                      # [<bool>]
        #Option     "Throttle"                  # [<bool>]
        #Option     "ZaphodHeads"               # <str>
        #Option     "DelayedFlush"              # [<bool>]
        #Option     "TearFree"                  # [<bool>]
        #Option     "PerCrtcPixmaps"            # [<bool>]
        #Option     "FallbackDebug"             # [<bool>]
        #Option     "DebugFlushBatches"         # [<bool>]
        #Option     "DebugFlushCaches"          # [<bool>]
        #Option     "DebugWait"                 # [<bool>]
        #Option     "BufferCache"               # [<bool>]
        #Option     "TripleBuffer"              # [<bool>]
        Identifier  "Card0"
        Driver      "intel"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"                  # [<bool>]
        #Option     "kmsdev"                    # <str>
        #Option     "ShadowFB"                  # [<bool>]
        Identifier  "Card1"
        Driver      "modesetting"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "Rotate"                    # <str>
        #Option     "fbdev"                     # <str>
        #Option     "debug"                     # [<bool>]
        Identifier  "Card2"
        Driver      "fbdev"
        BusID       "PCI:0:2:0"
EndSection

Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "DefaultRefresh"            # [<bool>]
        #Option     "ModeSetClearScreen"        # [<bool>]
        Identifier  "Card3"
        Driver      "vesa"
        BusID       "PCI:0:2:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen1"
        Device     "Card1"
        Monitor    "Monitor1"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen2"
        Device     "Card2"
        Monitor    "Monitor2"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

Section "Screen"
        Identifier "Screen3"
        Device     "Card3"
        Monitor    "Monitor3"
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
        EndSubSection
EndSection

xrandr 로 모니터 지원 해상도를 설정하면 된다는데 어떻게 설정을 해야 하려나..
$ xrandr
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 8192 x 8192
VGA1 connected 1024x768+0+0 (normal left inverted right x axis y axis) 477mm x 268mm
   1920x1080      60.0 +
   1600x1200      65.0     60.0  
   1680x1050      60.0  
   1680x945       60.0  
   1400x1050      74.9     60.0  
   1600x900       60.0  
   1280x1024      75.0     60.0  
   1440x900       75.0     59.9  
   1280x960       60.0  
   1366x768       60.0  
   1360x768       60.0  
   1280x800       74.9     59.8  
   1152x864       75.0  
   1280x768       74.9     59.9  
   1024x768       75.0     70.1     60.0
   1024x576       60.0  
   800x600        72.2     75.0     60.3     56.2  
   848x480        60.0  
   640x480        75.0     72.8     60.0  
HDMI1 disconnected (normal left inverted right x axis y axis)
DP1 disconnected (normal left inverted right x axis y axis) 

Section "Monitor"
  Identifier "Monitor0"
  Modeline "1920x1080_60.00" 82.97 1000 1064 1168 1336 1000 1001 1004 1035 -HSync +Vsync
EndSection

Section "Screen"
  Identifier "Screen0"
  Device "HDMI-1"
  Monitor "Monitor0"
  DefaultDepth 24
  SubSection "Display"
    Depth 24
    Modes "1920x1080_60.00" "1024x768"
  EndSubSection
EndSection 
[링크 : http://samuelmartin.wordpress.com/2012/05/29/enabling-resolutions-in-ubuntu-12-04-lubuntu-12-04/]
[링크 : http://ubuntu.or.kr/viewtopic.php?p=103635

Posted by 구차니
Linux/Ubuntu2013. 7. 10. 14:38
집에 아이피가 공유기를 사용하여 192.168.0.x대로 되어있고
PPTP를 NAT 사용하지 않고 안드로이드 폰으로 연결하는 경우에 대한 설정이다.

일단 서버 아이피는 192.168.0.199로 고정되어 있고
회선은 KT 이므로 DNS는 168.126.63.1 와 168.126.63.2 로 설정하였다.

pptp 사용시 암호는 username / password 이며
공유기에서는 1723 번 포트를 포워딩 해주어야 한다.

$ sudo apt-get install pptpd
$ sudo vi /etc/pptpd.conf
# (Recommended)
localip 192.168.0.199
remoteip 192.168.0.234-238,192.168.0.245 

$ sudo vi /etc/ppp/pptpd-options
# Network and Routing

# If pppd is acting as a server for Microsoft Windows clients, this
# option allows pppd to supply one or two DNS (Domain Name Server)
# addresses to the clients.  The first instance of this option
# specifies the primary DNS address; the second instance (if given)
# specifies the secondary DNS address.
# Attention! This information may not be taken into account by a Windows
# client. See KB311218 in Microsoft's knowledge base for more information.
#ms-dns 10.0.0.1
#ms-dns 10.0.0.2
ms-dns 168.1
26.63.1
ms-dns 168.1
26.63.2  

$ sudo vi /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
username        pptpd   password                * 



혹시나 했지만.. packet forwarding이 설정되지 않으면 안된다.
NAT와는 별개로 포워딩은 켜줘야 PPTP로 전송이 됨.

$ sudo vi /etc/sysctl.conf
# Uncomment the next line to enable packet forwarding for IPv4
net.ipv4.ip_forward=1 

$ sudo sysctl -p

[링크 : http://prettygom.com/entry/우분투에서-pptp-VPN-설정]


---
안드로이드에서 테스트
PPTP로 설정후


아이디 / 암호를 넣고


접속하면 끝!


상태바에도 올라간다!

 
Posted by 구차니
Linux/Ubuntu2013. 6. 14. 12:07
의외로 싱겁게
$ sudo apt-get install 대신
$ sudo apt-get source

패키지 마다 다르지만 svn으로 관리하는 녀석은 실행하는 경로에 받아 버리니 주의!

$ sudo apt-get source ngircd
패키지 목록을 읽는 중입니다... 완료
의존성 트리를 만드는 중입니다
상태 정보를 읽는 중입니다... 완료
알림: 'ngircd' 패키징은 다음 'Svn' 버전 컨트롤 시스템에서 관리합니다:
svn://svn.debian.org/pkg-irc/
소스 아카이브를 485 k바이트 받아야 합니다.
받기:1 http://kr.archive.ubuntu.com/ubuntu/ precise/universe ngircd 18-2 (dsc) [1,272 B]
받기:2 http://kr.archive.ubuntu.com/ubuntu/ precise/universe ngircd 18-2 (tar) [465 kB]
받기:3 http://kr.archive.ubuntu.com/ubuntu/ precise/universe ngircd 18-2 (diff) [19.2 kB]
내려받기 485 k바이트, 소요시간 0초 (547 k바이트/초)
gpgv: Signature made 2011년 11월 18일 (금)  using DSA key ID 3FD29468
gpgv: Can't check signature: public key not found
dpkg-source: warning: failed to verify signature on ./ngircd_18-2.dsc
dpkg-source: info: extracting ngircd in ngircd-18
dpkg-source: info: unpacking ngircd_18.orig.tar.gz
dpkg-source: info: applying ngircd_18-2.diff.gz
dpkg-source: info: upstream files that have been modified:
 ngircd-18/config.guess
 ngircd-18/config.sub
 ngircd-18/src/testsuite/Makefile.in

[링크 : http://askubuntu.com/questions/28372/how-do-i-get-the-source-code-of-packages-installed-through-apt-get]
Posted by 구차니
Linux/Ubuntu2013. 1. 15. 09:18

$ sudo apt-get install rpm2cpio 
$ rpm2cpio [rpm 파일 이름] | cpio -idv
[링크 : http://bs-secretroom.blogspot.kr/2012/10/rpm.html

2009/11/04 - [Linux] - 설치하지 않은 rpm에 포함된 파일의 내용 보기

Posted by 구차니
Linux/Ubuntu2012. 11. 23. 10:06
업그레이드 해볼까 하고 했더니 SSH를 통해서는 위험하다고 겁주네 -_-

$ do-release-upgrade
Checking for a new ubuntu release
Done Upgrade tool signature
Done Upgrade tool
Done downloading
authenticate 'precise.tar.gz' against 'precise.tar.gz.gpg'
extracting 'precise.tar.gz'

캐시 읽는 중

패키지 관리자 확인 중

SSH를 통해 계속 진행하시겠습니까?

현재 세션은 SSH에서 돌아가고 있습니다. SSH를
이용한 세션에서 업그레이드를 하는 것은 추천하지
않습니다. 업그레이드에 실패할 경우 복구하기가
힘들어 집니다.

진행하시면 '1022' 포트로 추가 SSH데몬을 시작할
것입니다.
계속 진행하시겠습니까?

계속 [yN]
 



Posted by 구차니
Linux/Ubuntu2012. 10. 15. 17:20
통상 서버
ssh
samba system-config-samba
apache2 mysql-client-5.5 php5 php5-mysql php5-gd

개발서버
nfs-kernel-server
build-essential 

관리용
lynx
mc
vim
htop
dstat
gsmartcontrol

사용자 
chromium-browser
vlc

귀찮을때 
$ sudo apt-get install  ssh samba system-config-samba apache2 mysql-client-5.5 php5 php5-mysql php5-gd nfs-kernel-server lynx mc vim chromium-browser vlc  htop dstat gsmartcontrol 

어딘가 저장해놨던거 같은데 사라져서 다시 저장 -_-
Ubuntu 12.04 LTS / 2012년 10월 15일 기준 
Posted by 구차니
Linux/Ubuntu2012. 7. 9. 20:10
screen 명령을 다시 써봤더니
putty에서 ctrl - a,d 문제 없이 되고 터미널도 다시 실행되서 패닉중 -ㅁ-

UID        PID  PPID  C STIME TTY          TIME CMD
root         1     0  0 19:56 ?        00:00:01 /sbin/init
root      2196   698  0 19:59 ?        00:00:00 sshd: minimonk [priv]
minimonk  2316  2196  0 19:59 ?        00:00:00 sshd: minimonk@pts/0
minimonk  2317  2316  0 19:59 pts/0    00:00:01 -bash
minimonk  2419     1  0 20:01 ?        00:00:00 SCREEN
minimonk  2420  2419  0 20:01 pts/2    00:00:00 /bin/bash
minimonk  2474  2420  0 20:01 pts/2    00:00:00 rtorrent

root      2942   698  0 20:13 ?        00:00:00 sshd: minimonk [priv]
minimonk  3068  2942  0 20:13 ?        00:00:00 sshd: minimonk@pts/4
minimonk  3069  3068  3 20:13 pts/4    00:00:01 -bash
minimonk  3225  3069  0 20:14 pts/4    00:00:00 screen -R -D 

아무튼, PID 0번은 /sbin/init 이고
SCREEN은 어떻게 한건진 모르겠지만(!) PPID가 1이다.
그나저나 screen으로 실행했는데 왜 SCREEN 이 된거지...?

sshd: [priv]
   sshd : @pts/0
      bash

SCREEN
    bash
        rtorrent

아무튼 이런식으로 구성이 되고,
첫번째 ssh 가상 터미널은 pts/0 에서 실행중이고
screen은 pts/2에서 실행중이다.
두번째 ssh 가상 터미널은 pts/4 에서 실행이 되었고
두번째 ssh 에서 screen으로 끌어와도 rtorrent는 pts/2에 여전히 남아있다.

2012/07/07 - [Linux] - ssh 를 통해 프로그램 실행후 로그아웃 해도 종료되지 않게 하기

Posted by 구차니
Linux/Ubuntu2012. 6. 9. 19:34
/apps/gnome_settings_daemon/plugins 에 media-keys가 존재하지 않으면 생성해주면 된다.
생성시에는 아래와 같이 참/거짓(boolean)형으로 값은 거짓으로 생성해주면 바로 서비스가 중지된다.



근데... 내가 저 설정편집기를 어떻게 해서 설치했더라?

[링크 : http://forums.fedoraforum.org/showthread.php?t=230568]
Posted by 구차니
Linux/Ubuntu2012. 6. 8. 11:35
패치를 하거나, perl을 통해서 한글 변환하는 것도 있지만
unzip 도움말을 보니 -O 라는 옵션이 존재하길래 해보니 문제없이 잘 풀린다.
단, -l을 통해 목록 보는건 여전히 깨지는 문제가 있다.

$ unzip --help
UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.

Usage: unzip [-Z] [-opts[modifiers]] file[.zip] [list] [-x xlist] [-d exdir]
  Default action is to extract files in list, except those in xlist, to exdir;
  file[.zip] may be a wildcard.  -Z => ZipInfo mode ("unzip -Z" for usage).

  -p  extract files to pipe, no messages     -l  list files (short format)
  -f  freshen existing files, create none    -t  test compressed archive data
  -u  update files, create if necessary      -z  display archive comment only
  -v  list verbosely/show version info       -T  timestamp archive to latest
  -x  exclude files that follow (in xlist)   -d  extract files into exdir
modifiers:
  -n  never overwrite existing files         -q  quiet mode (-qq => quieter)
  -o  overwrite files WITHOUT prompting      -a  auto-convert any text files
  -j  junk paths (do not make directories)   -aa treat ALL files as text
  -U  use escapes for all non-ASCII Unicode  -UU ignore any Unicode fields
  -C  match filenames case-insensitively     -L  make (some) names lowercase
  -X  restore UID/GID info                   -V  retain VMS version numbers
  -K  keep setuid/setgid/tacky permissions   -M  pipe through "more" pager
  -O CHARSET  specify a character encoding for DOS, Windows and OS/2 archives
  -I CHARSET  specify a character encoding for UNIX and other archives

See "unzip -hh" or unzip.txt for more help.  Examples:
  unzip data1 -x joe   => extract all files except joe from zipfile data1.zip
  unzip -p foo | more  => send contents of foo.zip via pipe into program more
  unzip -fo foo ReadMe => quietly replace existing ReadMe if archive file newer 

 $  sudo unzip -O cp949 -d directory/ filename.zip  

Posted by 구차니