github

[Home] All Posts

Post Titles:

All Posts:

 

Installing Jekyll is easier than ever on Ubuntu 12.10 using apt-get and gem install. Additional options such as Pygments and Rdiscount can be added with the same methods.

Install Jekyll

Install Ruby 1.9.1 which includes the gem command, and the make command:

sudo apt-get install ruby1.9.1 ruby1.9.1-dev make

Install Jekyll:

sudo gem install jekyll

Start Jekyll

Jekyll can be run inside the website directory:

jekyll

Then visit http://localhost:4000 in your web browser to see your Jekyll site.

Additional Options

Install Pygments code syntax highlighter:

sudo apt-get install python-pygments

Install Rdiscount and Kramdown renderers for Markdown:

sudo gem install rdiscount kramdown

If the Jekyll webserver is not started by default, you can specify the --server option:

jekyll --server

The default port 4000 can be changed, for example when running multiple Jekyll instances:

jekyll --server 4001

Then visit http://localhost:4001

References

http://stackoverflow.com/a/8113213/2043808

 

Jekyll generates a complete website such as a blog from plain text files. The generated files can be served by any standard webserver. Markup languages such as Markdown are supported through Gems. Jekyll is made to be compatible with version control systems such as Git. These steps will install Ruby and Jekyll for the current user. Tested on Ubuntu Server 11.10 Oneiric

RVM

The Ruby Version Manager can be used to install the latest version of Ruby on Ubuntu.

Update System

Make sure the system is fully updated.

sudo apt-get update && sudo apt-get dist-upgrade

RVM Dependencies

The RVM install script requires CURL

sudo apt-get install curl

RVM Install Script

The RVM install script will install the stable version of RVM for the current user. After RVM is installed Ruby will automatically be installed.

curl -L get.rvm.io | bash -s stable

Enable RVM commands in the current shell.

source ~/.rvm/scripts/rvm

Ruby Dependencies

Use rvm requirements to generate a list of Ruby dependencies. In Ubuntu 11.10 it is:

sudo apt-get install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion

Ruby

Now use RVM to install the default version of Ruby.

rvm install ruby

Test Ruby

ruby -v

Should say something like: ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux]

Jekyll

Install Jekyll

gem install jekyll --no-rdoc --no-ri

Optional

Pygments

Pygments allows syntax highlighting.

sudo apt-get install python-pygments

Markdown

Two alternative Markdown renderers are Rdiscount and Kramdown.

Rdiscount

gem install rdiscount --no-rdoc --no-ri

Kramdown

gem install kramdown --no-rdoc --no-ri

SASS and rb-inotify

Needed for some themes.

gem install sass --no-rdoc --no-ri
gem install rb-inotify --no-rdoc --no-ri

Run Jekyll

Jekyll is now installed, and is ready to be used.

Clone Repository

Download the latest copy of your website. Use the URL for your project.

Read-only access to the repository, such as on servers.

git clone git://github.com/mchelen/michaelchelen.net.git

Write access to the repository, for when creating and editing web pages.

git clone git@github.com:mchelen/michaelchelen.net.git

Start Jekyll

cd michaelchelen.net
jekyll

The website files will be generated in the _site directory. These can be served by any standard webserver such as Apache.

Site settings are stored in the _config.yml file.

These settings can be overriden through the command line. For example the website can be viewed through the Jekyll server using --server instead of another web server. The --auto option will cause the website to be regenerated when any files are edited.

jekyll --server --auto
 

Jekyll is a Git compatible static site generator that can be installed on Ubuntu. The template system can be configured for a blog style layout. Tested on Ubuntu Server 11.04 Natty.

Install Dependencies

sudo apt-get install git ruby rubygems python-pygments
sudo gem install rdiscount --no-rdoc --no-ri

The --no-rdoc --no-ri options are suggested for lightweight server installs.

Install Jekyll

sudo gem install jekyll --no-rdoc --no-ri

The Ubuntu package uses a Gem directory of /var/lib/gems/1.8/bin/ which must be added to your path.

export PATH=/var/lib/gems/1.8/bin:$PATH

Make this change permanent by adding the line to ~/.profile

Optional

Speed up LSI

Accelerate LSI by using GSL

sudo apt-get install libocamlgsl-ocaml-dev libgsl-ruby1.8   

Install Kramdown

Kramdown is a Markdown renderer alternative to Rdiscount.

sudo gem install kramdown --no-rdoc --no-ri

Recommended Templates

Additional Site Examples

 

Git is a revision control system. Gollum is a webserver to work with the repository locally. Smeagol is webserver to publically display the repository pages.

Gem install sudo is optional for system-wide install.

Prerequisites

enable universe repository

sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo sed -i -e "s/# deb/deb/g" /etc/apt/sources.list

install dependencies

sudo apt-get update
sudo apt-get -y install ruby rubygems ruby-dev libxml2-dev libxslt-dev

Install Gollum and/or Smeagol

sudo gem install gollum --no-ri --no-rdoc

sudo gem install smeagol --no-ri --no-rdoc

Markdown support

sudo gem install rdiscount --no-ri --no-rdoc

Syntax highlighting

sudo apt-get install python-pygments

Update PATH and reload .bashrc

echo "export PATH=$PATH:/var/lib/gems/1.8/bin" >> ~/.bashrc
source ~/.bashrc

Clone Wiki repository

Public Git URL

git clone git://github.com/mchelen/michaelchelennet.wiki.git

Start Gollum

Change to the directory with the Git repo and start repo.

cd michaelchelennet.wiki
gollum

GitHub wikis can be branched and merged

Install Smeagol

Smeagol https://github.com/benbjohnson/smeagol

sudo gem install smeagol

Smeagol supports multiple repositories

Why Markdown?

Markdown is easier to read and write than HTML

Hello World

<html>
  <body>
    <h3>Hello World</h1>
    <li>
      <ul>Bar1</ul>
    </li>
  </body>
</html>

test

    ### Hello World
    - Bar1

Sources

 

ConnectBot is an open source SSH client for Android. SSH provides secure access to a remote server. Both password and public key authentication are allowed. A key can be created in ConnectBot for use with the server. The key can be disabled at any time.

ConnectBot running on HTC Aria from AT&T.

This method can be performed entirely from your Android handset if you currently have password access to an SSH server. ConnectBot supports shell login and port forwarding, and file transfer is planned. Tested with ConnectBot 1.7.0, Android 2.2, and Ubuntu 10.10 Maverick Beta.

Install Open SSH server

SSH server must be installed on the remote system. Key authentication is usually enabled by default. To install in Ubuntu:

sudo apt-get install openssh-server

Start ConnectBot

ConnectBot home screen. There are no known hosts yet.

Select Manage Pubkeys

Click Menu, then Manage Pubkeys to configure keys.

Manage Pubkeys Screen

There are no keys set up yet.

Generate Pubkey

Click Menu then Generate. We are going to create a new key. This allows us to specifically revoke access if the handset is lost.

Generate Pubkey Settings

The new pubkey settings. Most of the defaults are fine. We will create a 1024 bit RSA key.

Example Settings


You can call your key anything you like. I have named mine after the device, htc_aria. Enable "Load key at start" to have the key automatically loaded by ConnectBot.

Collect Entropy


Random numbers are used to generate the key. Move your finger around the screen until enough randomness has been collected.

New Pubkey Created


The new key has been created. It is unlocked and will be used by ConnectBot automatically when connecting to a server.

Copy Pubkey


Long press on the new key to bring up a menu. Click "Copy public key" This public part of the key will be copied onto the remote server.

Connect to Server


Go back to the ConnectBot home screen and enter your server information to connect to your SSH server.

First Connection


Choose "Yes" to accept the server's key if this is the first time connecting to the server.

Connection Established


Login with a username and password to complete the connection. This is now the terminal of the remote server.

Add Key

The list of keys accepted for this user is stored in the authorized_keys file. This file is located in the .ssh directory within the user's home directory. Use the echo command and paste in the key, surrounded by parentheses. The >> will append your public key onto the .ssh/authorized_keys file.

echo "PASTEKEYHERE" >> .ssh/authorized_keys

For example:

echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAAAgQDQFSzet/Qu8SLklDQyNbX5k16MwOBVKuaY9bNJhb99BkIRIVbNpr61eHUG3gP6haNC6qreTbpHscq4AQV21gLvCgVmHsTci0QAK44weFyDzVwIBFH9uUN+f/k2NTY9zV8FaBqK9CW8hS2f50EB38mGYvE7/0/S1u7/jtxnKqwAgw== htc_aria" >> .ssh/authorized_keys

Set Permissions for authorized_keys

The .ssh/authorized_keys file must be writeable only by the owner. Set the permissions to 644 which means rw-r--r-- if it is not already that way.

chmod 644 .ssh/authorized_keys

Disconnect

Disconnect from the server. It will be now be listed on the screen.

Test Connection

Connect to the server again. While logging in it will say that public key authentication is being attempted:

Attempting "publickey" authentication with any in-memory public keys

If the key is working, no username or password will be required to complete login. The SSH key authentication is now configured!

Optional: Disable Key

If the device is lost or access should to be disabled at any time, remove the key from the authorized_keys file. Use any text editor, or sed, to find the appropriate line. With a key named htc_aria for example:

cd ~/.ssh
sed '/htc_aria$/d' authorized_keys | tee authorized_keys

Recent Comments