Entries from 2015-01-01 to 1 year

nginx 同じサーバー名かつ同じポート,複数アプリ(フォルダ) same port, same server_name, multi location

nginx.conf #app1 upstream backend-unicorn1 { server unix:/path_to_app1/tmp/unicorn.sock; } #app2 upstream backend-unicorn2 { server unix:/path_to_app2/tmp/unicorn.sock; } server { listen 80; server_name localhost; location /app1/ { .... pr…

unicorn_rails nginx sinatra&rails複数アプリをフォルダー毎 config.ru

config.ruをdev時でもprod時でも動くように設定 http://www.mk-mode.com/octopress/2013/01/22/ruby-on-rails-nginx-unicorn/ http://higelog.brassworks.jp/?p=1760# This file is used by Rack-based servers to start the application.require ::File.exp…

Sinatra/Railsがデフォルトでは外部から繋がらない

Rails Rails4.2からブラウザからアクセスしようとしたら繋がらない。 $ ./bin/rails s => Booting WEBrick => Rails 4.2.0 application starting in development on http://localhost:3000起動時のアドレスがlocalhostになっていると外部からのアクセスが繋…

redmine sqlite webrick

http://www.redmine.org/projects/redmine/wiki/Downloadwget http://www.redmine.org/releases/redmine-3.0.5.tar.gz$ cd ~/redmine-3.0.5 $ bundle install$ nano ~/redmine-3.0.5/config/database.yml# SQLite3 configuration example development: adapt…

refinary tutorial no work チュートリアル動かない 再考:ダウンロードページhttp://www.refinerycms.com/downloadより再構築

rails4で動く、動かない両方の記述が散出しているので、 https://github.com/refinery/refinerycms/issues/3032 を元に現時点(2015/9月)でのインストールとチュートリアル(http://www.refinerycms.com/guides/getting-started/#rails-application-templat…

refinary tutorial no work チュートリアル 動かない

Refinaryのgetting-startedを参考にインストールを試みたが、失敗。http://www.refinerycms.com/guides/getting-started http://www.refinerycms.com/download 参考の参考 http://blog.scimpr.com/2014/08/13/rails4-1%E3%81%AB%E5%AF%BE%E5%BF%9C%E3%81%97%…

RoR rails Could not find a JavaScript runtime.

/home/user/.rvm/gems/ruby-2.0.0-p643/gems/execjs-2.6.0/lib/execjs/runtimes.rb:48:in `autodetect': Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable) from …

rbenvのアンインストール

rbenvのアンインストール$ rm -rf ~/.rbenv $ rm -rf /usr/local/bin/rbenv $ rm -rf /usr/local/Cellar/rbenv.bash_profile等でPATHを設定した部分も削除して下さい

Ubuntu new user sudoer ubuntu ユーザを追加して sudo 権限をつける

adduser user_name (※ useradd はホームディレクトリが作成されない) su user_name gpasswd -a user_name sudo

rbenv directory 毎にruby version バージョン

RVM環境を切腹$ rvm seppukurbenvをクローンする。$ git clone https://github.com/sstephenson/rbenv.git ~/.rbenvruby-buildをクローンする。$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build.bashrcに追記する。$…

nat

POSTROUTING ACCEPT [0 0] # Allow forward traffic to eth0 A POSTROUTING -s 10.99.99.0/24 -o eth0 -j MASQUERADE # Process the NAT table rules COMMITAt this point, you can run "sudo ufw disable && sudo ufw enable" or just reboot to be safe. Y…

note, you can use any DNS servers you like, the two above are OpenDNS's public DNS servers.

Edit /etc/pptpd.conf At the end of the file "/etc/pptpd.conf", add: localip 10.99.99.99 remoteip 10.99.99.100-199These values do not have to correspond to your network. It is best to pick un-accessible/unused addresses here if you only wan…

firewall ufw

http://silverlinux.blogspot.hk/2012/05/how-to-pptp-vpn-on-ubuntu-1204-pptpd.htmlHow To: PPTP VPN on Ubuntu 12.04 (pptpd) I recently started renting a 128 MB RAM Xen VPS for $15/quarter with a promotional offer for nqhost.com as seen on htt…

Ubuntu 14.04 日本語入力 input method

Fcitx and fcitx-anthy インストール後 http://www.server-world.info/query?os=Ubuntu_14.04&p=japanese

ubuntu 14.04 pptp client resolv.conf NetworkManager.conf DNS routing after PPTP connection

http://askubuntu.com/questions/640172/dns-routing-after-pptp-connection http://www.stgraber.org/2012/02/24/dns-in-ubuntu-12-04/ askubuntu.com/questions/137037/networkmanager-not-populating-resolv-conf

評判のさくらのVPSを使うときに最初にやっておきたいこと(Ubuntu編)

http://server-setting.info/ubuntu/first-setting-ubuntu-server.html

How to build a dedicated VPN router

http://websetnet.com/how-to-build-a-dedicated-vpn-router/

VPNを使っているLAN内のPCにWAN(外部)からルーターのForwardingを利用してアクセス

VPN使用時にはルーターからフォワードされたパケットは該当機に到達するが、その後処理され元のルーターに帰らずVPNのゲートウェイに押し出される。 結果として、外部からのアクセス結果がアクセスをした外部機に戻らなくなる。(外部機からはアクセス出来無…

PhantomJS headless browser

http://phantomjs.org/download.html http://phantomjs.org/build.html

buy app

http://www.chupamobile.com/split-test http://www.chupamobile.com/ios-app-templates/restaurant-app-premium-template-3725

vpn client setup

http://www.cyberciti.biz/tips/howto-configure-ubuntu-fedora-linux-pptp-client.html Linux configure point to point tunneling PPTP VPN client for Microsoft PPTP vpn server by Vivek Gite on June 11, 2007 in FreeBSD, Howto, Linux, Linux distri…

cron gnome terminal

export DISPLAY=:0 && /usr/bin/gnome-terminalhttps://help.ubuntu.com/community/CronHowto http://superuser.com/questions/351528/open-a-terminal-from-a-crontab

byobu tmux script

http://mukaer.com/archives/2012/07/07/tmuxcron/ 基本的には2つのターミナルを用意して、初めのターミナルで$ byobu-tmux new-session -n foo次に別のターミナルで #スクリプトの実行結果をbyobuのgooウィンドに残したい場合 $ byobu-tmux new-window -n g…

sinatra moduler

http://www.slideshare.net/sonots/sinatra-pattern-20130415 https://github.com/sonots/sinatra-tutorial/tree/master/08.multi

cron crontab whenever

http://morizyun.github.io/blog/whenever-gem-rails-ruby-capistrano/ $ gem install whenever $ cd /apps/my-project $ wheneverize ./apps/my-project/config/schedule.rbが出来る$ nano ./config/schedule.rb# Use this file to easily define all of yo…

headless virtual display resolusion xrandr

#! /bin/bash#cvt 1280 720 #cvt 1680 1050xrandr --newmode 1680x1050 146.25 1680 1784 1960 2240 1050 1053 1059 1089 -hsync +vsync xrandr --newmode 1280x720 74.50 1280 1344 1472 1664 720 723 728 748 -hsync +vsyncxrandr --addmode VIRTUAL1 1680…

MTA postfix telnet MailDir

http://www.unixmen.com/setup-local-mail-server-using-postfix-dovecot-squirrelmail-opensuse-13-x/

ubuntu VPN使用の際、特定のドメイン/IPをVPNを通さないように除外するルーティング route exception

/etc/network/if-up.d/static-routes ファイル(がなければ作成して実行可能にし,それ)に次の行を追加する.#!/bin/sh /sbin/route add -net "domain" gw gateway_ip netmask 255.255.255.255 dev eth0

LibreOffice calc Slow in Ubuntu Memory&Java

1.Increase memory Open up LibreOffice Writer. Click Tools -> Options. Click Memory (under LibreOffice). Increase the Graphics Cache -> Use for LibreOffice value (try 128 MB to start and increase further if needed). Increase Memory per obje…

ruby gem ssh sftp

http://www.infoq.com/jp/articles/ruby-file-upload-ssh-intro