Balazs Kutil

Git in a Box Appliance on SUSE Studio

Gitbox is a small openSUSE 12.1 based appliance that offers a pre-configured bare git repository accessible through ssh. A post-receive hook will create a tarball snapshot of the repository after every push.

Update (2012-03-08): If you’re looking for a more complete solution, including issue tracking, repo management and pull requests, you might want to check out GitLab or try the GitLab appliance

Twitter Bootstrap Based Theme for Octopress

Octopress is a cool ‘blogging platform for hackers’. Blog posts are written in simple markdown syntax and octopress takes care of the rest. It contains a nice, simple theme, generates static pages and deploys them to either github or via rsync to a private site.

For one of my projects, Diffboard, I needed to create a blog that visually matches the main site. The result is bootstrap-theme, octopress theme that uses twitter bootstrap grid system.

The Diffboard blog currently showcases the theme.

2012-03-27 Update: To avoid shameless self-promotion, I set up a dedicated demo site running latest code from master ;) The blog may seem a bit bloated, as almost all features are enabled, but this is to make debugging and tweaks easier.

Showcasing Your (PHP) Web App With SUSE Studio

SUSE Studio, together with its Testdrive feature, can be used to setup a demo for your web application. You can then let users download and deploy the appliance and have the service up and running in a few minutes.

In this tutorial, I’ll use status.net as an example. It is a PHP app with MySQL backend. My tutorial should be quite generic though, so you can clone from my appliance and modify it to your liking.

Building XFCE Desktop With SUSE Studio

Although we recently hacked in an automagick recognition and start up of several more window managers (windowmaker, fvwm2…), into Studio, XFCE4 is still missing from the list. The reasons are that it simply doesn’t work out of the box without a few tweaks. However, these are easy to do thanks to Studio and I’ll present a step-by-step tutorial, where we’ll build an openSUSE 11.3 appliance with XFCE4 running. If you are already familiar with how to use Studio, just skip to the summary section at the end for a brief list of steps.

Loading External Plugins in CKEditor

Friend of mine needed help with $SUBJ, to extend CKEditor with some extra functionality without changing the source code in editor’s tree. Here is the solution:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Test</title>
    <meta content="text/html; charset=utf-8" http-equiv="content-type" />
    <script type="text/javascript" src="ckeditor/ckeditor_source.js"></script>
  </head>
 
  <body>
    <textarea cols="80" id="editor" name="editor" rows="10"></textarea>
    <script type="text/javascript">
      var editor = CKEDITOR.replace('editor');
      CKEDITOR.plugins.addExternal('myplugin', '/path/to/my/plugin/', 'plugin.js' );
      CKEDITOR.plugins.load('variables',
          function( plugins ) {
            plugins['myplugin'].init(editor);
          });
    </script>
  </body>
</html>

addExternal() (in _source/core/resourcemanager.js:151) only registers a resource, which then needs to be loaded using load() method (_source/core/plugins.js:23). Since it doesn’t automatically call the plugin’s init() function, we have to do it ourselves in the callback and pass it the CKEditor instance as a parameter.

Documentation for addExternal says: “Registers one or more resources to be loaded from an external path instead of the core base path.”. To be loaded actually doesn’t mean it gets loaded via this call.