Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
#!/usr/bin/env ruby | |
# From: http://ngauthier.com/2014/06/scraping-the-web-with-ruby.html | |
require 'capybara' | |
require 'capybara/poltergeist' | |
require 'csv' | |
require 'gdbm' | |
class NickBot | |
include Capybara::DSL |
# 1) Create your private key (any password will do, we remove it below) | |
$ cd ~/.ssh | |
$ openssl genrsa -des3 -out server.orig.key 2048 | |
# 2) Remove the password | |
$ openssl rsa -in server.orig.key -out server.key |
# To enable SSL in Rails you could now simply use *force_ssl* in your | |
# ApplicationController but there is two more things to think about: | |
# In development our SSL webserver is running on port 3001 so we would | |
# actually need to use *force_ssl port: 3001* but then this wouldn't | |
# work for production. | |
# Also there is a good chance you might not always want to use SSL in development | |
# so it would be nice if we could just enable or disable SSL in the config. | |
# To make all this work first copy the file *ssl_with_configured_port.rb* to | |
# your *lib* directory. Second to enable SSL add *config.use_ssl = true* |
class ApplicationController < ActionController::Base | |
protect_from_forgery with: :exception | |
private | |
def signed_in? | |
!!session[:user_id] | |
end | |
helper_method :signed_in? |
class ApplicationController < ActionController::Base | |
protect_from_forgery | |
protected | |
def current_user | |
@current_user ||= User.find_by_id(session[:user_id]) | |
end | |
def signed_in? |
source :rubygems | |
gem 'pry' | |
gem 'capybara' | |
gem 'capybara-webkit' | |
gem 'celluloid' |
docker images | egrep "<none>.*<none>" | awk '{print $3}' | while read image ; do docker rmi -f $image; done |
Let's have some command-line fun with curl, [jq][1], and the [new GitHub Search API][2].
Today we're looking for: