ラベル Ubuntu の投稿を表示しています。 すべての投稿を表示
ラベル Ubuntu の投稿を表示しています。 すべての投稿を表示

2012年12月8日土曜日

Ubuntu に PhantomJS を入れる

Ubuntu Lucid (10.04) でビルドしたバイナリが http://phantomjs.org/download.html からダウンロードできます。

Lucid 以降のディストリビューションであれば動くそうです。
このバイナリのインストールにあたっては、Qt, WebKit など他のライブラリのインストールは必要ありません。

Lucid より古いシステムでは、ソースからビルドする必要があります。
$ cd /usr/local/share
$ sudo cp ~/Download/phantomjs-1.7.0-linux-x86_64.tar.bz2 .
$ sudo tar -xjvf phantomjs-1.7.0-linux-x86_64.tar.bz2 
$ sudo rm phantomjs-1.7.0-linux-x86_64.tar.bz2
$ sudo ln -s /usr/local/share/phantomjs-1.7.0-linux-x86_64/ /usr/local/share/phantomjs
$ sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs

$ which phantomjs
/usr/local/bin/phantomjs

$ phantomjs -v
1.7.0

$ phantomjs 
phantomjs> 


PhantomJS Quick Start



2012年11月22日木曜日

Ubuntu に Sublime Text 2 をインストールした

Sublime Text 2 の Ubuntu 用 PPA みつけた

WEB UPD8 - SUBLIME TEXT 2 UBUNTU PPA
> sudo add-apt-repository ppa:webupd8team/sublime-text-2
> sudo apt-get update

> sudo apt-get install sublime-text


> sublime-text -h
Sublime Text 2 Build 2217

Usage: sublime_text [arguments] [files]         edit the given files
   or: sublime_text [arguments] [directories]   open the given directories

Arguments:
  --project : Load the given project
  --command : Run the given command
  -n or --new-window:  Open a new window
  -a or --add:         Add folders to the current window
  -w or --wait:        Wait for the files to be closed before returning
  -b or --background:  Don't activate the application
  -h or --help:        Show help (this message) and exit
  -v or --version:     Show version and exit

Filenames may be given a :line or :line:column suffix to open at a specific
location.

> sublime-text -v
Sublime Text 2 Build 2217
-v でビルド番号はでるが、バージョンはでないのか。。。

2012年11月21日水曜日

Ubuntu に Typescript をインストールした

Synaptic Package Manager で
  • npm
  • nodejs
をインストール

> npm install -g typescript
すると
npm ERR! couldn't read package.json in .
npm ERR! Error installing .
npm ERR! Error: ENOENT, No such file or directory 'package.json'
npm ERR! Report this *entire* log at 
npm ERR! or email it to 
npm ERR! Just tweeting a tiny part of the error will not be helpful.
npm not ok

と言われる。

どうもインストールした npm のバージョンが古かったようだ

github : isaacs / npm - couldn't read package.json in .

1.x をインストールしないといけないらしい
Synaptic から入れた node.js も古かった

ということで node.js と npm を一旦アンインストールし、コメントの最後のほうで isaacs さんが紹介している https://launchpad.net/~chris-lea/+archive/node.js/ からインストール

そのためにまず ppa:chris-lea/node.js を PPA(Personal Package Archive) に追加

> sudo add-apt-repository ppa:chris-lea/node.js

You are about to add the following PPA to your system:
 node.js
 Evented I/O for V8 javascript. Node's goal is to provide an easy way to build scalable network programs
 More info: https://launchpad.net/~chris-lea/+archive/node.js
Press [ENTER] to continue or ctrl-c to cancel adding it

gpg: keyring `/tmp/tmpIBxqM3/secring.gpg' created
gpg: keyring `/tmp/tmpIBxqM3/pubring.gpg' created
gpg: requesting key C7917B12 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpIBxqM3/trustdb.gpg: trustdb created
gpg: key C7917B12: public key "Launchpad chrislea" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
OK

> sudo apt-get update
次に node.js と npm をインストール

> sudo apt-get install nodejs
> sudo apt-get install npm

> npm -v
1.1.65
よしよし

ようやく

>  npm install -g typescript
npm http GET https://registry.npmjs.org/typescript
npm http 200 https://registry.npmjs.org/typescript
npm http GET https://registry.npmjs.org/typescript/-/typescript-0.8.1.tgz
npm http 200 https://registry.npmjs.org/typescript/-/typescript-0.8.1.tgz
npm ERR! Error: EACCES, mkdir '/usr/lib/node_modules'
...
キターとおもったらエラー orz

> sudo npm install -g typescript
npm http GET https://registry.npmjs.org/typescript
npm http 304 https://registry.npmjs.org/typescript
/usr/bin/tsc -> /usr/lib/node_modules/typescript/bin/tsc
typescript@0.8.1 /usr/lib/node_modules/typescript
はいったぽい?

Tutorial のコードを書いて

> cat greeter.ts 
function greeter(person) {
    return "Hello, " + person;
}

var user = "Jane User";

document.body.innerHTML = greeter(user);

> tsc greeter.ts 
怒られなかったー

> ls
greeter.js  greeter.ts
js ファイルできてるー



2010年8月11日水曜日

Ubuntu の起動時間を速くしてみた

"Ubuntuのパワーユーザー向けティップス5選 - IT業界を生き抜く秘密10箇条 - ZDNet Japan" ( http://bit.ly/aE8h8v )

に載っている #1:起動時間を短縮する を試してみた。

プロファイルを取得することで、Ubuntuの起動プロセスを最適化できることを利用して起動時間を短縮する方法。

このツールはUbuntu 6.04 から利用可能になっていて、10.04 における高速化でちょっぱやになっているらしい。

■ 手順

1. /etc/default/grub ファイルの以下の行を編集する

 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

 を

 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash profile"

 に変更

2. > sudo update-grub2

3. マシンを再起動

 この起動では、プロファイル作業が行われるので
 今までの起動よりも少し時間がかかるはず。

4. 先ほど追加した「profile」オプションを grubファイルから削除
 (=元に戻す)

5. > sudo update-grub2

おしまい。

これで次回以降はずっと高速に起動するはず。


ということで比較。

> sudo update-grub2
sudo: update-grub2: command not found

おおっと、grub2 が入ってなかったw
Synaptic から grub2 をインストールして、、、、

> sudo update-grub2
Generating grub.cfg ...
Found linux image: /boot/vmlinuz-2.6.31-22-generic
Found initrd image: /boot/initrd.img-2.6.31-22-generic
Found linux image: /boot/vmlinuz-2.6.31-21-generic
Found initrd image: /boot/initrd.img-2.6.31-21-generic
Found linux image: /boot/vmlinuz-2.6.31-20-generic
Found initrd image: /boot/initrd.img-2.6.31-20-generic
Found linux image: /boot/vmlinuz-2.6.31-19-generic
Found initrd image: /boot/initrd.img-2.6.31-19-generic
Found linux image: /boot/vmlinuz-2.6.31-17-generic
Found initrd image: /boot/initrd.img-2.6.31-17-generic
Found linux image: /boot/vmlinuz-2.6.28-17-generic
Found initrd image: /boot/initrd.img-2.6.28-17-generic
Found memtest86+ image: /boot/memtest86+.bin
done

再起動、もどして、もっかい grub2、再起動。。。


うーん。あんまり変わらない orz

どっちもログイン画面まで 45秒くらい、若干速くなった?5秒くらい速くなった?

よくわかりませんでした。残念。