Showing posts with label instiki. Show all posts
Showing posts with label instiki. Show all posts

Saturday, June 25, 2011

Getting Instiki wiki working on Ubuntu 11.04

Previous: Installing rvm on Ubuntu 11.04

I started by copying my backup of the whole directory .wiki from an external drive to /home/.wiki.
Then I ran the following commands:
rvm gem install bundler
sudo apt-get install
libxml2-dev
libxslt1-dev
sqlite3
libsqlite3-dev
cd .wiki
bundle
Bundler installed other components Instiki uses, including nokogiri, rubyzip, and sqlite3-ruby.

Instiki did not start, and reported this error:
/home/dave/.rvm/rubies/ruby-1.9.2-p180/lib
/ruby/1.9.1/psych.rb:148:in `parse':
couldn't parse YAML at line 18 column 14 (Psych::SyntaxError)


I found an explanation and workaround by vicvega on
Stack Overflow. I added the lines
require 'yaml'
YAML::ENGINE.yamler= 'syck'
at the top of Instiki's config/boot.rb file (just above the comment that reads, "Don't change this file!"), and Instiki started up clean. In a nutshell, the problem was that bundler uses psych as the default yaml parser, psych is not compatible with rails, and Instiki is a rails app.

In .bash_aliases I added a line to start the wiki conveniently:
alias wiki=~/.wiki/instiki


Next: Ubuntu 11.04 on Dell Vostro 3550 - FAIL

Tuesday, November 2, 2010

Ubuntu 10.04 upgrade on Toshiba Satellite: Instiki wiki

Previous: Ubuntu 10.04 upgrade on Toshiba Satellite: Ruby Version Manager

Recent practice migrating my wiki on the Acer netbook made the process go smoothly on the Toshiba.

First step was to install prerequisites::
sudo apt-get install
libxml2-dev
libxslt1-dev
sqlite3
libsqlite3-dev
gem install sqlite3-ruby
Then, I downloaded the latest Instiki from http://instiki.org/ and unpacked the tarball. I copied the instiki directory to /home and renamed it .wiki. Next, I changed to the .wiki directory and ran
ruby bundle
Finally, I renamed the installed db and public directories to db-shipped and public-shipped, and copied the db and public directories from my wiki backup. Instiki came up clean the first time.

Now to get my wiki startup and shutdown scripts working. I copied the icon, instiki.png, to the new .wiki directory. Created a .bin directory in /home and copied the wiki and wiki_stop scripts there. The new directory structure was different, so I edited the scripts accordingly.

My shutdown script didn't work, and after some experimentation I realized that instiki startup is a bit different than it used to be. Previously, it printed the pid to stderr, and I picked it up with awk to generate a shutdown script on the fly. This version of Instiki appears not to do that, so I need to work out another way to handle shutdown nicely. Not worth pursuing at the moment.

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: TrueType fonts & VSM font

Ubuntu 10.04 upgrade on Acer netbook: Instiki migration

Previous: Ubuntu 10.04 upgrade on Acer netbook: Ruby Version Manager and Ruby 1.9.2

One final check on the Acer before attempting this install on the Toshiba: Will my local Instiki wiki run under ruby 1.9.2?

First, I installed the usual prerequisites:
sudo apt-get install
libxml2-dev
libxslt1-dev
sqlite3
libsqlite3-dev
gem install sqlite3-ruby
Then, I downloaded the latest Instiki from http://instiki.org/ and unpacked the tarball.

When I started Instiki, it complained:
Bundler couldn't find some gems. Did you run 'bundle install'?
This hasn't happened before in my experience, so I assume it has something to do with running ruby under rvm vs. running it native.

I did an Internet search for 'instiki bundle install' and found useful information at http://golem.ph.utexas.edu/wiki/instiki/show/installation. After reading that information, I thought I had everything in place to run the bundle command, so I ran it from the instiki root directory:
ruby bundle
No complaints, so I started Instiki and it came up clean.

I shut down Instiki and copied the 'public' and 'db' directories from my old wiki (still on the Toshiba) to the one just installed on the Acer. This was sort of a risky short-cut, since I didn't follow any of the instructions for migrating the database. When I started Instiki, it came up clean. Apparently there have been no changes to the basic database structure since the last release. (Whew!)

I noticed that they've added a 'Skip the navigation links' link as the first link in the navigation bar of Instiki. That's a nice accessibility feature and a convenience for anyone who prefers the keyboard to the mouse. Kudos.

At this point, it looked as if Ubuntu 10.04 was okay for the Acer.

(Actually, Ubuntu has been more than just 'okay' for the Acer. IMHO it's a very good environment for a netbook. It's functional, simple, clean, relatively safe, and supports all the usual social networking tools. OpenOffice provides the tools I need to make presentations and so forth when on the road. A $200 machine with a free operating system and all the applications I need ... ideal for the purpose.)

Open questions about how 10.04 would run on the 64-bit Toshiba and whether it would support the wireless adapter could only be answered by installing it on that machine. Installing typical development tools should be no different on either machine, and since I don't use the Acer for development there was no value in going any further with those installs.

Next: Ubuntu 10.04 upgrade on Toshiba Satellite: Prep and basic install

Tuesday, April 13, 2010

Reinstalling some favorite apps after reinstalling Ubuntu

Previous: Restoring Firefox personalization after re-installing Ubuntu

So, I wanted to reinstall some of the apps I had been using before. But the way I had them scattered around the filesystem was pretty sloppy. Better this time.

Recovering my local wiki



Installed sqlite3 and sqlite ruby support (Instiki depends on them):
sudo apt-get install sqlite3 libsqlite3-dev
sudo gem install sqlite3-ruby
Put the wiki under /home/.wiki so that it would not show up in normal directory listings.

Moved the wiki icon to /usr/share/pixmaps to make it consistent with other applications.

Put a wiki icon on the top panel for convenient starting.

For more information about how I've customized Instiki for personal use, see http://kotowanandesu.blogspot.com/2009/08/pimp-my-instiki.html.

Reinstalling Google Earth



Installed Google Earth by following the instructions I documented on this blog at http://kotowanandesu.blogspot.com/2009/09/google-earth-install.html. I downloaded a fresh copy in case there have been any updates since the last time I installed it.

Had a problem this time that I didn't have last time. The installer complained that gtk2 was missing.

Searching for similar problems, I found that some people had installed lib32nss-mdns, and this solved the problem for them. I tried
sudo apt-get install lib32nss-mdns
and ran the installer again.

The console output was:
setup.data/bin/Linux/amd64/setup.gtk2: error while loading
shared libraries: libxml2.so.2: cannot open shared
object file: No such file or directory
setup.data/bin/Linux/amd64/setup.gtk: error while loading
shared libraries: libSM.so.6: cannot open shared
object file: No such file or directory
The setup program seems to have failed on amd64
Better, but apparently I forgot to install libxml2 after reinstalling Ubuntu. I found a security notice for 9.04 at http://www.ubuntu.com/usn/USN-815-1 advising an upgrade. I did that and tried
sudo apt-get install libxml2
and it informed me the latest version of libxml2 was already installed. So, that wasn't the problem.

There are many personal blogs out there written by people whose installation worked properly on the first try. I found no help that addresses the problems I'm seeing today.

I ran across a comment by Daniel Holbach buried in a long list of comments on one article that advised the following:
$ sudo apt-get install googleearth-package
$ make-googleearth-package --force
Doubleclick on the resulting .deb file.
I gave that a try, since there was little to lose at this point.

The make spewed hundreds of warning-level messages. The installer proved to be a very long-running process. I left it running during the day and checked on it after work. It worked fine.

This time I put the app in ~/.googleearth so that it would not show up in normal directory listings.

Reinstalling Freemind



Copied my old installation of Freemind from a backup. Referred to to set it up. This time, I put the app in ~/.freemind and set an alias for 'freemind' instead of putting the absolute path in the freemind.desktop file. No problems with this install.

Reinstalling UMLet



A new version of UMLet is available. I downloaded the standalone version and the Eclipse plugin from http://www.umlet.com, version 10.1. I had 10.0 previously. Recovering from a system crash offers all sorts of opportunities for improvement.

I set up the standalone version in the same way as I had set up Freemind. This time, I noticed that UMLet has its own logo. I downloaded the logo from their site and associated it with the app, instead of the icon I came up with before.

Installation of the standalone UMLet consists of unpacking the zip file. The shell script that starts the program already had execute privileges. Convenient. The default directory name is UMLet. I changed it to .umlet. I defined an alias, umlet, in .bash_aliases, ran my .bash_profile and gave it a try.

Didn't work. I took a look at the UMLet.sh file, and learned that it looks for an environment variable, UMLET_HOME. So, they've made things a bit more formal. I added these lines to my .profile:
UMLET_HOME=~/.umlet
export UMLET_HOME
then copied ~/.umlet/UMLet.sh to ~/.bin/umlet.sh and uncommented the line that changes to the UMLET_HOME directory. Typing umlet at a command prompt started the program properly.

I copied the umlet.desktop file from my backup and changed it to refer to the new logo file:
[Desktop Entry]
Encoding=UTF-8
Name=UMLet
Comment=UML diagramming tool
Exec=umlet
Icon=umlet_logo.jpg
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
and copied the logo file to /usr/share/pixmaps. At this point, UMLet appeared in the gnome menu under Applications > Programming, but the logo image was not displayed. I used Gimp to change it from .jpg to .png. Worked!

Logged out and in and tried to run UMLet from the menu. The launcher was unable to start the child process. It complained that there was no such file or directory as "umlet." I checked .bash_aliases and it looked correct. There must be something about launchers I don't quite understand. I changed the alias to give the absolute path of umlet.sh, logged out and in, and tried again. Worked!

Dropped the jar for the UMLet Eclipse plugin into the Eclipse plugin directory and started Eclipse. Created a UML diagram from Eclipse's New... dialog. Looks good.

Reinstalling Banshee



Ran the command
sudo apt-get install banshee
Banshee appeared in the gnome menu, and started normally. It imported my music files correctly. It played mp3 files correctly. It imported my video files correctly. It played .flv, .mov, .mp4, .mpg, .mpeg correctly.

Next: Shell personalization after reinstalling Ubuntu

Friday, August 14, 2009

Pimp My Instiki

Previous: Installing support for .NET development.

Instiki is a simple wiki that I use to keep track of useful information. I find it easier to find information if it's organized in a wiki than if it's scattered all over the filesystem.

To get Instiki, go to http://www.instiki.org and download it. There's no further installation to do, and no mandatory configuration before you can start using Instiki. Start an instance by navigating to the directory where you installed Instiki and running the instiki command.

Instiki is very simple and is Open Source. Users are encouraged to customize it. Some people use Instiki as the basis of public websites, and they do some pretty extensive customization. For my purposes, it's just a single-user wiki running on my laptop. To make it a little friendlier and better integrated with my desktop, I've made the following changes.

Start and stop scripts


As shipped, Instiki expects you to start it from a command line and stop it by typing ctrl+C. I set up a start script that starts Webrick in the background and saves the pid so that a kill command can be issued later.

Start script is ~/bin/wiki. It picks up the pid from stderr, where Instiki writes it, and creates the stop script on the fly in ~/bin/wiki_stop. The stop script does a kill -9, since Instiki appears to ignore SIGTERM.
#!/bin/bash
# Start the instiki wiki
cd ~/wiki/inst*
`./instiki 2> wiki_$` &
sleep 12
# Grab the pid and create a quick
# and dirty shutdown script.
echo `awk '/pid=/ {split($5,thepid,"="); print "kill -9 "
thepid[2]}' wiki_$` > ~/bin/wiki_stop
chmod +x ~/bin/wiki_stop
# This will start Firefox if necessary.
# Otherwise it will open in a new tab.
firefox http://localhost:2500/
I set up aliases for the scripts in ~/.bash_aliases.
alias wiki='~/bin/wiki'
alias wiki_stop='~/bin/wiki_stop'

Associated an icon with Instiki and created a desktop definition


AFAIK no one has yet created a logo or icon for Instiki. I found a nice one in a set called Influens by artist Matt U on Deviant Art, at http://mat-u.deviantart.com/art/influens-icons-62280875. It looks like this:


The icon is apopros of the way I use Instiki in that it depicts a folder of documents with sticky notes on them, suggesting an informal, working scratchpad area.

I copied it to ~/wiki/instiki.png and created an instiki.desktop file in /usr/share/applications with the following contents:
[Desktop Entry]
Encoding=UTF-8
Name=Instiki
Comment=Personal Wiki
Exec=wiki
Icon=/home/dave/wiki/instiki.png
Terminal=false
Type=Application
Categories=GNOME;Application;Development;
StartupNotify=true
Made the favicon for Instiki match the desktop icon by copying the .ico version of the file to ~/wiki/inst*/public/favicon.ico.

Reclaimed screen real estate when viewing a page


By default, Instiki displays wiki content in a narrow column centered on the page. To make this area wider I made the following change in ~/wiki/inst*/public/stylesheets/instiki.css. As shipped, the definition of #Content looks like this:
#Content {
border-top:none;
margin:auto;
padding:0.3em;
text-align:left;
width:100%;
max-width:55em;
}
I removed the max-width specification, resulting in this:

#Content {
border-top:none;
margin:auto;
padding:0.3em;
text-align:left;
width:100%;
}

Reclaimed screen real estate when editing a page


The edit and create views provide a small textarea for entering content. They also display a few examples of wiki markup in an area on the right-hand side of the frame. Since I'm using Instiki on my local machine only, I don't have to worry about accommodating different screen sizes or different markup languages. I'd rather have a large textarea that mostly fills the frame. I don't need the markup help to be visible all the time and I'm always using Textile, so I could free up some real estate by replacing the help area with a single link. Here are the portions of ~/wiki/inst*/app/views/wiki/edit.rhtml that were affected, as shipped:

<%-
@title = "Editing #{@page.name.escapeHTML}"
@content_width = 720
@hide_navigation = true
-%>

<div id="MarkupHelp">
<%= render(:file => "#{@web.markup}_help") %>
<%= render(:file => 'wiki_words_help') %>
</div>

<% form_tag({
:action => 'save',
:web => @web.address,
:id => @page.name },
{ 'id' => 'editForm',
'method' => 'post',
'onsubmit' => 'cleanAuthorName()',
'accept-charset' => 'utf-8' }) do %>
<div>
<textarea name="content" id="content" rows="24" cols="60">
<%= h(flash[:content] ||
((params['content'] && params['content'].is_utf8?) ?
params['content'] : @page.content).purify) %></textarea>
. . .
I removed the MarkupHelp div, added a link to Textile help to open in a new tab, and increased the size of the textarea, resulting in this:

<%-
@title = "Editing #{@page.name.escapeHTML}"
@content_width = 720
@hide_navigation = true
-%>
<% form_tag({
:action => 'save',
:web => @web.address,
:id => @page.name },
{ 'id' => 'editForm',
'method' => 'post',
'onsubmit' => 'cleanAuthorName()',
'accept-charset' => 'utf-8' }) do %>
<div>
<a href="http://hobix.com/textile/quick.html"
target="_blank">Textile Help</a><br />
<textarea name="content" id="content"
rows="30" cols="190"><%= h(flash[:content] ||
((params['content'] && params['content'].is_utf8?) ?
params['content'] : @page.content).purify) %></textarea>
. . .
I made the same changes in ~/wiki/inst*/app/views/wiki/new.rhtml.

Disabled spam filtering


Since this instance of Instiki resides locally and is not accessible on the network, I didn't need Instiki to protect me from my own innocent updates. I disabled spam filtering by deleting the file config/spam_patterns.txt.

One more thing...


I copied my personalized version of Instiki over from my MacBook Pro rather than installing Instiki fresh and repeating the modifications. Initially, Instiki would not start up. It displayed the catch-all "Do you smell smoke?" message and offered no clues on the console or log file.

A brief Internet search turned up a note on http://rubyforge.org/pipermail/instiki-users/2009-April.txt reporting that on Debian and its variants (including Ubuntu) some packages on which Instiki depends are not installed by default. I ran the following command, and the problem was fixed:
sudo apt-get install 
ruby1.8-dev swig libsqlite3-ruby1.8 flex bison


Next: Installing Git