2009-03-27

Change default locale in Debian Linux

Change locale in Command line

Commands:
dpkg-reconfigure locales
locale-gen en_US.UTF-8


GNOME

Go to GNOME - System > Administration > Language Support


KDE

Go to KDE - System Settings > Regional & Accessibility > Country/Region & Language


Files
Default locale: /etc/default/locale
Generated locales: /etc/locale.gen
Available locales: /usr/share/i18n/SUPPORTED
/var/lib/locales/supported.d/local

2009-03-26

Build Debian package from source

Prepare build environment:
$ apt-get install debhelper graphviz pkg-config

Download source package:
$ apt-get source packagename
Downloads: a .orig.tar.gz, a .dsc and a .diff.gz.

Auto-build package:
$ apt-get -b source packagename

Build later:
$ cd package_directory
$ dpkg-buildpackage -rfakeroot -uc -b

Install package:
# dpkg -i file.deb

Source: Apt manual

2009-02-21

Start Konqueror by hotkey in KDE4

How to start konqueror by pressing hotkey combination, e.g. Win+E ?

Start System Settings,
click Advanced tab,
choose Input Actions,
press New Action (button on the bottom toolbar),
in General tab choose Name for your action,
in Action type: Keyboard shortcut -> Command/URL (simple),
in Keyboard Shortcut choose your shortcut, e.g. press Win+E,
in Command/URL Settings type your command (with full path if neccessary), e.g. konqueror,
press Apply (right bottom corner).

If the above description does not apply to you (e.g. KDE 4.2.2), try:
System settings
Input actions
Right click On the left panel
select menu Hotkey settings
select New Global Shortcut
then Command / URL
name your shortcut and press Enter
click Shortcut: None button (right bottom bar)
press your shortcut, i.e. Win+E
click on Command / URL dialog
paste command, i.e. konqueror

Test your shortcut, e.g. press Win+E

PHP per virtual host settings

While I decided to install Joomla CMS, I was facing following problem.
I want to configure directives for PHP on Apache per VirtualHost.
So how to do PHP + Apache + Joomla per virtual host settings?
In particular VirtualHost use the following directives.

Settings in httpd.conf:
<Directory /www/joomla/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
</Directory>

<IfModule mod_php5.c>
php_value display_errors Off
php_value safe_mode On
php_value safe_mode_gid On
php_value safe_mode_include_dir /www/joomla/www
</IfModule>

Available PHP directives:
php_value, php_flag, php_admin_value, and php_admin_flag
PHPRC variable per-virtual-host

.htaccess settings for php.ini:
SetEnv PHPRC /home/user1

Resources:
php.net - config changes
php.net - php.ini - php.ini

2009-01-29

Vim - basics - copy-paste

Useful shortcuts for Vim beginners: 

mark text 
v ... start highlighting text 
+y ... end highlighting text 

d ... cut 
P ... P-paste above cursor (capital P)
p ... paste below 

u ... undo 
Ctrl+R ... redo 
source: source web 
other: other web 
Vim macro for copy-paste with Ctrl+C and Ctrl+W: abclinuxu.cz (Czech version)

VI shourtcuts:

Go to
Shift g    = end of file
gg    = start beginning of file
GG    = start of file
:22    = go to line 22
0 = start of line
^ = first letter on line
$ = end of line

Delete 
x = delete
X = backspace
dw = delete word
d$ = delete to EOL $
d0 = delete to start 0

Copy to buffer
:t.    = duplicate line
:t7 = copy line after line 7

yy = copy current line
ayy = copy current line to buffer a
a5yy = copy 5 lines into buffer a

Paste from buffer
y7yp = copy and paste 7 lines
p = paste line
ap = paste buffer a at the cursor


Search
n = search next
N = search previous
* = go to next occurrence of word under cursor
# = go to previous occurence

Less shortcuts

NoHup
# Nohup process id pid :
nohup my_command > my.log 2>&1 &
echo $! > save_pid.txt

2009-01-12

No sound in Flash under Linux

Problem description:
Using Debian or Ubuntu Linux, I experienced problem with no sound
using Flash player in Firefox.

Solution:
# apt-get install alsa-oss

Details:
alsa-oss package creates interface between Alsa sound libraries and OSS libraries. Latest systems usually support Alsa drivers while Flash requires OSS. This package interconnects both of them to play together.

2009-01-11

Firefox default browser in Linux

How to set Firefox as default browser for Thunderbird and other applications in Debian or Ubuntu Linux?


System wide default
Define Firefox as system wide default web browser by running:
update-alternatives --config x-www-browser


KDE4 default
To use Firefox as default in the KDE4, you must open:
Desktop Settings / Personalised Settings -> Default Applications -> Web Browser ->

or in latest KDE open:
System Settings / Default Applications -> Web Browser ->

check: 'in the following browser'
set value: /usr/bin/firefox


Thunderbird default
In Thunderbird open menu:
Edit / Preferences / Advanced / General / Config Editor

Change Filter to:
network.protocol-handler.app.

Add or modify existing preferences. Double click specific preference for modification or,
if preference is not in list, right click to empty area and choose: New -> String

Insert key name: network.protocol-handler.app.ftp
Value: /etc/alternatives/x-www-browser

Insert key name: network.protocol-handler.app.http
Value: /etc/alternatives/x-www-browser

Insert key name: network.protocol-handler.app.https
Value: /etc/alternatives/x-www-browser


Edit Thunderbird config directly
Optionaly you can edit your Thunderbird config directly.
Thunderbird preferences file: ~/.thunderbird/*.default/prefs.js


Note
If you have not selected your default browser, you can replace string /etc/alternatives/x-www-browser by /usr/bin/firefox (with appropriate path)

Keywords: thunderbird url open
Source: novell.com