Setup Python Virtualenv

Using virtualenv with the different versions of python:

This works with Debian (and it's children (Ubuntu)) and MacOS.

ArchLinux has adopted Python 3 as the default so python = Python 3.

Read more…

Terminator KeyBindings

There are a number of terminals out there for Linux.

I use Terminator.

The following keybindings can be used to control Terminator:

Read more…

Set Presentation Mode from the command line

First, check to make sure xset is available. If so:

To set the screen in presentation mode:

xset -dpms; xset s off

To return it to normal:

xset +dpms; xset s on

Tar Commands

Unless you use it on a daily basis, you probably forget what the standard commands are to create or extract tar files.

This is a short tutorial to create or extract tar files.

Read more…

Install DrupalPro Desktop in VirtualBox

Screencast: Install the DrupalPro Development Desktop in VirtualBox.

Symbolic Linking

Command:

ln -s /original/file /new/link

This will create a link between the two files (or directories). Whatever you do: add, change or delete in one will happen in the other.

So, if you had a website in a dev directory in your home directory ie ~/dev/websites/mynewwebsite and Apache is installed and you want to view it through a brower. And you don't want to create a virtual host file and put an entry in the /etc/hosts file.

  1. The default "webroot" is at /var/www (check the documentation)

  2. You will need to do this as root (su - and enter password or prepend sudo to this command because the directory /var/www is owned by root):

    ln -s ~/dev/websites/mynewwebsite /var/www/mynewwebsite
    

You can now access the website through http://localhost/mynewwebsite

Installing Fossil SCM on a server

This will install Fossil and set it up using cgi-bin to serve multiple repositories.

This installation is on a Ubuntu server. The instructions should also work for Debian.

These instructions are dependent upon Apache 2 is already installed on the server.

Read more…

Command line prompt doesn't work on MacOS

If you are working in a terminal application on a Mac and it just doesn't seem to work correctly, try this:

Read more…

Git tab completion and prompt change

Git has a number of commands that you use on a regular basis and after a short while you remember them or you create aliases for them in the .bashrc or .bash_alias file and you remember them. Or maybe you don't.

Included in the source code for Git is a bash script called git-completion.bash.

I use this script for 2 things:1) to get tab completion of Git commands (hence the name) but it also provides a way to change the prompt and show that you are in a directory that has a Git repository in it and also what the current branch is.

We will do this in 2 steps. First the tab completion and then modifying the prompt.

Read more…

Clean up Git after Drupal module update

If you upgrade a Drupal module using Drush, you get may get new files and/or some files will be modified. It may also delete files that are no longer needed.

Read more…