2018年12月9日日曜日

illumos SMFに関すること

https://wiki.smartos.org/display/DOC/Basic+SMF+Commands

Service Management Facility
Linuxのsystemdみたいなもの

下記の四つのコマンドがある
svcadm svccfg svcs svcprop

svcadm - manipulate service instances
svccfg - import, export, and modify service configurations
svcs - report service status
svcprop - retrieve values of service configuration properties

manifest サービスの起動方法等をxmlのマニュフェストに記述する。
置き場所
/var/svc/manifest/
/lib/svc/manifest/
登録されているマニュフェストの内容を見る
sudo svccfg export ssh

php-fpm-70の登録
sudo svccfg import /lib/svc/manifest/network/php-fpm-70.xml
sudo svcadm enable php-fpm-70






2018年9月26日水曜日

ubunto core とsnap memo

ubuntu core をKVM上で動かす
手順はここにかかれている。
https://developer.ubuntu.com/core/get-started/kvm

まず Ubuntu SSO(Single Sign On)の登録
  1. Start by creating an Ubuntu SSO account
  2. Import an SSH Key into your Ubuntu SSO account on this page. Instructions to generate an SSH Key on your computer can be found here
を行う


mkdir ~/.ssh
chmod 700 ~/.ssh
ssh-keygen -t rsa

$ cat id_rsa.pub
ssh-rsa ......

ssh-rsaから始まる文字列をコピーして
Ubuntu SSOに登録する。

KVMのインストール等は、ホームページにかかれているとおり。
ubuntu core16でまだ18でない
$ uname -r
4.4.0-135-generic

snapは、インストールされている。

$ sudo snap login
Email address: your@email.com <== Ubuntu SSOに登録したアドレス
Password of "your@email.com":
Login successful

ログインするとsnapのコマンドにsudoをつけなくても動くようになる。





2018年9月17日月曜日

openindian community


https://www.openindiana.org/community/code-of-conduct/
から

Code of Conduct
行動規範

行動規範については、現在議論中である。より良い提案があればぜひお願する。

OpenIndianaの行動規範

このドキュメントは、OpenIndianaコミュニティに貢献しようとする全ての人々に、安全で互いを尊重する、生産的で協力的な場所を提供するためのためのガイドラインを提供する。

Core principles and expectations:
基本原理と期待されること
●We are respectful and appreciative towards peoples work, time, and effort.
私たちは、人々の仕事・時間・努力に対してリスペクトし理解する。
●We are tolerant of the right to have opposing views.
私たちは、反対意見を持つ権利について寛容である。
私たちは、反対意見を持つ権利を認める。
●We recognize our public actions determine the public perception of the project.
私たちは、私たちの公での行動がプロジェクトの評価を決めることを自覚する。

●Participants must ensure their language and actions are free from personal attacks and disparaging personal remarks
参加者は、発言や行動が、個人攻撃、誹謗中傷でないことを確実にしないといけない。

●When interpreting the words and actions of others, participants should always assume good intentions.
他人の言葉、行動を、常に好意的に解釈しなくてはいけない。

What will not be tolerated:
認められないこと

●Open hostility, and or abusive language.
敵意と不適切な言動

●Repeated complaining (rehashing) of closed (decided) issues.
終了(決定)したことへの不満の繰り返し(蒸し返し)

Participants who disrupt the collaborative space, or participate in a pattern of behavior which could be considered harassment.
共同スペースを混乱させる参加者、または、ハラスメントとみなされる行為に参加すること

Filibustering – (replying with negative or opposing viewpoints to every post in a mailing list thread).
議事妨害行為 メーリングリストで否定的または反対の立場でリプライすること


Reporting violations:

違反の通報

    • Neither reporters nor reported persons will, or should be, made public.
Violations of the CoC should only be reported to the distribution maintainers via direct messages on IRC, twitter, or via E-mail and will be handled confidentially.
行動規範(code of conduct) の違反は、ディストリビューション管理者に、IRCかtwiiterのダイレクトメッセージまたはE-mailで内内に通知されるべきである。

  Neither reporters nor reported persons will, or should be, made public.
  通報者・通報されたものともに公にされることはない。

Sources

原本


興味深いので訳してみたが
chromの翻訳でかなりカバーできることが判明した。



















2018年3月25日日曜日

ubuntu snapについて

snapというものは、ubuntuの開発に使うようなのだがよくわからないので調べてみた。

snapは、Canonical Ltd.の提供するディストリビューションシステムのようである。
UbuntuとCanonicalは、Canonical Ltdの登録商標である。
Canonicalは、日本語では標準的なとか正規とか規範的なとか言う意味


snapは、メジャーなLinux(Ubuntu,Debean,Mint,openSuse,Fedraなどなと)に修正なしにインストールできるパッケージ,配信システム,アップデートのようである。

snapを作るために、snapcraftを使う。

https://snapcraft.io/

snapcraftを使うためには、Ubuntu Oneのアカウントが必要になる。
Ubuntu One は、一つのアカウントで Ubuntu に関連したすべてのサービスやサイトにログインできるサービスである。(Ubuntu SSO--Single Sign Onからの発展版)
https://login.ubuntu.com/

使い方は、ubuntuのtutorialに書かれている。

https://developer.ubuntu.com/snapcraft

2017年8月26日土曜日

Illumos build方法

2019/09/21 修正

illumosのカーネルビルド方法は
https://illumos.org/docs/developers/build/
に書かれている

開発環境は、
OpenindianaまたはOmniOS
がよい


以下 Openindianaの場合
Openindianaのインストールは、
https://www.openindiana.org/download/
USB版をダウンロードしliveUSBを作成する。
virtualBoxではDVD版をダウンロードする
Liveは、GUI
Text Installは、server用

インストール方法は、
http://docs.openindiana.org/handbook/getting-started/#installing-openindiana
に書かれている。
liveUSBの作り方
Linux/OS Xの場合は、
# dd bs=4M if=./image.usb of=/dev/sdX status=progress && sync
sdXは適切な値に変更する。


システムが起動したら

まずはシステムを最新にする。
sudo pkg update

開発環境のインストール
sudo pkg install build-essential \
    runtime/python-35 \
    developer/gcc-7
このコマンドでgit gccなどがインストールされる

ソースコードを取得する。
ディレクトリcodeを作成する。(code以外の名前でもよい)
(codeの場所はどこでも良い。通常のユーザー特権で作成する。)
$cd code
$git clone https://github.com/illumos/illumos-gate.git

クローズドバイナリーの取得は、openindiana,omniOSでは不要
illumosは、まだ一部クローズドバイナリーがあるが、あたらいopenindiana,omniOSでは
/opt/onbld/closedにインストールされている。


illumos.shをコピーし修正する。
$cd ~/code/illumos-gate
$cp usr/src/tools/env/illumos.sh .
$vi illumos.sh       # or your favourite editor instead of @vi@


最終行に下記を追加する。
#
# Set a package version number which is greater than the current OpenIndiana
# build number.  Note that ONNV_BUILDNUM is ignored if PKGVERS_BRANCH is set:
#
export PKGVERS_BRANCH=9999.99.0.0

#
# Set to current version of Perl shipped with OpenIndiana:
#
export PERL_VERSION="5.22"
export PERL_PKGVERS="-522"

#
# If you are building on the latest OpenIndiana (2017-03-07 and later), use
# OpenJDK 8:
#
export BLD_JAVA_8=

#
# IPS packages published at 2019-08-08 and later ship only Python 3.5 modules,
# so you have to use this Python version to build illumos tools
# if your pkg:/package/pkg version is 0.5.11-2019.0.0.5521 or later.
#
export BUILDPY2TOOLS="#"
 
#
# Use the copy of the closed binaries that comes with the "build-essential"
# package:
#
export ON_CLOSED_BINS="/opt/onbld/closed"




ビルドの実行
$cd ~/code/illumos-gate
$time ksh93 usr/src/tools/scripts/nightly.sh illumos.sh

ログの参照
$tail -f ~/code/illumos-gate/log/nightly.log

追加ビルドは、-i オプションを付ける
$cd /code/illumos-gate
$time ksh93 usr/src/tools/scripts/nightly.sh -i illumos.sh


インストール方法
beadmを使用して、BEを作成しインストールする。



2017年8月21日月曜日

cakephp

cakephp インストール

phpのバージョンチェック
php -v

インストールする場所に移動して
php composer.phar create-project --prefer-dist cakephp/app my_app_name
または
composer self-update && composer create-project --prefer-dist cakephp/app my_app_name

インストールできたかテスト
bin/cakephp server

http://localhost:8765


2017年7月9日日曜日

CentOS-7 kernel build方法

CentOSは、Redhatのクローンらしくて、個人でbuildするのは、筋違いのようである。
開発したいのならfedoraでやろうということのようである。
https://wiki.centos.org/HowTos/Custom_Kernelにかかれていることをメモしとく。

開発環境の構築
$su
#yum groupinstall "Development Tools"
#yum install ncurses-devel
#yum install qt-devel (This is only necessary if you wish to use make xconfig instead of make gconfig or make menuconfig.)
#yum install hmaccalc zlib-devel binutils-devel elfutils-libelf-devel
#yum install kernel-devel
#yum install rpm-build redhat-rpm-config asciidoc hmaccalc perl-ExtUtils-Embed pesign xmlto 
#yum install audit-libs-devel binutils-devel elfutils-devel elfutils-libelf-devel
#yum install ncurses-devel newt-devel numactl-devel pciutils-devel python-devel zlib-devel
#exit


ソースコードの取得

$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
$ echo '%_topdir %(echo $HOME)/rpmbuild' > ~/.rpmmacros
(この二行は実行しなくてもできた)

下記の場所からパッケージを探す
http://vault.centos.org/7.N.YYMM/os/Source/SPackages/
http://vault.centos.org/7.N.YYMM/updates/Source/SPackages/


$ rpm -i http://vault.centos.org/7.3.1611/updates/Source/SPackages/kernel-3.10.0-514.26.2.el7.src.rpm  2>&1 | grep -v exist

$ cd ~/rpmbuild/SPECS
$ rpmbuild -bp --target=$(uname -m) kernel.spec

以上でソースコードが ~/rpmbuild/BUILD に作られる

モジュール関係でエラーが発生する場合は、yumで追加、updateする。


kernel specification fileの修正

$ cd ~/rpmbuild/SPECS/
$ cp kernel.spec kernel.spec.distro
$ vi kernel.spec

%define buildid .your_identifier

注意 %とdefineの間にスペースを入れない
  buildidーを変更しないと現在動作中のカーネルを書き換えてしまう。


$rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log

~/rpmbuild/RPMS/`uname -m`/ にrpmファイルができる