systemctl daemon-reload
systemctl list-unit-files
systemctl status docker
=======
systemctl enable docker
systemctl disable docker
systemctl list-unit-files | grep docker
systemctl daemon-reload
systemctl list-unit-files
systemctl status docker
=======
systemctl enable docker
systemctl disable docker
systemctl list-unit-files | grep docker
http://askubuntu.com/questions/54441/how-to-configure-two-nic-for-dns-resolv-conf-how-to-eth0-dns-forwards-to-eth1
/etc/resolvconf/resolv.conf.d/head
nameserver <ip_of_nameserver>
resolvconf -u
or
echo "nameserver 168.126.63.1" | sudo resolvconf -a em1.inet
http://superuser.com/questions/511804/in-ubuntu-is-there-a-command-to-show-a-list-of-all-autostart-services
for SysV
remove service
$ update-rc.d -f apache2 remove
add service
$ update-rc.d apache2 defaults
list service
$ ls /etc/rc*.d
or service --status-all
for Upstart
ref: /etc/init
https://www.digitalocean.com/community/tutorials/how-to-install-java-on-ubuntu-with-apt-get
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
alternative
sudo update-alternatives --config java
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 ==> 해당 패키지의 파일 목록 출력
ref: http://ioriy2k.pe.kr/archives/4762
0. root 권한으로 설치.
1. apache + mysql 설치
tasksel 을 이용해서 설치한다.
$ tasksel
LAMP server : Linux Apache Mysql Phpapache 와 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>
$ 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
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.imgsda3: __________________________________________________________________________
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: 0x000b62f8Device 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
ref: http://www.sysprobs.com/access-physical-disk-virtualbox-desktop-virtualization-software
** 해당 사용자 계정에서 실행 합니다.
디스크 사용하기 ( in windows )
권한 문제 발생시 관리자 권한으로 (?? 계속 관리자로 실행해야함 ㅋ )
VBoxManage internalcommands createrawvmdk -filename C:\Users\chozo99\.VirtualBox\VDI\mydrive.vmdk -rawdisk \\.\PhysicalDrive0
VBoxManage internalcommands createrawvmdk -filename C:\Users\chozo99\.VirtualBox\VDI\mysata_test.vmdk -rawdisk \\.\PhysicalDrive0 -partitions 6
==> 디스크번호는 제어판의 컴퓨터관리에서 디스크 번호 확인
또는, 아래 command
wmic diskdrive list brief
==> 파티션의 경우, 첫번째(1), 세번째(3)
VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Note. 파티션 번호 체크시
VBoxManage internalcommands help
createrawvmdk -filename <filename> -rawdisk <diskname>
[-partitions <list of partition numbers> [-mbr <filename>] ]
[-relative]
Creates a new VMDK image which gives access to an entite host disk (if
the parameter -partitions is not specified) or some partitions of a
host disk. If access to individual partitions is granted, then the
parameter -mbr can be used to specify an alternative MBR to be used
(the partitioning information in the MBR file is ignored).
The diskname is on Linux e.g. /dev/sda, and on Windows e.g.
\\.\PhysicalDrive0).
On Linux host the parameter -relative causes a VMDK file to be created
which refers to individual partitions instead to the entire disk.
The necessary partition numbers can be queried with
VBoxManage internalcommands listpartitions
VBoxManage internalcommands listpartitions -rawdisk \\.\PhysicalDrive1
* 미디어 관리자에서 아래 옵션을 변경 ( Writethrough )
해당 파티션이 RAW 포맷인지 확인
특정 파티션 사용하기 ( in linux )
VBoxManage internalcommands createrawvmdk -filename /home/chozo99/VirtualBox\ VMs/mypartition5.vmdk -rawdisk /dev/sda8