You are on page 1of 14

Linux operating system related tips

1) Adding a new locale (eg. Arabic).


2) Adding a keyboard indicator to the panel (or system tray).
3) Adding more languages to the keyboard indicator to enable the keyboard to produce the
alphabet of other languages (eg. Arabic).
4) Linux & Windows talking and understanding each other.
5) Showing hidden folders (directories).
6) Sound level adjustments .
7) Building playlists in kmplayer.
8) Setting up printers.
9) Starting database programs: MySQL, Firebird & Postgres (psql).
10) Building a playlist manually that later can be opened (loaded and played) by Totem, kmplayer
or RealPlayer.

Adding an new locale:


1) Open the Synaptic Package Manager
2) Click Settings in the main menu, then choose Repositories, then make only 1 repository active
(eg. http://pclosusers.com/pclosfiles/) and click OK
3) Click Reload, then Mark All Upgrades and finally Apply
4) Click Addlocale and follow the prompts
5) After this process is over, logout and login, the locale will change to the new one including
user ID and password will be in the new language (eg. Arabic)

Adding a keyboard indicator (even for 1 language):


1) Click Configure Desktop icon
2) Click Hardware, then Input Devices
3) Click Keyboard, choose the Layout tab
4) Mark (by clicking) the Show for single layout radio button, then click Apply

Adding more languages to the keyboard indicator:


PCLOS
1) Open Synaptic Package Manager, download and install the package pertinent to the language
you want to add, in our example here the Arabic language package will be downloaded and
installed. Choose kde4-10n-ar package.
2) Click Configure Desktop icon. Choose Common Appearance, then pick Locale, choose
Country/Region & Language
3) In the Locale tab, click Add Language, choose Arabic and click Apply
4) Now, click Hardware, then Input Devices, followed by Keyboard, then choose the Layouts tab
5) Click the configure Layouts radio button, the push button with the label Add Layout will
become active, click it and in the pop-up window, click the arrow in yhe layouts field and
choose Arabic, then click OK and Apply
6) From the Layout indicator on the panel you can choose between english and arabic language for
the keys (of the keyboard) to type

MEPIS
1) Click System Settings icon
2) Click Regional & Language
3) Click Keyboard Layout, choose the layout you want (eg. Arabic) and then click the arrow to add
to the list of active layouts
4) If you want to add lets say Arabic language to the Country/Region & Language, open Synaptic
Package Manager, download and install the package pertinent to the language you want to add,
in our example here the Arabic language package will be downloaded and installed (the kde4-
10n-ar package)
5) Click System Settings icon, then click Regional & Language, click the push button with Add
Language label and choose Artabic, then click Apply and you are done.
Linux & Windows talking & understanding each other (on a LAN):
Before getting 2 machines one having Linux OS and the other Windows on a LAN, lets first show how
Windows XP and 7 can see each other using a crossover Ethernet cable.
1) A unique workgroup name (we shall use WORKGROUP here) has to be set all machines on the
network (whether running Windows or Linux):
1-1) Windows XP: Click Start, then right click My Computer, select Properties, change
workgroup name. To WORKGROUP
1-2) Windows 7: Click Start, then right click Computer select properties, change settings and
assign the workgroup name.
2) In order to make the machines discoverable (seen by other machines on the network), the
security settings have to be adjusted accordingly
2-1) Windows 7: when you click Networks, a pop up frame will appear, when you click you
will get a drop down menu, choose Turn on network discovery, then click Make Network
Private.
2-2) Windows XP: open Control Panel, choose the Security Center icon, then click Window
Firewall, click the Exception tab, then mark File and folder sharing radio button, then OK and
you are done.
3) Now, in order to share files, you would have to do the following:
3-1) Windows XP: for example, right click Shared Documents, then choose Properties, click
Sharing tab, in the Network sharing and security sub-section click Network Wizard for the firsst
time, otherwise click Share this folder on the network.
3-2) Windows 7: right click the folder, select Properties then the Sharing tab and click Share. To
change the setting go to Network & Sharing center.

Windows 7 and PCLOS


1) Setting samba on PCLOS:
1-1) Click Configure your computer
1-2) Choose Network & Internet, tthen click Hosts definition, click 17..0.0.1, then modify,
change the host name to something acceptable (eg. Mike, pclos1,..) and click OK.
1-3) Now click Network Sharing, choose Share drives & directories with Windows, from the
menu, click Samba Server then choose configure, then click Standalone and OK. Click the
SAMBA Users tab, click Add and enter the user(s) id(s) and password(s0 for those allowed to
access these remote directories from the machine having the Windows 7 OS.
1-4) Now, click Local Disks. Then Share your Hard Disk Partitions and Allow all users.
1-5) From the Control Center or you can exit and from the Network Center (clicking the icon in
the system tray), you set the wired Ethernet network interface (IP address,...). Here, we shall
continue from within the Control Center and later when we set up the network interface in
Mepis we shall use the Network Center icon. Click Internet & Network, click Set up a new
network interface, click Wired (Ethernet), then Next, select the Network interface to configure,
then click Next, Select the communication protocol (in this case Manual) then hit Next, enter
the IP address ()192.168.1.1), the Netmask is entered automatically (if not it is 255.255.255.0)
then the gateway (connection to the Internet) address (eg. 192.168.1.1) and the host name, hit
Next, in this screen select the connection control methods you like (eg. Allow users to mange
connection, start at boot,..),click Next answer the question whether you want the connection to
start now and hit Next and thats it.
2) Setting the Ethernet (wired) interface on the machine with Windows 7 operating systems:
2-1) click Networks, then choose Network & Sharing Center, click Change Adapter Settings,
right-click the pertinent connection (Local Area Connection, wired LAN), then from the pop-up
menu choose Properties, pick the Internet Protocol Version 4 TCP/IPv4 & click properties, from
the window that will appear, click the Alternate Configuration, click User configured and enter
the required data (in our example: IP address: 192.168.1.2, Subnet mask: 255.255.255.0,
Default gateway: 192.168.1.1) then click OK.

Windows 7 & MEPIS


1) Windows 7: As above
2) MEPIS: click the Network Control (center) icon in the system tray, from the pop-up menu, click
Manage connections, click Wired tab, then click Add, from the screen you will get, first choose
the Ethernet tab and choose the networking interface you want to configure (in our case the
wired Ethernet eg. Eth0), then click the IP address tab and enter the required data (in our
example, they are 192.168.1.1, 255.255.255.0 and 192.168.1.1). Click OK and thats it.

A couple of smb. Conf files (found in /etc/samba directory) the first was tried successfully on MEPIS
and the second on PCLOS:

The MEPIS one:


;*******************section global*****************
[global]
# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d
printing = cups
workgroup = WORKGROUP
server string = %h server (Samba %v)
hosts allow = 192.168.0. 192.168.1. 192.168.2. 192.168.79. 127. 10.0.0. 10.1.1.
socket options = IPTOS_LOWDELAY TCP_NODELAY
log level = 1
dead time = 15
wins support = yes
hide unreadable = yes
passdb backend = tdbsam
dns proxy = no
host msdfs = no
max log size = 1000
security = user
map to guest = Bad Password
restrict anonymous = no
domain master = no
preferred master = no
max protocol = NT
ldap ssl = No
server signing = Auto
oplocks = No
level2 oplocks = No
;*******************section user*****************
[Shared]
path = /home/kheirha/Shared
guest ok = yes
read only = no
[Music]
path = /home/kheirha/Music
guest ok = yes
read only = no
;*******************section homes*****************
[homes]
comment = Home Directories
browseable = no
guest ok = no
read only = no
;*******************section printers*****************
[printers]
comment = All Printers
path = /tmp
browseable = no
printable = yes
guest ok = yes
create mode = 0700

The PCLOS one:


[global]
workgroup = WORKGROUP
;netbios name = MYNAME
security = user
null passwords = true
username map = /etc/samba/smbusers
hostname lookups = yes
hosts equiv = /etc/hosts
hosts allow = All
;hosts deny = All
interfaces = lo eth0
bind interfaces only = yes
guest ok = yes
printing = CUPS
printcap name = CUPS

[printers]
comment = All Printers
browseable = no
printable = yes
writable = no
public = yes
guest ok = yes
path = /var/spool/samba
printer admin = root

[DEFAULT PRINTER]
comment = PRINTERNAME
printable = yes
path = /var/spool/samba
public = yes
guest ok = yes
printer admin = root

[PUBLIC]
path = /HOME/PUBLIC
browseable = yes
read only = no
guest ok = yes
public = yes
create mode = 766

[home_directories]
path = /home/%U
read only = no
valid users = %U root

Showing hidden folders:


Linux (eg. MEPIS or PCLOS):
1) Open the file manager (eg. Dolphin)
2) From the menu, click View, then choose Show hidden files
3) the same process is used to hide the originally hidden files

Windows XP:
1) Open Explorer (Windows)
2) From the menu, click Tools and choose Folder options
3) In the opened window, choose the View tab
4) Click the radio button Hidden files & folders

Sound adjustment in Linux (eg. MEPIS & PCLOS):


1) Right click the volume icon found in the system tray
2) Click Select Master Channel, click speaker and then OK
3) Click the volume button and adjust the volume (using the virtual knob)
4) Click the volume icon, then click Mixer
5) Raise the virtual knob of the PCM to the maximum or close and you are set, enjoy listening

Building playlists in KMPlayer:


1) To add one favourite video file at a time. Click the file under the Most Recent category and drag
it to the Prisistant Playlists, you will have the option to add it to Add to List or Add in New
Group. When you choose the first file in a group all the records in the group will be played one
after the other.
2) In order to add a list of files one shot to the playlist or to a group, you have to access the file
playlist.xml and open it in a text editor (eg. gedit). This file is found in Home > .kde4 > share >
apps > kmplayer. All files the starts with a dot (.) are hidden, show you should use the steps
given above section “Showing hidden folders” to get them visible.
3) You can copy the files you want to include in a list and paste them in the playlist.xml file and
make similar modification as shown below then save the file and run kmplayer:

For MEPIS, the file could be something similar to the following (having the files on a flash memory
USB in folder named yyy):
<playlist>
<group title="group1">
<item url="file:///mnt/sdb1/yyy/file1.wmv"/>
<item url="file:///mnt/sdb1/yyy/file2.wmv"/>
<item url="file:///mnt/sdb1/yyy/file3.wmv"/>
<item url="file:///mnt/sdb1/yyy/file5.wmv"/>
<item url="file:///mnt/sdb1/yyy/file6.mpg"/>
<item url="file:///mnt/sdb1/yyy/file7.mpg"/>
<item url="file:///mnt/sdb1/yyy/file8.mpg"/>
<item url="file:///mnt/sdb1/yyy/file9.mpg"/>
<item url="file:///mnt/sdb1/yyy/file10.mpg"/>
<item url="file:///mnt/sdb1/yyy/file11.wmv"/>
</group>
</playlist>

For PCLOS, the file could be something similar to the following (having the files on a flash memory
USB in folder named yyy):
<playlist>
<item url="/media/KINGSTON/yyyy/file15.mpg"/>
<group title="group1">
<item url="/media/KINGSTON/yyy/file1.wmv"/>
<item url="/media/KINGSTON/yyy/file2.wmv"/>
<item url="/media/KINGSTON/yyy/file3.wmv"/>
<item url="/media/KINGSTON/yyy/file4.wmv"/>
<item url="/media/KINGSTON/yyy/file5.mpg"/>
<item url="/media/KINGSTON/yyy/file6.mpg"/>
<item url="/media/KINGSTON/yyy/file7.mpg"/>
</group>
</playlist>

Installing & setting up printers:


There are 4 methods that any one of them may be used to install and setup printers in Linux. Hese
methods are: HP Printer Management Application (used mainly to install & setup HP machines),
CUPS (in any web browser, Firefox, Opera, Seamonkey,......etc, type http://localhost:631/admin),
using System Settings or Configure Computer and finally downloading the appropriate driver and
installing it (using software management package eg. Synaptic or the terminal).
A) HP Printer Management Application (this process used on PCLOS to install HP Deskjet D1663):
1) Click Start (PC) button, then choose HP Printe33r Management Application, then select Setup
Device (rather than CUPS web interface)
2) From the screen with the title HP Device Manager, Device Discovery, select the appropriate
radio button (in our example, Universal Serial Bus – USB), click Next
3) Select your printer from the list shown in Select From Discovered Devices (in our case, HP
Deskjet d1600 series), click Next
4) In the Setup Screen, accept the Printer name (or change it, its up to you), add Description &
Location (if so you desire), accept the PPD file and click Add Printer push-button

B) CUPS web interface:


1) Open any web browser and type in the location bar the following: http://localhost:631/admin
and enter or click the arrow in the location bar
2) Click Find (or Add) Printer push-button, click on the local printer (radio button) attached to
your netbook (or laptop), through the USB (in our case), click continue
3) Accept the name & description (or change them), add the location and click continue
4) In the ADD printer page select the model (eg. HPDeskjet d1600 series, hpcups 3.10.9), click
Add Printer
5) Leave the default options as is or change according to your likings, click Set Default Options

C) Using Configure your Computer option:


1) Click Configure your Computer icon, choose Hardware, then click Set up the Printers
2) In the new printer found window, make sure it is the correct one attached to the USB of your
machine and click OK and you are done.

Starting database programs: MySQL, Firebird & Postgres (psql):


After you have installed any or all of these database software packages under Linux, now you want to
start using them, you will find hereafter the starting steps to get going.
A) MySQL:
1) Open the terminal (konsole), then log in as the superuser (eg. typing su and entering your
password when prompted to do so)
2) Type the following on the command line: /etc/init.d/mysqld start
you get the following output:
Starting MySQL: ., [ OK ]
Now, type mysql and you are in

B) Firebird:
1) Open the terminal (konsole), then log in as the superuser (eg. typing su and entering your
password when prompted to do so)
2) type gsec, when you get the prompt inside Firebird, type display to get a list of users.
3) Type help and you will get a list of acceptable commands for example adding a user with a
name and password plus other options, ….etc

C) Postgres:
1) Open the terminal (konsole), then log in as the superuser (eg. typing su and entering your
password when prompted to do so)
2) Type in su – postgres (respecting the spaces given)
3) type psql, now you are in the database, type help and you will get the essential help commands:
Type: \copyright for distribution terms
\h for help with SQL commands
\? for help with psql commands
\g or terminate with semicolon to execute query
\q to quit
4) Under certain circumstances you migt have to type 1 of the following lines before step 3 above:
(this line starts the server)
postgres -D /var/lib/pgsql/data
or
pg_ctl -D /var/lib/pgsql/data -l logfile start

Building a playlist manually that later can be opened (loaded and played) by Totem, kmplayer or
RealPlayer:
1) Open a text editor blank document (eg. gedit, kwrite, or any other one).
2) Enter all the media files (videos) as shown in the example below:
[playlist]
NumberOfEntries=4
File1=movie1
File2=movie2
File3=movie3
File4=movie4
3) Save this file in the folder where the movie files are stored in,.and give it the name playlist.pls.
4) Later on, you can right-click the playlist and choose the program to open the play list with

ooo base – a database program that runs under Linux and can import structure (schema) and
data from Access (.mdb file extension) through gmdb2 0.6pre1 (GNOME MDB Viewer is a
graphical interface to MDB Tools. It lets you view and export data and schema from MDB files
produced by MS Access 97/2000/XP/2003)

Fig. 1
Fig. 2
Fig. 3

The first example, here, will cover the process to import a .mdb (Access database) into openoffice org
base program. Though, to achieve this objective, you have to download and install MDB tools and
GNOME MDB Viewer which is a graphical interface to MDB Tools. It lets you view and export data
and schema (structure) from MDB files (tables) produced by MS Access 97/2000/XP/200. You may use
the software package manager (eg. Synaptic) to search, download and install the above mentioned
packages. Having done that here is the procedure:
1) Open the terminal (konsole). Type in gmdb2, the progam will open, choose from the menu File,
click it and choose Open or click the Open icon, choose the database with the .mdb extension
that you would like to export its table (as text). Fig. 1 above.
2) Highlight the table you want to see its data, definition or to Export. Now, click Export, you will
get the window shown in fig.2 above. Click Browse and move to the folder where you want to
save the exported file to (eg. dicthk.txt).and click OK, then Export. Gmdb2 didd its job.
3) Now close the database and exit mdb2. Open openoffice org base program. The database
Wizard will open, Check Select Database, click Connect to an existing database (radio button),
choose Text from the pull-down list, then click Next. Fig. 4 below.
4) Now you are at Set up connection to text files, click browse and find the folder to which you
had saved the exported tables using gmdb2 in point (2) above (select the path to the Text files),
Fig. 5 below. Click Finish, then save the new database with the already saved text tables
(structure & data) under a name of your choice and the extension .ODF will be added
automatically, click Save.
5) Openoffice.org base database program will be opened with whatever tables you already save
using gmdb2, fig. 6 below.
6) Now you can add new tables, construct queries based on any table in the database file, build
screens (forms) to access the data in the tables (adding, modifying, deleting), prepare reports,
write procedures, ...etc.
Fig. 4
Fig. 5

Fig. 6
7) In base, when you want to build a screen (form), you may use any of these 2 ways: Create
Form in Design View or Use Wizard to Create Form. In our example here we shall use the
former method. Click forms to the left of you screen, the choose Create Form in Design View,
the form design window will open. From the tool bar (that has the controls) find the Label
co9ntrol and insert/size it on the form. Then either click the Form icon in the tool bar to the left
or right click the Label (control) and choose from the pop-up menu the Control item, click the
General tab and enter the name of the form, then click the Data tab and in the Content Type
field Query (you have the option to choose between Table, Query, SQL command) and the
query name or t able in the content field. Now dd the text Boxes to which the query or table
fields will be displayed.
8) If you want to change the format of the text displayed in the label control, then right-click the
label and choose Control from the pop-up menu, then in the General tab go to font and click the
square next to this field and proceed from there. If you want to make changes a form that you
have already created, right click it and choose Edit.
9) You can create Queries in one of 3 available options, namely, Create Query in Design View,
Use Wizard to create Query and Create Query in SQL View. In our explanation here we shall
use the first method.
10) Click Create Query in Design View, you will get a popp-up window listing all tables,
choose the table on which you want to run the query on, choose the table and click Add. Go to
the table below starting with the field, click the arrow and choose the field name from the table
you had chosen, then confirm the table having the field, then set the sort sequence (none,
ascending, descending) then save you query and you are done. You may now create a screen
(form) to display the query in it following the process given in (7) above.

Here is an example file including screens (forms), queries and imported table using the above
procedure: dicttech.odb file
Shown below are the macros used (using openoffice basic language), you will find them under Tools-->
Organize Macros-->OpenOffice.org Basic-->dicttech.odb-->Standard-->Module1:

Sub test1

oContexto = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oFonte = oContexto.getRegisteredObject("dicttech")
oForms = oFonte.DatabaseDocument.FormDocuments
oAConnection = oFonte.getConnection("","")

Dim pProp(1) As New com.sun.star.beans.PropertyValue


pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"

oForm = oForms.loadComponentFromURL("tech_dict", "_blank", 0, pProp())

End Sub

Sub test2

oContexto = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oFonte = oContexto.getRegisteredObject("dicttech")
oForms = oFonte.DatabaseDocument.FormDocuments
oAConnection = oFonte.getConnection("","")

Dim pProp(1) As New com.sun.star.beans.PropertyValue


pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"

oForm = oForms.loadComponentFromURL("en_fr_f", "_blank", 0, pProp())

End Sub

Sub test3

oContexto = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oFonte = oContexto.getRegisteredObject("dicttech")
oForms = oFonte.DatabaseDocument.FormDocuments
oAConnection = oFonte.getConnection("","")

Dim pProp(1) As New com.sun.star.beans.PropertyValue


pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"

oForm = oForms.loadComponentFromURL("fr_en_f", "_blank", 0, pProp())

End Sub

Sub test4

oContexto = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oFonte = oContexto.getRegisteredObject("dicttech")
oForms = oFonte.DatabaseDocument.FormDocuments
oAConnection = oFonte.getConnection("","")

Dim pProp(1) As New com.sun.star.beans.PropertyValue


pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"

oForm = oForms.loadComponentFromURL("en_sp_f", "_blank", 0, pProp())

End Sub

Sub test5
oContexto = CreateUnoService("com.sun.star.sdb.DatabaseContext")
oFonte = oContexto.getRegisteredObject("dicttech")
oForms = oFonte.DatabaseDocument.FormDocuments
oAConnection = oFonte.getConnection("","")

Dim pProp(1) As New com.sun.star.beans.PropertyValue


pProp(0).Name = "ActiveConnection"
pProp(0).Value = oAConnection
pProp(1).Name = "OpenMode"
pProp(1).Value = "open"

oForm = oForms.loadComponentFromURL("sp_en_f", "_blank", 0, pProp())

End Sub

kexi – a database that runs under Linux and can import structure and data from Access (.mdb
file extension)

1) After installing kexi, open the database software.


2) When you open the software you will have to make a few choices, the first is the tab, whether
creating a new project or opening an existing one, if you choose the former then the second
would be whether you want to create a blank database, create from template or import a
database.
3) In our case we shall be importing a database (with .mdb extension), click import a database,
then click OK. You will be taken to the wizard screens (windows), when you click Next you
will have to select projects stored in a file or on a database server, then choose the file you want
to import. Click Next.
4) Then you will be asked whether you want to store (destination) the database to a file or on a
server, in our case will be the former. Click Next
5) now you have to enter a name of the database being imported. Now select the location (folder)
where the database file is going to be stored (saved), click Next.
6) You will be prompted to choose between whether to import the structure and data or structure
only, in our case the choice would be the former, then click Next. Follow the last 2 windows
which are self-explanatory.
7) Now in the opened database, you can add the screens (forms), select fields and data
sources,..etc.
8) Move the cursor over Create tab and click Forms, in the Property Editor, choose the Data
Source tab, choose the Form's Data Source from the tables or Queries available in the opened
database.
9) Move to the Form Design area, move the cursor over Form Design and start adding the controls
(labels, text boxes, button check box,..etc.), in our example her,e we shall click a text box and
move to the form and insert/size the text box. Now, move to the Property Editor, click Data
Source, confirm the Form's Data Source and choose the Widget's Data Source (widget is the
text box and the data source is the field in the table that will feed this text box).
10) Now to have a main screen to call from which other screens and queries, click Create tab,
select Form, then click the Button control (after moving the cursor to the Form Design tab).
Then you may press the right button of the mouse and choose Assign Action or click the Assign
Action (having lightning symbol) button at the top of the screen.
An example dicttech.kexi.tar.gz

You might also like