Set the timezone of a Debian/Ubuntu server from the command-line

Setting the timezone of an Ubuntu (14.04, Trusty) or Debian (7, Wheezy) server from the command-line is simple. Just run dpkg-reconfigure tzdata and follow the on-screen prompts. However, if you are running an unattended installation, you might want to avoid interactive prompts and just gets the job done. To do this, simply run

$ sudo ln -sf /usr/share/zoneinfo/America/Anchorage /etc/localtime

Browse through /usr/share/zoneinfo/ to locate your timezone.

Disable pop-ups for an unattended/non-interactive apt-get install in Ubuntu/Debian

So, here I was writing a script that would automate the installation of a package in Ubuntu 14.04 and all was going swimmingly. Until I ran it. You know how some apt-get installs sometimes involve a technicolor pop-up that asks you for stuff? Well, those pop-ups interrupted my script which didn't proceed further. After much digging, I found that there are a couple of solutions for this:

bash: cannot set terminal process group (3987): Inappropriate ioctl for device bash: no job control in this shell

On a new Ubuntu 14.04 (Trusty) LTS server, I ran into the following:

$ su -c /bin/bash foo
bash: cannot set terminal process group (3987): Inappropriate ioctl for device
bash: no job control in this shell

However, the su procedure worked and I was logged in as user foo.

PHP Warning: Unknown: It is not safe to rely on the system's timezone settings

After upgrading a Debian install to use PHP 5.4, I ran into the following error:

Why OpenAtrium sucks

OpenAtrium is a Drupal "distribution", a pre-packaged Drupal installation which targets a particular niche. I was told to consider it when I went looking for a support ticket package a couple of years ago. That project fell by the wayside but I did have a demo installation on my system and now that I do need to install a ticket management system again, I looked at resurrecting this installation and updating it for some snazzy new features.

Capitalizing words and changing case using regex

Let's assume that we have some sample text like the following:

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Tags: 

Styling the <kbd> tag using CSS

The <kbd> tag is an HTML tag use to indicate keyboard input. Adding the following to your CSS file will provide a rich effect to its display:

(Windows) Gvim: Backspace in insert mode does not delete text

I had an odd issue just now when using Gvim. Usually, backspacing when in insert mode (iwhen running the editor as an administrator.

Running a program as an administrator in Windows (7)

Running a program in "privileged" mode (i.e., as an administrator) is as simple as pressing the START button, finding the program, right-clicking its name, and choosing Run as administrator. (You can similarly also choose to Run as different user, but to get this option, you'll need to press SHIFT before the right click.) This should bring up Windows' pop-up asking you to allow the program to be run as administrator where you click Yes and Robert is your uncle.

Copy/pasting large amounts of text via a PuTTY terminal

While transferring a file to a remote server is pretty easily done using PuTTY's sister program, pscp, sometimes one finds oneself to be too lazy to go through the steps required. Shouldn't it be possible to simply copy and paste the (text) file into a remote editor via PuTTY? It is and it works a peach. However, it does crack the shits every now and then complaining about the length of the clipboard (paste).

Pages

Subscribe to languor.us RSS