Μηνιαία αρχεία: Σεπτέμβριος 2011


OpenSuse: Sudo Error: Cannot Connect to X Server 3

When you call a command like this:

sudo someCommand

and you get an error message saying Cannot Connect to X Server, while if you executed that command without the sudo it would execute properly, you can resolve this issue by replacing “sudo” with “xgd-su -u root -c” resulting the following command:

xgd-su -u root -c someCommand

xdg-su provides a graphical dialog that prompts the user for a password to run a command as another user.


Include more filetypes to a WordPress Installation Media Library

In the folder <Installation Path>/wp-includes/ there is a file called functions.php, inside this file there is a function called get_allowed_mime_types().
This function is in charge of defining an Array of mime types keyed by the file extension with a regex corresponding to those types.

So in order to add a new file-type to the white-list you just have to add a new line with the following format in the list:

'jpg|jpeg|jpe' => 'image/jpeg',

Where, on the left you define the extensions you want to be accepted separated by the vertical bar character (“|”) and on the right you give a file definition.