某メモ
- Python 2.7
- cd scons-local; tar -xzf scons-local-0.96.90.tar.gz
- rename "import as" as another name, for example aas, and mv as.py to the same name of the import
- uncomment the definition of strlcpy() because of conflict with that of /usr/include/string.h
- /usr/ports/devel/sdl12
- /usr/ports/devel/bison
- /usr/ports/graphics/netpbm
- - scons-local-0.96.90/scons.py prefix=/home/isseki/work
- scons-local-0.96.90/scons.py install
FreeBSD 9.2 on VirtualBox
X Windows System を使えるようにするまでのメモ
VirtualBox
バージョン 4.2.18
FreeBSDのインストール手順
省略
X Window (Xorg) の設定
sysinstall の Configure -> Packages から xorg-7.7 をインストールする。
# sysinstall
http://www.freebsd.org/doc/ja/books/handbook/x-install.html にあるように pkg_add を使ってもいいかもしれない。
# pkg_add -r xorg
インストール後に startx で X が起動することを確認する。何も設定していないのでキーボードやマウスが効かないかもしれない。その場合は Alt+F1 でコンソールに戻れるので、C-c で強制終了させる。
# sysinstall # startx
X でキーボードとマウスを有効にするためには、HAL/Dbusを使えるようにする。/etc/rc.confに以下の設定を追加する。
hald_enable="YES" dbus_enable="YES"
デスクトップ環境のインストール
軽量らしい XFCE をインストールしてみる。
# pkg_add -r xfce4 $ echo "/usr/local/bin/startxfce4" > ~/.xinitrc $ startx
Guest Addition
X の解像度調整、マウス統合を可能にするため Guest Addition をインストールする。
# pkg_add -r virtualbox-ose-additions
/etc/rc.confに以下の行を追加する。
vboxguest_enable="YES" vboxservice_enable="YES"
Xorg で設定ファイルを生成した後、InputDevice を以下のように設定する。
# Xorg -configure # vi xorg.conf.new
Section "InputDevice" Identifier "Mouse0" Driver "vboxmouse" EndSection
リモートブランチからのcloneとブランチ切り替え
git cloneでリモートブランチからcloneした状態ではブランチnewの状態は見えないが、checkout -bでリモートリポジトリのブランチorigin/newに基づいて新たなブランチnewを作成すれば見えるようになる。
$ git clone http://somewhere/hoge.git $ cd hoge $ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/new remotes/origin/master $ git checkout -b new origin/new $ git branch * new master $ ls file.txt # file.txtが見えるようになる
ローカルブランチの作成とリモートブランチへのpush
ブランチnewを作成し、file1.txtをaddしてcommitする。リモートリポジトリにブランチnewをpushする。
$ git branch new $ git checkout new $ touch file.txt $ git add file.txt $ git commit -m "add file.txt" $ git push origin new
リポジトリの複製と移行
既存のリポジトリを複製して、別のリモートリポジトリに移行する場合のメモ。既存のリポジトリからbareリポジトリを作成する。サーバに転送するためにtarでもしておく。
$ git clone --mirror http://foo/bar.git hoge.git $ tar zcvf hoge.git.tar.gz hoge.git $ scp hoge.git remote-server:
リポジトリをホスティングするサーバ側では以下の作業を行い、クライアントからアクセスできるようにする。gitのプロトコルにはHTTPを用い、webサーバのユーザ/グループはwww-dataであるとする。
$ tar zxvf hoge.git.tar.gz $ mv hoge.git wwwに公開するディレクトリ $ cd !$ $ chown -R www-data:www-data hoge.git $ touch hoge.git/git-daemon-export-ok $ cd hoge.git $ git update-server-info
クライアントからcloneできることを確認する。
$ git clone http://remote-server/hoge.git