Blog

How to view the current locale setting

# locale
LANG=en_US
LC_CTYPE= "en_US"
LC_NUMERIC= "en_US"
LC_TIME= "en_US"
LC_COLLATE= "en_US"
LC_MONETARY= "en_US"
LC_MESSAGES= "en_US"
LC_ALL=en_US

How to change the locale setting

To change the current locale setting, first confirm that the desired locale is
installed on the system with:

Read more

There is a simple and easy way to make sure the speaker of your pc will stop beeping everytime you issue a wrong command.
Try

sudo lsmod | grep pcspkr

If you can see

pcspkr

Turn it off

Read more

For some reason Postfix sometimes get stuck.
To see if there are some email stuck in the queue you can simply type:

oktober# mailq
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
38A1BF3B1* 1152 Thu Feb 12 00:22:39 www-data@oktober.momeunier.fr
momeunier@gmail.com

-- 1 Kbytes in 1 Request.

Fortunately there is a little binary called postqueue that can help.

Read more

Ubuntu usually comes out of the box with a pretty good set of security features. However there are some really great tools out there that can help to save some hassle…

Read more

Thickbox is this great Javascript framework that helps you showing pictures or having a iframe clearly visible on your website.

For example it can be used to create a disclaimer to be displayed when entering a website.

In order to redirect your visitor to an external website if he doesn’t comply with the disclaimer requirement, or to just give access to your website, you need to close the thickbox.

Easy:

Read more

A simple function to create a random string.

<?
function generateString ($length = 8)
{
  $string = "";
  $possible = "0123456789bcdfghjkmnpqrstvwxyz";
  $i = 0;
  while ($i < $length) {
    $char = substr($possible, mt_rand(0, strlen($possible)-1), 1);
    $string .= $char;

Read more

Looks like many people are having problem with the function imagerotate from the gd library on php.
It also looks like the php guys have made a fork of the gd library and included a heavily customised version of it in php. Our problem is, the Ubuntu guys decided to get rid of that imagerotate and some others for security reasons. Fair enough, but how do I make it work now??

Here is how I do it on my server.

Read more

97/97