Skip to content

Instantly share code, notes, and snippets.

View chatman-media's full-sized avatar
:octocat:
Flow

Alexander Kireyev chatman-media

:octocat:
Flow
View GitHub Profile
protopipe git:(master) ✗ rake ts:rebuild
Sphinx cannot be found on your system. You may need to configure the following
settings in your config/sphinx.yml file:
* bin_path
* searchd_binary_name
* indexer_binary_name
For more information, read the documentation:
protopipe git:(master) ✗ thin start
>> Using rack adapter
>> Thin web server (v1.5.0 codename Knife)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:3000, CTRL+C to stop
/home/alder/.rvm/gems/ruby-1.9.3-p194@protopipe/gems/thin-1.5.0/lib/thin/backends/tcp_server.rb:16:in `connect': cannot load such file -- thin/connection (LoadError)
from /home/alder/.rvm/gems/ruby-1.9.3-p194@protopipe/gems/thin-1.5.0/lib/thin/backends/base.rb:55:in `block in start'
from /home/alder/.rvm/gems/ruby-1.9.3-p194@global/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `call'
from /home/alder/.rvm/gems/ruby-1.9.3-p194@global/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run_machine'
from /home/alder/.rvm/gems/ruby-1.9.3-p194@global/gems/eventmachine-1.0.0/lib/eventmachine.rb:187:in `run'
# Path to your oh-my-zsh configuration.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
export ZSH_THEME="robbyrussell"
@chatman-media
chatman-media / gist:4342740
Created December 20, 2012 03:34
sudo netstat -antp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 29367/ruby
tcp 0 0 0.0.0.0:35729 0.0.0.0:* LISTEN 3660/sublime_text
tcp 0 0 0.0.0.0:28017 0.0.0.0:* LISTEN 1221/mongod
tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 1465/dnsmasq
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 28290/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1227/cupsd
tcp 0 0 127.0.0.1:5432 0.0.0.0:* LISTEN 11088/postgres
tcp 0 0 127.0.0.1:9312 0.0.0.0:* LISTEN 29094/searchd
@chatman-media
chatman-media / gist:4357810
Created December 22, 2012 06:58
thin dev
require 'rbconfig'
if RbConfig::CONFIG['host_os'] =~ /linux/i
gem 'therubyracer', :group => [:assets]
gem 'libv8', '~> 3.11.8', :group => [:assets]
gem 'thin', :group => [:development]
end
@chatman-media
chatman-media / gist:4361531
Last active December 10, 2015 01:48
omniauth
# Method 1
# https://github.com/ksylvest/zencodeit
# ENV['OMNIAUTH_PROVIDER_DATA'] used for define data through server console, that possible, but can be discarded
# initializers / omniauth.rb
config = YAML::load(File.read("#{Rails.root}/config/omniauth.yml"))[Rails.env]
config['twitter' ] ||= {}
config['facebook'] ||= {}
Login to the server via SSH:
~ ey ssh
On the server go into the right directory:
~ cd /data/app_name/current
Start the rails console with:
~ ey_bundler_binstubs/rails c
class PostController < Application Controller
before_filter :ensure_post, only: [:show, :edit, :update, :destroy]
private
def post
@post ||= Post.find_by_id params[:id]
end
helper_method :post
@chatman-media
chatman-media / GemFile
Created July 9, 2013 00:55
rails example gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.11'
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'uglifier', '~> 1.0.3'
gem 'compass-rails', '~> 1.0.3'
end
<a href="http://localhost:3000/auth/google"><img src="/images/gg2.png" alt=""></a>
<div class="hero-unit">
<h1>'Allo, 'Allo!</h1>
<button ng-click="authenticate()" class="btn btn-primary">Authenticate</button>
<div ng-app="directive.g+signin">
<g+signin clientid="236823754682-c22gabjasrta49kj9cnjcqo0cmmfppov.apps.googleusercontent.com"></g+signin>
<p>^ This is a Google Plus sign-in button</p>
</div>