Serving static files/images with Sinatra

require 'sinatra'get '/' do #File.read(File.join('./public', 'index.html')) File.expand_path('index.html', settings.public_folder) end

Ruby web server Why not WEBrick

http://dev.classmethod.jp/server-side/ruby-on-rails/sinatra__make_api_server/Why not WEBrick By default WEBrick is single threaded, single process. This means that if two requests come in at the same time, the second must wait for the firs…

Sinatraで簡易APIサーバー

http://dev.classmethod.jp/server-side/ruby-on-rails/sinatra__make_api_server/

byobu cheat sheet

http://qiita.com/nmrmsys/items/03f97f5eabec18a3a18bTo start a new Byobu session with a specified name: byobu new -s To change the name of a pre-existing session: byobu rename -t include the session-name in status bar for byobu-tmux $tmux s…

Ubuntu 14.04 rvm "rack requires Ruby version >= 2.2.2"

update rvm rvm get latest

"RVM is not a function" on server byobu.....

source ~/.rvm/scripts/rvm

selenium-webdriver 3.4.0, firefox-53.0.2, geckodriver-v0.16.1-linux64.tar.gz

https://github.com/mozilla/geckodriver/releases geckodriver-v0.16.1-linux64.tar.gz$ unzip geckodriver_geckodriver-v0.16.1-linux64.tar.gz $ sudo mv geckodriver /usr/bin/ $ cd /usr/bin $ sudo chmod +x geckodriverRuby Selenium::WebDriver::Fir…

DSLメモ

"plog" command to see the status or "ifconfig ppp0" for general interface infoConfiguration file `/etc/ppp/peers/dsl-provider'sudo apt-get install pppoe sudo ppoeconf/etc/ppp/options /etc/ppp/peers/dsl-provider sudo nano chap-secrets sudo …

tidy HTML indent 字下げ ubuntu

Use a config file with just the indent, tidy-mark, and quiet options:indent: auto indent-spaces: 2 quiet: yes tidy-mark: no Name it tidy_config.txt and save it the same directory as the .html file. Run it like this:tidy -config tidy_config…

SSTP

https://support.purevpn.com/sstp-configuration-guide-for-ubuntu https://sourceforge.net/projects/sstp-client/files/network-manager-sstp/0.9.4-1/https://sourceforge.net/projects/sstp-client/files/sstp-client/1.0.10/

OSX Sierra VPN

https://www.flowvpn.com/download-mac/ http://apple.stackexchange.com/questions/252228/pptp-vpn-client-for-macos-sierra-or-ios-10http://www.mobile4children.com/?p=1270

刀锋 超薄 笔记本

刀锋 超薄 笔记本 Apple Air like Note book Housing

To Install Joomala, Nginx, MariaDB (or MySQL), PHP in Ubuntu 16.04

前提 To Install Joomla, Nginx, MySQL, PHP in Ubuntu 16.04 https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx-mysql-php-lemp-stack-in-ubuntu-16-04 How To Install Joomla on Ubuntu 16.04 with MariaDB http://idroot.net…

libreoffice calc 改行 char 正規表現

https://help.libreoffice.org/Common/List_of_Regular_Expressions/jahttp://www.excel.studio-kazu.jp/func/char.html

Ubuntu remote server VNC/RDP can not shut down

try getting a command prompt on the server then running sudo shutdown -r now to rebootthensudo shutdown -h nowto shutdown the server?

chromedriver chrome-browser version

chromiumVersion 50.0.2661.102 Ubuntu 14.04 (64-bit) Version 51.0.2704.79 Ubuntu 14.04 (64-bit)chromedriver ChromeDriver 2.22 /usr/lib/chromium-browser/chromedriver

DHCP で取得した DNS サーバーの IP アドレスを確認

https://fishrimper.blogspot.hk/2014/07/dhcp-dns-ip.html Ubuntu Desktop のデフォルト設定だと DHCP で割り当てられた DNS サーバーの IP アドレスを簡単に確認できなかったので調べてみました。環境 Ubuntu 14.04 Desktop 日本語 Remix一般的に DNS の I…

Ruby の自己代入 x ||= 1 未定義

$ irb 2.2-head :001 > x=nil => nil 2.2-head :002 > x ||=3 => 3 2.2-head :003 > x=1 => 1 2.2-head :004 > x ||=3 => 1 2.2-head :005 > x => 1

LibreOffice Calc 表計算ドキュメントのセルに行ブレークを挿入

Ctrl+Enterキーはセル内のテキスト編集カーソルでのみ使用でき、入力行では使用できません。行ブレークを挿入するテキスト位置に正規表現として \n を入力することで、改行文字を検索と置換ダイアログで検索することができます。改行文字を数式テキストに入…

Nginx conf 設定 with mysql php lemp ubuntu-16-04

http://www.gamvaro.com/kswiki/index.php?%E3%82%B5%E3%83%BC%E3%83%90%E3%83%BC%E9%96%A2%E4%BF%82%2Fnginx http://blog.uklab.jp/web/modified-nginx-conf/sudo vi /etc/default/ufw IPV6=yessudo ufw disable sudo ufw enable with mySQL, https://www.d…

rbenv command コマンド

http://www.task-notes.com/entry/20141204/1417662000

Rails App with Puma and Nginx on Ubuntu 14.04

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-nginx-on-ubuntu-14-04

Install Ruby on Rails with rbenv on Ubuntu 14.04, サーバーへsshするときと、ローカルでterminalを使うときで、terminalの設定が違う

https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-14-04

bundle install --path gems , bundle exec rake ... rake ... 違い

bundle install --path gemshttp://ka-zoo.net/2013/07/difference-of-rake-xxx-and-bundle-exec-rake-xxx/ http://qiita.com/windhorn/items/0f58866291f8273f18fb http://qiita.com/shunsuke227ono/items/dbc7c3428bc0ac01e9ac

ruby rbenv gem bundle rails

http://komaken.me/blog/2013/07/05/%E9%A0%AD%E3%81%8C%E5%BC%B1%E3%81%99%E3%81%8E%E3%81%A6ruby-rbenv-gem-bundle-rails%E3%81%AE%E4%BB%95%E7%B5%84%E3%81%BF%E3%81%8C%E7%90%86%E8%A7%A3%E3%81%A7%E3%81%8D%E3%81%AA%E3%81%84%E3%83%BB/http://kdbm.jp/…

Install MySQL Ruby On Rails on Ubuntu 14.04

https://www.digitalocean.com/community/tutorials/how-to-install-mysql-on-ubuntu-14-04https://gorails.com/setup/ubuntu/14.04

rails "Access denied for user 'root'@'localhost'"

http://qiita.com/caramelbit/items/e9b08c6b11f762b949de http://railsdoc.com/references/rake%20db:migrate http://qiita.com/tetsuya/items/f21170a9667d7e465da8database.ymlの内容でデータベースを作成 rake db:create

ubuntu 14.04 gem mysql

rails new helloworld_db -d mysql"An error occurred while installing mysql2 (0.4.4), and Bundler cannot continue. Make sure that `gem install mysql2 -v '0.4.4'` succeeds before bundling."gem install mysqlgem search -rsudo apt-get install li…

Nginx Puma Rails Ubuntu 14.04

Nginx + Pumaで、Railsアプリケーション http://ticklecode.com/step16-nginx-rails-server/How To Deploy a Rails App with Puma and Nginx on Ubuntu 14.04 https://www.digitalocean.com/community/tutorials/how-to-deploy-a-rails-app-with-puma-and-ng…

rails server error, There was an error while trying to load the gem 'uglifier'.

http://qiita.com/pugiemonn/items/11a2bc8403e5947a8f13http://pcl.solima.net/archives/428