月別アーカイブ: 2014年7月

cloud9 install

sudo apt-get install git
git clone git://github.com/creationix/nvm.git ~/nvm
echo '. ~/nvm/nvm.sh' >> ~/.bashrc && . ~/.bashrc
nvm install v0.8.25
nvm use v0.8.25
npm config set registry http://registry.npmjs.org/
git clone git://github.com/ajaxorg/cloud9.git
cd cloud9/
npm install

npm cache clear
npm config set registry http://registry.npmjs.org/
npm install

vagrant仮想環境のubuntuでcloud9を立ち上げる


sudo apt-get install -y build-essential g++ curl libssl-dev apache2-utils git libxml2-dev

# Remove any previous version of node
sudo apt-get remove nodejs

git clone git://github.com/creationix/nvm.git ~/nvm
echo '. ~/nvm/nvm.sh' >> ~/.bashrc && . ~/.bashrc
nvm install v0.6.19
nvm use v0.6.19

curl http://npmjs.org/install.sh | sh
npm -v

npm config set registry http://registry.npmjs.org/

sudo npm install -g sm

cd ~/
git clone https://github.com/ajaxorg/cloud9.git cloud9
cd cloud9
sudo sm install

$ sudo apt-get install npm

$ git clone https://github.com/ajaxorg/cloud9.git cloud9
$ cd cloud9
$ npm install

http://www.samclarke.com/2012/07/how-to-install-cloud-9-ide-on-ubuntu-12-04-lts-precise-pangolin/

sudo apt-get install git-core
sudo: git: command not found




git clone git://github.com/creationix/nvm.git
sudo: npm: command not found



sudo: npm: command not found


cd nvm
source nvm.sh
nvm install 0.6.19
nvm use 0.6.19



node -v
v0.6.12


nodejs の実行環境がインストールされていることが前提

sudo apt-get install libssl0.9.8 npm nodejs mercurial libxml2-dev



sudo npm install -g sm
sudo apt-get install git-core libxml2-dev
git clone https://github.com/ajaxorg/cloud9.git cloud9
cd ./cloud9
sudo sm install
mkdir ~/workspace
cd ~/cloud9
bin/cloud9.sh -l 0.0.0.0 -p 3131 -w ~/workspace --username sample --password sample

参考
https://gist.github.com/ubinix-warun/5428811

vagrant仮想環境のubuntuでVNC

仮想環境のubuntuでVNCサーバーを構築する手順は

$ sudo apt-get install vnc4server
$ sudo apt-get install gnome
$ sudo apt-get install ubuntu-desktop
$ sudo apt-get install ibus-mozc
$ sudo apt-get install compizconfig-settings-manager

となります

VagrantでCentOS 6.2 32bit (puppet)仮想環境を作る

http://www.vagrantbox.es/
から対象を設定

$ vagrant box add centos62 https://dl.dropbox.com/sh/9rldlpj3cmdtntc/56JW-DSK35/centos-62-32bit-puppet.box
$ vagrant box add centos63 http://tom.davidson.me.uk/dev/vagrant/centos63-32.box

調べる

$ vagrant box list
centos62

作業エリアを作成

mkdir centos62
$ cd centos62

仮想環境を作成し、sshで接続

$ vagrant init centos62
$ vagrant up
$ vagrant ssh

$ su
# yum -y install vnc-server
# vnc-server -geometry 800×600

You will require a password to access your desktops.
パスワードを入力
Password:sentos
確認の為、上記と同じパスワードを入力
Verify:sentos
xauth: creating new authority file /root/.Xauthority

New ‘fedora.kajuhome.com:1 (root)’ desktop is fedora.kajuhome.com:1

http://www.ipentec.com/document/document.aspx?page=linux-centos-60-vncserver-tigervncserver-install

yum -y install tigervnc-server

# vncpasswd
Password:centos
Verify:centos

adduser penta
passwd penta

su penta
vncpasswd

/etc/rc.d/init.d/vncserver status
$ service vncserver restart

VagrantでVNCを接続する

$ sudo apt-get install vnc4server

で、vnc4serverをインスツール

コンフィグ書く。

$ sudo vi /etc/vnc.conf

vnc.confには解像度etc記入する。

$geometry = "1280x1024";
$depth = "24";

ここで一度立ち上げてconfigを作る。

パスワードも入力。

$ vnc4server

You will require a password to access your desktops.

Password:ubuntu
Verify:ubuntu

New ‘lucid32:1 (lucid32)’ desktop is lucid32:1

Creating default startup script /home/lucid32/.vnc/xstartup
Starting applications specified in /home/lucid32/.vnc/xstartup
Log file is /home/lucid32/.vnc/lucid32:1.log

一度止めて、生成されたファイルを書き換える

$ vncserver -kill :1
$ vi ~/.vnc/xstartup

x-window-managerをコメントアウト、exec gnome-sessionを追記。

これをやらないとUnityのツールバーとか出てこない。

#!/bin/sh

# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc

[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
x-terminal-emulator -geometry 80×24+10+10 -ls -title “$VNCDESKTOP Desktop” &
#x-window-manager &
exec gnome-session &

Vagrantfile

[htm]
config.vm.network :forwarded_port, guest: 5901, host: 15901
[/htm]
を追加する

ホストOSにVNCを追加する
ホストOSでVNCを起動
(Remmina)
localhost:15901
user:lucid32
password:ububtu
ゲストOSで
sudo apt-get install gnome-session

sudo shutdown -h now
で終了

viの使い方

$ vi ファイル名

ESCでコマンドモードに入る

ESC+iでインサートモード

ESC+ddで1行削除

ESC+:wq!で、ファイルを上書き終了

ESC+:q!で、保存せずに終了

ubuntuのVagrantでの依存性

ubuntuのVagrantでの依存性をまとめる

母艦
Ubuntu12.04lst(32Bit)
sudo dpkg -i vagrant_1.3.5_i686.deb
 vagrant box add ubuntu12 http://files.vagrantup.com/lucid32.box
  OK
 vagrant box add ubuntu1204 http://files.vagrantup.com/precise64.box
  NG
sudo dpkg -i vagrant_1.3.5_x86_64.deb
インストールできず
Ubuntu14.04lst(64Bit)
sudo dpkg -i vagrant_1.3.5_x86_64.deb
vagrant box add ubuntu12 http://files.vagrantup.com/lucid32.box
NG
vagrant box add ubuntu12042 http://files.vagrantup.com/precise64.box
  NG
The guest machine entered an invalid state while waiting for it
VirtalBox システム>アクセラレーションのチェックを外す
    → 途中まで行くがやはりNG

ubuntuのVagrantで仮想OSを作ってみる

ubuntuのVagrantで仮想OSを作ってみましょう

vagrantbox.esから仮想化対象のOSを選択
http://www.vagrantbox.es/

Ubuntu 12.04.1 LTS x86_64 (Guest Additions 4.1.18)
VirtualBox

を複写する

http://dl.dropbox.com/u/1537815/precise64.box

$ vagrant box add ubuntu12 http://files.vagrantup.com/lucid32.box
$ vagrant box add ubuntu12 http://dl.dropbox.com/u/1537815/precise64.box
$ vagrant box add ubuntu1204 http://files.vagrantup.com/precise64.box
$ vagrant box list
ubuntu1204 ( virtualbox )
$ mkdir ubuntu
$ cd ubuntu
$ vagrant init ubuntu1204
$ vagrant up
$ vagrant ssh
$ vagrant halt

ubuntu にVagrantをインストール

ubuntu にVagrantをインストールします

VagrantのDownloadページより対象のパッケージを見つける

http://downloads.vagrantup.com/
から対象のバージョンをみつける
v1.1.5にする

http://downloads.vagrantup.com/tags/v1.1.5

Ubuntuなので
vagrant_x86_64.deb
とすし
アドレスをコピーする
http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_x86_64.deb

$ wget http://files.vagrantup.com/packages/64e360814c3ad960d810456add977fd4c7d47ce6/vagrant_x86_64.deb
$ sudo dpkg -i vagrant_x86_64.deb
$ wget http://files.vagrantup.com/packages/a40522f5fabccb9ddabad03d836e120ff5d14093/vagrant_1.3.5_i686.deb

インストールしたか確認してみます

$ vagrant --version
Vagrant 1.3.5