Entries from 2012-05-01 to 1 month

Building Backbone.js Apps With Sinatra, MongoDB and Haml

http://addyosmani.com/blog/building-backbone-js-apps-with-ruby-sinatra-mongodb-and-haml/

Using Yan:captcha in Ruby Web Application

http://sunng.info/blog/2009/12/use-yan-in-ruby-web-application/

An Introduction to Haml

http://rubysource.com/an-introduction-to-haml/

Sinatra 画像

Sinatraで画像ファイルやcssファイル等、静的ファイルはpublicフォルダに入れてる。そのファイルを指定するときは、public/hoge.png、ではなく /hoge.png で指定できる。上策:Rackに任せる http://blog.s21g.com/articles/1565 Sinatra で画像をダイナミッ…

sinatra + html5_canvas + jquery 画像ドラッグドロップでファイル保存//File upload with Sinatra

http://d.hatena.ne.jp/noodles_mtb/20110903/1315036154 http://www.wooptoot.com/file-upload-with-sinatra

Sequel::Model Example チュートリアル

http://route477.net/ramaze/?Sequel http://route477.net/ramaze/?Tutorialhttp://d.hatena.ne.jp/uzuki05/20081101/1225535468 http://d.hatena.ne.jp/shibason/20100304/1267697379http://pastebin.com/uriGCi3D class Questionnary set_schema do #syste…

sqlite3 forigen key について

現時点で私個人はRuby Sequelを通してforigen_keyをONにする方法を知りません。http://d.hatena.ne.jp/yatt/20110103/1294064413 http://d.hatena.ne.jp/naga_sawa/20101219/1292774083 http://www.k-brand.gr.jp/log/002036http://sqlite.org/foreignkeys.h…

Sinatra Tips チュートリアル

http://labs.unoh.net/2009/05/sinatra.htmlhttp://www.machu.jp/diary/20111002.html#p01http://net.tutsplus.com/tutorials/ruby/singing-with-sinatra/ http://net.tutsplus.com/tutorials/ruby/singing-with-sinatra-the-recall-app-2/ http://net.tutsp…

git チュートリアル

http://www8.atwiki.jp/git_jp/pub/git-manual-jp/Documentation/gittutorial.html

Ruby 文字列シンボル

文字列をシンボル "str".to_sym か "str".internシンボルを文字列 :symbol.to_s

sqlite3 日付 ユリウス日

http://www.dbonline.jp/sqlite/特にデータ型についてはhttp://www.dbonline.jp/sqlite/type/index1.html日付・julian day,ユリウス日、ソート http://d.hatena.ne.jp/Kishi/20080108/1199785354

mechanizeに必要なライブラリ

sudo apt-get install libxslt-dev libxml2-dev

githubから直接GIT

例えば http://gihyo.jp/dev/serial/01/ruby/0009 のサンプルアプリをコピーするには上部の[Git Read-Only]フィールドからgit://github.com/yhara/sinatbbs.gitをコピーしてgit clone git://github.com/yhara/sinatbbs.gitsinatbbsフォルダーとコードをクロ…

SSHアタックを回避

http://www.ubuntugeek.com/howto-pptp-vpn-server-with-ubuntu-10-04-lucid-lynx.htmlWe need to set up ip-masquerading: ‘sudo nano /etc/rc.local‘Add the following lines above the line that says ‘exit 0‘ # PPTP IP forwarding iptables -t nat -A …

nautilusユーティリティインストール

http://iloveubuntu.net/handy-nautilus-actions-suite-enriched-new-scripts-and-separate-packages sudo add-apt-repository ppa:nae-team/ppa sudo apt-get updateThen, install the desired packages Nautilus Advanced Menu sudo apt-get install nauti…

nautilus-open-terminal

Google で 「ubuntu apt-get install nautilus-open-terminal」検索 このコマンド危険->ibus,Anthyをremoveしてしまう sudo aptitude install nautilus-open-terminal

Geditのリサイズが面倒

Workaround: Edit /usr/share/themes/Ambiance/metacity-1/metacity-theme-1.xml. Set the following values in frame_geometry_normal as desired: Radianceを使っているひとは/usr/share/themes/Radiance/metacity-1/metacity-theme-1.xmlでもこれはあまり…

ubuntu 12.04 server gnome enable file share

Nautilus extension to share folder using Sambaソフトウェアセンターからインストール

samba

http://www.sitepoint.com/ubuntu-12-04-lts-precise-pangolin-file-sharing-with-samba/

Ubuntu ハードディスクの追加

追加しようと思ってDisk Utilityを使ったら、パーミッションではねられた。ヤマ勘で$ gksu gnome-disk-utilityをやってもだめ。結局:$ sudo palimpsestで成功! どこかにSoftware Centerとsynaptic/apt-getの対応表ないのかな???

つかれた

http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

ubuntu 12.04 synapticでruby-rvmが入らない!

参考:http://smokycat.info/etc/321#comment-1291結論は/var/lib/dpkg/info/ruby-rvm.postinst中の root:admin -> root:rootに直す。

RVM Installe インストール注意

$ gem install rvm $ sudo gem install rvmこのインストールの最後に rvm-install をインストールせよとのメッセージが出るが、同時にbash設定ファイル~/.bashrc ~/.bash_profileの編集も求められる。これを先にやって置くと: then copy and paste the foll…

Win7 ターミナル

[ファイル名を指定して実行]ダイアログボックスを開く Windows ctrl + R

How to Change the Port on NX Server

/usr/NX/etc/server.cfg Set the following settings in the file: SSHDPort = "22" SSHDAuthPort = "22" Change “22″ to whatever port your SSH service is now listening on. You’ll then need to restart the NX Server service to put the changes into…

nesta 動かない!!!

Nestaのホームページ(http://nestacms.com/)通りにnestaをインストール後、「Publishing Articles with Git」:Gitによるコンテンツ編集チュートリアル?? http://nestacms.com/docs/creating-content/publishing-articles-with-gitを実行しても上手くゆかな…

byobu

http://blog.udzura.jp/2011/08/12/introduction-to-byobu/要するに使うのは(デフォルトのエスケープキーはCtrl-a)新しいウィンドウ [エスケープキー] c開いているウィンドウの確認 [エスケープキー] wウィンドウの移動 その数字のウィンドウに移動[エスケ…

ubuntu 12.04 既存ユーザーをsudoerにする

sudo adduser user_name sudo

nestaに他のネットワーク上のマシンからアクセスできない

http://nestacms.com/ に沿って Getting started $ gem install nesta $ gem install bundler $ nesta new mysite.com $ cd mysite.com $ bundle $ nesta demo:content $ shotgun config.ru Then visit http://localhost:9393... とすると、上手く自分のマシ…

ubuntu 12.04 rhythmbox でmp3ファイルを再生しようとすると"install additional software"

GStreamer extra pluginsをソフトウェアセンターからインストール