My Articles

Drupal 7 public and private files

Drupal 7 supports public and private download/upload method (if system paths set under Media configuration section) - by default Public download method is supported only.

Download methods

Public download method - files are stored within Drupal web directory set via public file system path (default in "sites/default/files"). Any file stored here can be downloaded using direct URL for example www.example.com/sites/default/files/test.txt

Category: 

Drush on Ubuntu 13.10

I have upgraded my Ubuntu system to latest one that is Ubuntu 13.10 (at the time of writing this).

I run on my machine Apache, PHP and MySQL as well as Drupal and drush. After upgrade to Ubuntu 13.10 I noticed that drush command doesn't work anymore - it did show following error:

PHP Fatal error:  Call to undefined function json_encode() in /usr/share/php/drush/includes/output.inc on line 390

Reason for above error is that PHP json extension is not installed by default of Ubuntu 13.10. Please run this command: php -m | grep json to see that you do not have it.

To fix this problem I needed to install php-json extension: sudo apt-get php5-json

Now drush is working again and PHP json extension is available on my machine: php -m | grep json

That was quick fix once you know it. I hope you would find it helpful.

Vundle - vim plugin to manage vim plugins

I work with Drupal content management framework and sometime ago I started using vim as my main text editor. Out of the box vim does fantastic job but we can customise it by installing vim plugins.

As you may know there is a project called vimrc on the Drupal website that provides detailed instruction how to make vim to support Drupal development. I wrote two articles about vimrc: first one provides summary of steps required to instal vimrc, second one provides overview of all components that vimrc is made of.

I used drush to instal vimrc files but I have discovered since that different method that makes use of Vundle - using Vundle is easy please check for instructions on the GitHub  project's page.

Category: 

Removing Linux kernel files manually

In this article I am writing about removing Linux kernel files manually from your system. I am explaining this on Ubuntu distribution.

As we know we should use apt-get autoremove it we want to remove not needed packages e.g. old kernel files. In my situation for some reason this did not work (I was trying to find out why but not much luck). I had to deal with that as my /boot partition was full and new kernel file was available to instal - installation failed as there was not enough space on /boot partition. Below I provide steps I use to remove old kernel files manually.

Category: 

Drupal developing module?

I am not going to write tutorial how and what you need to do in order to write module. If you want to learn this I am sorry but you are in a wrong place. Instead this is about the process that people who use Drupal should be using when thinking about developing new module. I was inspired but the article when should I create a new drupal module - it is very short and you may want to read it in full.Most of people who use Drupal to run websites they go through the same or similar steps when it comes to find module to provide new option. Please check diagram Drupal module decision and I bet you will find it very familiar with what you do or almost exactly what you do already - at least it describes the steps I usually take. I am glad that I came across this article and diagram - finally someone created proper flowchart that I will be using and sharing if neede. Good work.

Category: 

UbuntuOne from command line u1sdtool

Recently I inherited laptop and most of the things I do I do on this laptop. I have a desktop PC that is much more powerful and most of the applications I run on this desktop machine e.g. GIMP, VirtualBox and VMs and more. I do connect to my desktop Ubuntu machine from my laptop (ssh), and run remote applications on my laptop (X11 forwarding). Everything works quite nice. But... I have had some issues to synchronise files (enabled for UbuntuOne synchronisation within ~/home/<user>) from my desktop to UbuntuOne cloud. It works fine when I log in to desktop but not when I do ssh to it. For example I do ssh to my Ubuntu desktop, edit some file (vim test.txt) that is in the folder that is synchronising to UbuntuOne cloud, save changes and ... nothing - new version is not pushed into UbuntuOne server automatically. It is annoying and I could stand it - there are ways to overcome this issue e.g. login into desktop machine but I knew that there is some problem that needs to be tracked and corrected.

After a few hours of searching and trying I found the answer (almost).

Category: 

Create a shared Git repository

I was looking recently at options to set up a simple shared Git repository for one of the web projects I worked on.

My initial requirement was to make this work using local Ubuntu users and groups (I am aware of tools that can manage Git users and groups better but did not have time to investigate this further at that time - I use serevice provided by Bitbucket), and users would be able to push and pull over SSH (that was running on the machine already) between theirs local development repository and remote main repository.

Below I give steps for two scenarios that can be used to create Git shared repository for a project. I tested both and they worked for me well.

Create new empty shared Git repository

Steps cover:

Cluster administration tool

I recently had to make the same change on multiple web servers - all configured in the same way and running Ubuntu. My work colleague suggested me to use tool called ClusterSSH. According to documentation: "This tool is intended for (but not limited to) cluster administration where the same configuration or commands must be run on each node within the cluster.  Performing these commands all at once via this tool ensures all nodes are kept in sync.".

I provide below steps how to install and configure this tool on Ubuntu 12.04LTS desktop.

Installing ClusterSSH:

  1. sudo apt-get update
  2. sudo apt-get install clustershh

Basic use of ClusterSSH:

Pages