ref: http://pythoninreal.blogspot.kr/2013/12/virtualenv.html

ref: http://yong27.biohackers.net/373


설치:

sudo pip install virtualenv


프로젝트 생성:

virtualenv 프로젝트명

ex) virtualenv ar_project


이때, ar_project 폴더 생성후 python 기본 libs 가 복사됩니다.


해당 가상환경으로 들어가기:

. ar_project/bin/activate



프로젝트 패키지 목록:

pip freeze > requirements.txt


패키지 목록 설치:

pip install -r requirements.txt




설치

$ apt-get install python-setuptools

$ easy_install -U pip


기존에는 아래와 같이 간단히 'apt-get install python-pip' 를 사용했었는데, 에러 발생시 우분투에서 빨리 패치를 해주는것 같지 않다. 그래서 귀찮아도 위처럼 설치 하기로 결정~

ref: http://stackoverflow.com/questions/27341064/how-do-i-fix-importerror-cannot-import-name-incompleteread/27341847#27341847


or

$ apt-get install python-pip


ref: https://www.bartbania.com/raspberry_pi/files-list-file-missing-final-newline/


여러가지 기타 이유( 디스크에러, 메모리에러, ... )로, 패키지 파일 목록 파일이 잘못 되었을경우 조치법

증상(한글) :

dpkg: 복구 불가능한 치명적 오류, 중지합니다:

 'libzbar0' 패키지의 파일 목록 파일에 마지막 줄 바꿈이 빠졌습니다

E: Sub-process /usr/bin/dpkg returned an error code (2)

증상(영문):

dpkg: unrecoverable fatal error, aborting:

 files list file for package 'libzbar0' is missing final newline

E: Sub-process /usr/bin/dpkg returned an error code (2)


해결방안: 해당 패키지 지금 같은경우 libzbar0 를 의 목록 파일을 다시 만들어 준다.


1. 해당 패키지 다운로드

sudo apt-get install --reinstall --download-only libzbar0

다운로드후 받은 파일명 확인 : /var/cache/apt/archives/libzbar0_0.10+doc-9build1_amd64.deb 


2. 해당 패키지 파일목록 만들기libzbar0.list 파일이 생성 됩니다. )

dpkg -c /var/cache/apt/archives/libzbar0_0.10+doc-9build1_amd64.deb | \

awk '{if ($6 == "./"){ print "/."; } else if \

(substr($6, length($6), 1) == "/"){print \

substr($6, 2, length($6) - 2); } else { print \

substr($6, 2, length($6) - 1);}}' > \

/var/lib/dpkg/info/libzbar0.list


ps. dpkg -c 패키지이름.deb  ==> 해당 패키지의 파일 목록 출력





(gdb) help generate-core-file

Save a core file with the current state of the debugged process.

Argument is optional filename.  Default filename is 'core.<process_id>'.

(gdb) generate-core-file


 kill -l

 1) SIGHUP       2) SIGINT       3) SIGQUIT      4) SIGILL       5) SIGTRAP

 6) SIGABRT      7) SIGBUS       8) SIGFPE       9) SIGKILL     10) SIGUSR1

11) SIGSEGV     12) SIGUSR2     13) SIGPIPE     14) SIGALRM     15) SIGTERM

16) SIGSTKFLT   17) SIGCHLD     18) SIGCONT     19) SIGSTOP     20) SIGTSTP

21) SIGTTIN     22) SIGTTOU     23) SIGURG      24) SIGXCPU     25) SIGXFSZ

26) SIGVTALRM   27) SIGPROF     28) SIGWINCH    29) SIGIO       30) SIGPWR

31) SIGSYS      34) SIGRTMIN    35) SIGRTMIN+1  36) SIGRTMIN+2  37) SIGRTMIN+3

38) SIGRTMIN+4  39) SIGRTMIN+5  40) SIGRTMIN+6  41) SIGRTMIN+7  42) SIGRTMIN+8

43) SIGRTMIN+9  44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13

48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12

53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9  56) SIGRTMAX-8  57) SIGRTMAX-7

58) SIGRTMAX-6  59) SIGRTMAX-5  60) SIGRTMAX-4  61) SIGRTMAX-3  62) SIGRTMAX-2

63) SIGRTMAX-1  64) SIGRTMAX


kill -STOP pid

kill -19 pid



gdb program_name `pidof program_name`




kill -CONT pid

kill -18 pid





kill -STOP `pidof RFTS`

gdb RFTS `pidof RFTS`

$ generate-core-file

kill -CONT `pidof RFTS`




ref : http://www.linuxlab.co.kr/docs/00-05-2.htm



망내 아이피 검색

    # nmap -sP 192.168.7.0/24
    Starting nmap V. 2.12 by Fyodor (fyodor@dhp.com, www.insecure.org/nmap/)
    Host  (192.168.7.11) appears to be up.
    Host  (192.168.7.12) appears to be up.
    Host  (192.168.7.76) appears to be up.
    Nmap run completed -- 256 IP addresses (3 hosts up) scanned in 1 second


** Port Scanning **

    # nmap -sT 192.168.7.12
    Starting nmap V. 2.12 by Fyodor 
    (fyodor@dhp.com, www.insecure.org/nmap/)
    Interesting ports on (192.168.7.12):
    Port    State       Protocol    Service
    7        open        tcp        echo
    9        open        tcp        discard
    13      open        tcp        daytime
    19      open        tcp        chargen
    21      open        tcp        ftp
    ...
    Nmap run completed -- 1 IP address (1 host up) scanned in 3 seconds


** Stealth Scanning **

    # nmap -sS 192.168.7.7
    Starting nmap V. 2.12 by Fyodor 
    (fyodor@dhp.com, www.insecure.org/nmap/)
    Interesting ports on saturnlink.nac.net 
    (192.168.7.7):
    Port    State       Protocol  Service
    21      open        tcp        ftp
    25      open        tcp        smtp
    53      open        tcp        domain
    80      open        tcp        http
    ...
    Nmap run completed -- 1 IP address (1 host up) scanned in 1 second




 

ref: http://ioriy2k.pe.kr/archives/4762

 

0. root 권한으로 설치.

 

1. apache + mysql 설치

 tasksel 을 이용해서 설치한다.

 

$ tasksel

 

 

LAMP server : Linux Apache Mysql Php

apache 와 mysql 만 필요하지만 기본 패키지로 설치

 

 

2. redmine 설치

$ apt-get install redmine redmine-mysql

 

이후 아래 화면 에서 "예' 선택 ( dbconfig-common 을 이용해서 mysql 을 선택합니다. )

 

mysql db file 위치 : /var/lib/mysql/redmine_default

db name : redmine_default

db id : redmine_default

 

redmine db config : /etc/redmine/default/database.yml

dbconfig-common config : /etc/dbconfig-common/redmine/instances/default.conf

 

redmine root : /usr/share/redmine

 

apache DocumentRoot 아래에 redmine 을 link 합니다.

$ ln -s /usr/share/redmine/public /var/www/html/redmine

apache 에 ruby 연동모듈 passenger 를 설치합니다.

 

$ apt-get install libapache2-mod-passenger

 

passenger 설정

$ vi /etc/apache2/mods-available/passenger.conf

==> 아래 빨간줄 추가

<IfModule mod_passenger.c>
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
  PassengerDefaultUser www-data
</IfModule>

 

 

$ apt-get install ruby-bundler


$ cd /usr/share/redmine
$ bundle install

 

3. apache config

 

$ cd /etc/apache2/sites-available

$ cp 000-default.conf redmine.conf

$ vi redmine.conf

 

==> 아래 빨간줄 추가

...

...
        <Directory /var/www/html/redmine>
           RailsBaseURI /redmine
           PassengerResolveSymlinksInDocumentRoot on
        </Directory>

</VirtualHost>

$ a2dissite 000-default

$ a2ensite redmine

$ service apache2 restart

 

 

 

5.  redmine 접속

 최초 id : admin/admin

 

5.1. 접속후 오른쪽 상단 "내 계정" 메뉴에서 비밀번호를 수정 합니다.

5.2. 왼쪽 상단 "관리" -> "설정" 에서 "일반" 탭에서 첨부파일이나 저장소 인코딩을 "utf-8.euc-kr" 으로 수정합니다.

5.3  "인증" 탭에서 "인증이 필요함" 을 체크 합니다.

 

 


 

 

6. git   설치

 

$ apt-get install git

 

7.  Enable apache module

$ a2enmod env alias cgid

 

8. apache config

$ cd /etc/apache2/sites-available

$ vi git.conf

==> 아래 복사

 

    # /git location for users
    # Git Smart HTTP configuration
    #From the Remine.pm patch file for git-smart-http:


ScriptAliasMatch "(?x)^/git/(.*/(HEAD | info/refs | objects/(info/[^/]+ | [0-9a-f]{2}/[0-9a-f]{38} | pack/pack-[0-9a-f]{40}\.(pack|idx)) | git-(upload|receive)-pack))$" /usr/lib/git-core/git-http-backend/$1

 

    SetEnv GIT_PROJECT_ROOT /var/opt/redmine/git
    SetEnv GIT_HTTP_EXPORT_ALL
    SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER

    PerlLoadModule Apache2::Redmine

    <Location /git>
        Order allow,deny
        # Sample configuration
        # Allow from 192.168.30.0/24 #Retrict Git access to local network

        Allow from all

        Satisfy all

        AuthType Basic
        AuthName "git repositories"
        Require valid-user

        PerlAccessHandler Apache::Authn::Redmine::access_handler
        PerlAuthenHandler Apache::Authn::Redmine::authen_handler

        ## for mysql
        RedmineDSN "DBI:mysql:database=redmine_default;host=localhost"
        RedmineDbUser "redmine_default"
        RedmineDbPass "****"
        RedmineGitSmartHttp yes
    </Location>

 

9.  git 저장소용 폴더 생성

$ mkdir -p /var/opt/redmine/git

$ chown www-data:www-data /var/opt/redmine/git

 

10.  redmine 에서 git  을 접근할때  Perl 을 이용합니다. 아래 설치및 파일  link

$ apt-get install libapache-dbi-perl libapache2-mod-perl2
$ ln -sf /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache/Redmine.pm
$ ln -sf /usr/share/redmine/extra/svn/Redmine.pm /usr/lib/perl5/Apache2/Redmine.pm

 

 

11. redmine 에서 git  저장소를 생성할수있는  plugin 설치

ref : http://projects.andriylesyuk.com/project/redmine/scm-creator

 

 

$ apt-get install subversion

$ cd /usr/share/redmine

$ mkdir plugins

$ cd plugins

$ svn co http://svn.s-andy.com/scm-creator redmine_scm

$ export RAILS_ROOT=/usr/share/redmine

$ cd /usr/share/redmine
$ rake redmine:plugins:migrate RAILS_ENV=production

 

 

Migrating redmine_scm (SCM Creator)...
==  AddRepositoriesCreatedWithScm: migrating ==================================
-- add_column(:repositories, :created_with_scm, :boolean, {:default=>false, :null=>false})
   -> 0.1249s
==  AddRepositoriesCreatedWithScm: migrated (0.1262s) =========================

$ cd /usr/share/redmine/config

$ vi scm.yml

 

==> 아래 복사

production:
  deny_delete: false
  auto_create: true
  force_repository: false
  pre_create: /usr/local/bin/pre-create.sh
  post_create: /usr/local/bin/post-create.sh
  pre_delete: /usr/local/bin/pre-delete.sh
  post_delete: /usr/local/bin/post-delete.sh
  max_repos: 0
  only_creator: false
  allow_add_local: false
  allow_pickup: false

  git:
    path: /var/opt/redmine/git
    git: /usr/bin/git
    options: --bare
    url: http://192.168.30.99/git
    update_server_info: true
    git_ext: true
    append: trunk

development:

 

 

Note. 아래 에러 발생시

ActionController::RoutingError (No route matches [GET] "/plugin_assets/redmine_scm/javascripts/scm_utils_jquery.js"):

$ cd /usr/share/redmine/public

$ mkdir plugin_assets


$ chown -R www-data:www-data plugin_assets

$ chmod -R 755 plugin_assets



$ cd /var/www/html/redmine/plugin_assets

$ ln -s /usr/share/redmine/plugins/redmine_scm/assets redmine_scm



$ a2ensite git 

$ service apache2 restart

 

 

 

 



 Agile Plugin

http://www.redmine.org/plugins/redmine_agile


download : http://redminecrm.com/projects/agile/pages/1

install : http://redminecrm.com/projects/agile/pages/2


$ cd /var/www/html/redmine/plugin_assets

$ ln -s /usr/share/redmine/plugins/redmine_agile/assets redmine_agile




 

 

 

 




// ubuntu site
https://help.ubuntu.com/community/Grub2#Reinstalling%20from%20LiveCD



Boot info script
http://sourceforge.net/projects/bootinfoscript/
ex)

                  Boot Info Script 0.60    from 17 May 2011


============================= Boot Info Summary: ===============================

 => Windows is installed in the MBR of /dev/sda.

sda1: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info:

sda2: __________________________________________________________________________

    File system:       Extended Partition
    Boot sector type:  -
    Boot sector info:

sda5: __________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info:
    Operating System:  Ubuntu 10.04.2 LTS
    Boot files:        /boot/grub/grub.cfg /etc/fstab /boot/grub/core.img

sda3: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows XP
    Boot sector info:   No errors found in the Boot Parameter Block.
    Operating System:  Windows XP
    Boot files:        /boot.ini /ntldr /NTDETECT.COM

.
.
.
.





 

super grub2
http://www.supergrubdisk.org/super-grub2-disk/

sudo lshw -businfo -C disk
root@chozo99-laptop:/boot/grub# sudo lshw -businfo -C disk
Bus info          Device      Class      Description
====================================================
scsi@1:0.0.0      /dev/cdrom  disk       DVD reader
scsi@2:0.0.0      /dev/sda    disk       54GB VBOX HARDDISK

chozo99@chozo99-laptop:~$ sudo fdisk -l

Disk /dev/sda: 55.0 GB, 54975791104 bytes
255 heads, 63 sectors/track, 6683 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000b62f8

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1               1         487     3905536   82  Linux swap / Solaris
Partition 1 does not end on cylinder boundary.
/dev/sda2             487        4134    29295617    5  Extended
/dev/sda3   *        4135        6682    20466810    7  HPFS/NTFS
/dev/sda5             487        4134    29295616   83  Linux



 


==> 갠적으로 추천 ( windows7 64bit 에서 tailforwin32 가 제대로 되지 않아서 찾던중 발견 )
http://www.baremetalsoft.com/baretail/



opensource
http://tailforwin32.sourceforge.net/


ref : http://www.sjava.net/213

sudo apt-get install ubuntu-desktop





.svn 파일 지울때
find ./ -name '.svn' | xargs rm -rf




+ Recent posts