2018年2月13日火曜日

Windows Subsystem for Linux and Ruby on Rails set up

Windows subsystem for Linux WSL enable us to run Linux binaries on Windows 10.
Microsoft provide Ubuntu, open SUSE leap42, and SUSE Linux Enterprise server on windows store.
The installation is very easy now.
The Linux subsystem would be really great new feature on Windows, since the web development requires many open source web app frame works, for example Ruby on Rails, django, play framework and more new web technology tend to be based on Linux/Unix environment. that is one of the reason that many professional developers use Mac for their work machine.

The below is my set up on Ruby on Rails with Windows subsystem Ubuntu.
Assume ubuntu is already ready and running.
You need to install git, python, libssl .....
install necessary using apt-get like

$sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev


Install rbenv
https://github.com/rbenv/rbenv
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ cd ~/.rbenv && src/configure && make -C src

add ~/.rbenv/bin  to bash Path

$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc

Run init

$~/.rbenv/bin/rbenv init

to update rbenv

$ cd ~/.rbenv
$ git pull


Install ruby-build
https://github.com/rbenv/ruby-build
$git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc


$rbenv install 2.5.0
$rbenv global
2.5.0




after checking if ruby has been installed successfully by ruby -v.
install bundler


 $gem install bundler

install node.js
https://github.com/nodesource/distributions

$curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
$sudo apt-get install -y nodejs


install rails

$gem install rails
$rails -v

Let's create myWebService 


$ rails new myWebService

it takes a little bit of minutes...
after everything was done, type below to start the service.


$ rails server

when it says


=> Booting Puma
=> Rails 5.1.5 application starting in development
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.11.2 (ruby 2.5.0-p0), codename: Love Song
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3000

go to the  http://localhost:3000.  ' You are on Rails' will be shown in the page and Rails works perfect. 

2018年2月12日月曜日

The new start of my blog from today.

The new start of my blog from today.
I have not written anything on this blog since 2012. it has been very long time and I didn't know the time passed so quick.
This blog was my secret keeping memo blog about Ubuntu/Linux. however I will write anything about current technology, especially on web/ mobile development.



2012年2月4日土曜日

Mathematica Fonts error

MathematicaをUbuuntu 10.11にインストール
起動すると以下のメッセージが出て終了する.
unable to find font with family \:f244\:f265\:f266.......

どうもLANG関係が怪しい
中国語のサイトに結構コメントがある.

解決方は
/usr/local/Wolfram/Mathematica/7.0/Executables/
以下の
Mathematica
mathematica
の二行目に
LANG=C
export LANG
を追加

2011年1月23日日曜日

flac to m4a

Walkmanは満足度は高かったと書いたがもしflacをサポートしてくれていたらより良かった.
現状はflacをサポートしているオーディオプレーヤーが少なく,そこら辺の電気屋では手に入りにくいのでもしWalkmanがflacやその他の形式をサポートとしてくれていれば、完璧だったと思うがしかたない.
そこでflacからmp3もしくは比較的音質が良いとされるm4aに変換する方法を忘れないようにメモしておく.
はじめに必要なツール
  • shnsplit
  • SoundConverter
shnsplitは cuiでcueファイルから何曲も一つにまとめてしまったflacファイルを分割することができる.lameを使ってmp3にすることが可能.
shnsplit filename.flac -f filename.cue -o flac -t %n

-t fmt Name output files in user‐specified format based on CUE sheet
fields. The following formatting strings are recognized:

%p Performer

%a Album

%t Track title

%n Track number

mp3に変換することも可能.その時は-oを
shnsplit filename.flac -f filename.cue -o 'cust ext=mp3 lame --quiet - %f'
(create mp3 files using lame)
SoundConverterはGUIで音楽ファイルの形式を変換してくれる.ただcueファイルから分割はしてくれない模様.してくれるかもしれないが使い方がわからない.私はflacをm4aに変換したかったが分割せずに十曲を一つにまとめたm4aができたので,shnsplitを使いflacを十曲に分けSoundconverterを利用して個々のm4aを作成した.

Ubuntu 携帯オーディオプレーヤー

いままでiPodを形態オーディオプレーヤーに使っていたが,SONY Walkmanに乗り換える.
理由は
1. Linuxで使いにくい.iPodがwindowsでフォーマットしてあるとLinuxでも幾分つかえるToolがあってiPodがまったく使えないわけではないが,Macでフォーマットもしくは箱から出してすぐの状態だと使えない.前はできたが最近またできなくなったのでiPodには触れない事にした.Walkmanは外部ディスクとして認識され,ファイルをそのままコピーすればよいので扱いが楽.
2. Walkmanに移動したファイルをまた取り出すことが可能.iPodに音楽ファイルを転送すると名前や形式を書き換えられて音楽ファイルをiPodから取り出すのが面倒.普通はiPodに転送した音楽ファイルは取り出せない事になっている.
3. iPodの音質があまり良くない.付属のイヤフォンも耳が痛くなる.音漏れがする.Walkmanの音質はiPodよりいいと感じる.また付属のインナーフォンも良い.イヤーフォンなら買い換えれば良いとの意見もあるかもしれないが,それだと全体のコストが高くなる.
4.Wlakmanに付属のデジタルノイズキャンセリングが良い.電車のなかでの騒音はもちろん飛行機の騒音もカットしてくれる.これはなかなか素晴らしい.初めはあまり期待していなかったが効果はかなりある.これもノイズキャンセリング機能がついたヘッドフォンなりを買えば良いという意見もあるもしれないが,もちろん無駄な出費がふえる.さらにノイズキャンセリング機能がついたヘッドフォンなどは専用に電池が必要なので面倒くさい.
その点Walkmanは本体にデジタルノイズキャンセリングが付属なのでそのような面倒がない.この機能は思った以上に満足度をあげてくれた.
5. Walkmanには録音機能がついている.このばあい専用のケーブルを購入しなければならないが2000円もしないので割高になると言うきはしない.それより個人的にLPレコードをもっているのでそれらを携帯プレーヤーにヘッドフォンジャックから転送できるのは素晴らしい.ただこの場合に変換されるフォーマットは.OMAというよくわからないフォーマットなのが利用者にとっては不便である.
6.ディスプレーが綺麗.

べつにApple ipodがきらいなわけではないが,今回はWalkmanの満足度がかなり高かった.

2010年10月31日日曜日

firefoxをupdateしたらインターネットの動画サイトのflash movieから音が出なくなった.
tottemなどのプログラムからはちゃんと音はでる.だからシステムの問題でなくfirefoxかflashplayer のpluginが原因だと考えいろいろ調べ試してみるが効果なし.
結局原因はサウンドミキサーの音量がゼロになっていただけだった.

2010年10月17日日曜日

パスワードクラック

.rar ファイルのパスワードを忘れてしまった.
そんな時はjohn

john - 有能なパスワードクラッキングツール

https://www.openwall.com/john/