Installing DokuWiki

Swobodin's picture
Submitted by Swobodin on Wed, 2006-06-14 12:34. ::
DokuWiki is a free Wiki platfrom written in PHP. It does not use any kind of database, just text files.
Dokuwiki is a powerful tool to make online projects collaboration, secure, valid XHTML and CSS, multi-user, multi-template and can be enhanced by plug-in's. It also has a nice design combined AJAX.
The installation of DokuWiki is not standard. First, make sure that you have userdir mode activated, to install the platform on your local directory. Never do it as root.
Set the following values in your /etc/httpd/httpd.conf
LoadModule userdir_module modules/mod_userdir.so


    UserDir "public_html"

    #Default was:

    #UserDir Disable

As root, set the following permissions
chgrp apache /home/swobodin
chmod 750 /home/swobodin
Activate Apache
/etc/rc.d/init.d/httpd start

Now, login as a normal user; you don't need root privileges amymore.
cd ~
mkdir public_html
chmod o+x public_html
ln -s public_html www
mkdir www/Lab
echo "" > ~/www/Lab/test.php

Point the your browser at the URL to check whether your configuration works
http://127.0.0.1/~swobodin/Lab/test.php
Should be okay.
Next, download the latest DokuWiki version from the official site and uncompress it.
tar xvfz dokuwiki-YYYY-MM-DD.tgz -C ~/www/Lab
cd ~/www/Lab
mv dokuwiki-* dokuwiki
cd dokuwiki

Create an empty log file
cat /dev/null > data/changes.log
Allow user authentication
cd conf
cp -v acl.auth.php.dist acl.auth.php
cp -v users.auth.php.dist users.auth.php
chmod 666 acl.auth.php users.auth.php

Edit doku.php setting the following
$conf['useracl'] = 1; // To enable Access Control List
$conf['superuser']   = 'swobodin'; // Who will be the super user? Note: No uppercase!
$conf['autopasswd']  = 0; // To avoid sending password by mail
And set all privileges to data directory and its subdirectories
chmod 777 .
chmod 777 doku.php
chmod 777 -vR ~/www/Lab/dokuwiki/data

Point your browser at http://127.0.0.1/~swobodin/Lab/doku/wiki
You should see a "Login" button at the bottom of the page. Click there, then click on "Register".
If you register and login as the already defined superuser, you should see a button "Admin" at the bottom.
That's all, edit your settings and start playing with the platform, adding plugins/templates, hacking on the code so that it fits with your needs.

Linux's Source Code

lion's picture
Submitted by lion on Thu, 2006-06-08 18:12. :: Administration Fedora System

Hi,did someone knows where can i find the source code of redhat linux,
thanx.

Finding out more about Vim

Swobodin's picture
Submitted by Swobodin on Mon, 2006-06-05 10:21. ::
Vim is a text editor that is upwards compatible to Vi.  It can be used to edit all kinds of plain text.  It is especially useful  for  editing programs.
Vim should be installed by default with your Fedora Core distribution, if not, type
yum install vim-inhanced
Start Vim typing vim (and not vi, this will launch vi with minimal features that you won't be able to use here)
Please note, this post does not aim to introduce you to Vim world; if you are new, type
vimtutor
and follow the instructions, they are very instructive and teach you basic use of the editor. In another word, it's very hard to step forward without reading the tutorial and practicing it.
Here is a reminder of the basic operations that you should already have learned:
"To enter insert mode, just type "i"; to save:
:w
"Where is carriage return (just hit Enter)
"To quit and save:
:wq
"To quit without saving
:q!
"To delete a line and move it to the buffer, put the cursor on the line and type
dd
"To paste the line, press "p" it will be added under the cursor; "yy" is for pasting

Advanced deletion

"To delete 2 lines
2dd
"To delete 4 next words
4dw
"To delete from the cursor to the end of line
d$
"To delete from the cursor to the next specified string
d/somestring
"To delete a paragraph (A paragraph is separated by more than one return)
d}
"3 paragraphs
3d}
To just copy, repeat the same operations above replacing 'd' by 'y'

Search'n'Replace

Hit slash (/) to start searching; Vim uses regular expressions very similar to Perl, Awk or Python
For example, the following text
Leonardo da Vinci (1452-1519) of Florentine was known as one of the great masters of the High Renaissance, due to his innovations in both art and science.
If you type
/^.*H.\{3\}
Will highlight from the beginning of the text till the word "High". It uses the following logic:
^ : Beginning of line
.* : Any thing
.\{3\} : 3 characters (which comes after the capital "H")
"To toggle highlighting:
: set hls!
"To set insensitive case
: set ignorecase
"To activate "smart" search mode (Will respect uppercase if specified)
: set smartcase

As for replacing, you use the following syntax

:%s/\(^.*)\)\(.*\)\(F.\{9\}\)\(.*\)\(art\)\(.*\)\(\ s.*$\)/Richard\ M.\ Stallman\2Boston\4Software\6\ Freedom./g

As you may notice, % represents the whole document, if you want to specify lines, type instead
:5,20s
A group is limited by \( and \) and the group content is called by antislash followed by the group number, and /g to specify a global substitution.

Playing with cases

To convert a line to uppercase, place the cursor on the beginning of the line, and type
gU$
The symbol $ means the end of line, if you type "w" instead, it will replace the word you are placing the cursor on; if you type "G", it will replace till the end of document. To convert a specified number of words, type the number before the "w", example: gU4w
gu$
Converts, with the same way, the line to lowercase.

Visual Editing

Place the cursor on a line and type "V", you will switch to Visual mode, when you move the arrow, the text will be selected, without typing "", type yy and what you selected will be copied to buffer. Go to the line you want to paste your text and hit p.

Word Completion

Without having to exit the insert mode, type Ctrl+N at the word you are typing; if the word already exists, it will be completed. If there are many possibilities, you will be proposed the words according to frequency of use, type Ctrl+N again if it's not the right word.

Make everything predefined

For an optimal mode of programming (Syntax highliting, auto-indent, etc.), copy the default vimrc to your personal vimrc
cp -v /usr/share/vim/vim/vimrc_example.vim ~/.vimrc
Run Vim again to see the difference.
vimrc is the file that contains your preferences and instructions. You may for example append the following lines to it (Yes, with Vim too! Changes will be considered after you restart Vim)
set ignorecase
set smartcase

Typing macro's is funny; you don't have to learn Vim symtax, just suppose you are typing the line.
For example:
When you hit F7 key, Perl headers will appear, F9 will generate a C template and with F8, Python headers.
The macro has the following structure:
map keys command
Let's try
map i#!/usr/bin/perl -wuse strict;use warnings;use POSIX;
""""""""""""""""""
map i#include int main(int argc, char *argv[]){return 0;}
""""""""""""""""""
map i#!/usr/bin/pythono## -*- coding: utf-8 -*-

Getting help

Simply type
:h commandname
for example
:h number
You also may try
:h 42
Don't wonder, Vim developers are also humans who want to get fun sometimes!

Sécuriser son CMS - Howto

Submitted by tba on Fri, 2006-06-02 11:24. ::
Pour pouvoir sécuriser mon CMS j'ai procédé comme suit, d'abord, j'ai crée l'arborescence suivante dans /usr/share/ssl
tba.com/

|-- certs/

|-- crl/

|-- index.txt

|-- newcerts/

|-- private/

|-- serial


# mkdir -p /usr/share/ssl/tba.com/{certs,crl,newcerts,private}
# touch /usr/share/ssl/tba.com/index.txt
# echo "01" > /usr/share/ssl/tba.com/serial

Par la suite il fallait modifier le fichier /usr/share/ssl/openssl.cnf pour qu'il reconnaisse cette arborescence
# cp /usr/share/ssl/openssl.cnf /usr/share/ssl/openssl.old (afin de faire une copie de sauvegarde)
# cd /usr/share/ssl && vi openssl.cnf


[ ca ]


default_ca = tba_com # The default ca section

####################################################################

[tba_com ]

dir = /usr/share/ssl/tba.com # Where everything is kept

certs = $dir/certs # Where the issued certs are kept

crl_dir = $dir/crl # Where the issued crl are kept

database = $dir/index.txt
Il fallait modifier le chemin de l'autorité de certification dans mon cas c'est /usr/share/ssl/tba.com, ensuite faire quelques modification dans la partie [ req_distinguished_name ]
[ req_distinguished_name ]

countryName = Country Name (2 letter code)

countryName_default = TN

countryName_min = 2

countryName_max = 2

stateOrProvinceName = State or Province Name (full name)

stateOrProvinceName_default = Some-State

localityName = Locality Name (eg, city)

localityName_default = La Marsa

0.organizationName = Organization Name (eg, company)

0.organizationName_default = Master E-Services
Afin de spécifier les paramètres par défaut des certificats lors de leurs création.
Par la suite il fallait créer les clés et les certificats de l'autorité de certification.
# cd /usr/share/ssl/tba.com
# openssl req -config /usr/share/ssl/openssl.cnf -x509 -newkey rsa:1024 -days 365 -keyout private/cakey.pem -out cacert.pem

On produit ainsi le certificat et la clé de l'autorité la clé est stockée dans /usr/share/ssl/tba.com/private/cakey.pem et le certificat dans /usr/share/ssl/tba.com/cacert.pem.
Par la suite il faut protéger notre clé privée en n'autorisant l'accès qu'en lecture au root
# chmod -R 600 /usr/share/ssl/tba/tba.com/private
On génère à présent la paire de clés ainsi que la demande de certificats que nous signerons par la suite
# cd /home/tahar/Desktop/Master/Securite/Travaux/SSL
# openssl req -config /usr/share/ssl/openssl.cnf -newkey rsa:1024 -keyout cle-privee.key -out cle-publique.req

Maintenant, on signe la demande de certificat et on produit un certificat signé, pour la signature, il faut entrer le mot de passe de la clé privé qu'on a généré au début
# openssl ca -config /usr/share/ssl/openssl.cnf -in cle-publique.req -out certificat.pem
À présent, nous allons installer et générer des certificats serveur pour Apache, d'abord on créé la clé et la demande de certificat
# openssl req -config /etc/ssl/openssl.cnf -newkey rsa:1024 -keyout libertysoft.homelinux.org.key -out libertysoft.homelinux.org.req
Ensuite, on signe la demande de certificat et on produit le certificat qui sera utilisé.
# mkdir /home/tahar/Desktop/Master/Securite/Travaux/SSL/serveur
# cd /home/tahar/Desktop/Master/Securite/Travaux/SSL/serveur
# openssl ca -config /usr/share/ssl/openssl.cnf -in libertysoft.homelinux.org.req -out libertysoft.homelinux.org.pem

Maintenant on place la clé ainsi que le certificat dans le répertoire de stockage d'apache, pour mon cas on les place dans /etc/httpd/conf/
# mv libertysof.homelinux.org.key /etc/httpd/conf/
# mv libertysoft.homelinux.org.pem /etc/httpd/conf/
On modifie par la suite le fichier httpd.conf pour qu'il prenne en considération les certificats et clés serveur, pour mon cas je dois modifier /etc/httpd/conf.d/ssl.conf
SSLCertificateFile /etc/httpd/conf/libertysoft.homelinux.org.pem

SSLCertificateKeyFile /etc/httpd/conf/libertysoft.homelinux.org.key
On met le chemin du certificat et de la clé dans SSLCertificateFile et SSLCertificateKeyFile.
Il ne reste plus qu'à configurer apache pour que toute requête http soit redirigée automatiquement vers https pour cela on modifie le fichier Vhosts.conf pour rajouter un virtual host et faire la redirection ensuite on rajoute la ligne
Include conf/vhosts/Vhosts.conf 
dans /etc/httpd/conf/httpd.conf


DocumentRoot /

ServerName libertysoft.homelinux.org

Redirect / https://libertysoft.homelinux.org

À présent notre serveur est prêt il suffit de relancer Apache pour que les modifications soient prises en compte
service httpd restart
Vu que nos clés sont sécurisées par un mot de passe le système risque de bloquer en attendant de saisir le mot de passe de protection de la clé.
À présent, si on tape l'adresse https://libertysoft.homelinux.org on aura un message d'erreur comme quoi le navigateur ne peut pas faire confiance au certificat vu qu'il n'est pas signé par une autorité de confiance, pour éviter ce message on installe notre CA dans le navigateur en tant qu'autorité de certification.
Pour cela on ouvre Firefox---->Édition---->Préférences---->Avancés------>afficher les certificats et on va à l'onglet Autorités et on importe notre certificat depuis /etc/ssl/tba.com/cacert.pem
Pour l'importer on nous demande de saisir le mot de passe de la clé privée qui a été générée au début.
À présent, la moitié du travail est terminée, il ne reste plus qu'à faire en sorte à ce que uniquement les clients qui présentent un certificat signé par Master E-Services puissent accéder au site,
Pour cela on modifie la configuration d'apache afin de n'accepter que les clients qui présentent un certificat, pour mon cas je dois modifier /etc/httpd/conf.d/ssl.conf on rajoute le chemin pour le certificat de la CA et on enlève le commentaire pour SSLVerifyClient.
SSLCACertificateFile /usr/share/ssl/certs/ca-bundle.crt

SSLVerifyClient require
À présent l'accès au site devient impossible si on ne présente pas un certificat et on obtient une erreur -12227
Maintenant pour empêcher cette erreur il faut créer les certificats client
mkdir /home/tahar/Desktop/Master/Securite/Travaux/SSL/client
cd /home/tahar/Desktop/Master/Securite/Travaux/SSL/client
openssl req -config /usr/share/ssl/openssl.cnf -newkey rsa:1024 -keyout client.key -out client.req

On signe la demande de certificat avec notre AC
openssl ca -config /usr/share/ssl/openssl.cnf -in client.req -out client.pem
Maintenant pour pouvoir importer la bi-clé dans le navigateur et identifier l'utilisateur il faut qu'elle soit au fomat PCKS#12
openssl pkcs12 -export -in client.pem -inkey client.key -out xavier.p12 -name "Xavier Le-Pallec"
Enter pass phrase for client.key:
Enter Export Password: xavier
Verifying - Enter Export Password: xavier
Il ne reste plus qu'à importer le certificat dans le navigateur pour pouvoir accéder à la page le mot de passe d'exportation sera demandé pour l'installer.

Configuring Samba in some minutes

Swobodin's picture
Submitted by Swobodin on Mon, 2006-05-29 08:19. ::
The following file is just an example of smb.conf, you may edit smb.conf according to your needs. This configuration only means to show how simple is to configure Samba for a common network.
smb.conf

Samba Configuration

# Global parameters

[global]

workgroup = SOUZAGAMA

server string = anderson

security = SHARE

password server = None

log file = /var/log/samba/%m.log

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = /etc/printcap

dns proxy = No

idmap uid = 16777216-33554431

idmap gid = 16777216-33554431

cups options = raw

[homes]

comment = Home Directories

writeable = yes

browseable = No

[printers]

comment = All Printers

path = /var/spool/samba

printable = Yes

browseable = No

[documentos]

comment = documentos

path = /var/samba/documentos

writeable = yes

guest ok = yes

vfs objects = extd_audit, recycle

[programas]

comment = programas

path = /var/samba/programas

writeable = yes

guest ok = Yes

vfs objects = extd_audit, recycle

[media$]

comment = media

path = /media

writeable = yes

guest ok = yes

max connections = 1

Sharing

This smb.conf is too much more "dry" than the one that you night find if you typed
mcedit /etc/smb.conf
for the fact that it has been created by swat, a powerful graphical tool to configure samba.
The objective of each network is to link computers and to share informations. My objective also was connecting my computer to another and to transfert files between each other. Without many restrictions, without access permission, only sharing with recycling resources (imagine that users delete the file xyz.txt that contains their CV's) nad system audit (knowing who does and when).

Configuring

Assuming that you are using Fedora Core 3, distribution easy of use and polyvalent, I retrieved apt from http://freshrpms.net, got into the shell (I prefer using apt from shell, for those who like GUI applicationsit's possible to get synaptic from http://pbone.net on your updated version) and typed the old and good
apt-get update
to update sources, then I did
apt-get install samba-swat
Once installed on system, you should activate swat using
ntsysv
choose it for being executed at boot start, and type
service xinetd start
Swat is now loaded by xinetd

Accessing

To be able to access to swat, point your browser to
http://127.0.0.1:901
A pop-up will be opened, type your root login and pasword. Click on "wizard", then "rewrite", you will notice that smb.conf has been considerably reducend.

smb.conf

Open in shell
mcedit /etc/samba/smb.conf
Now you can see how became smb.conf.
# Global parameters

[global]

workgroup = SOUZAGAMA #Your workgroup name

server string = anderson #your machine name on the network

security = SHARE #whether to share without authentication

password server = None

log file = /var/log/samba/%m.log # Samba log file

max log size = 50

socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192

printcap name = /etc/printcap

dns proxy = No

idmap uid = 16777216-33554431

idmap gid = 16777216-33554431

cups options = raw
[homes]
#Users particular directories for authentication

comment = Home Directories

writeable = yes #Whether the directoryis writable

browseable = No # Invisible

[printers]

comment = All Printers

path = /var/spool/samba # Spool directories for printers

printable = Yes

browseable = No #Invisible

[documentos]
# Sharing

comment = documentos

path = /var/samba/documentos # path to shared files

writeable = yes

guest ok = yes # Whether guests are accepted

vfs objects = extd_audit, recycle

[programas]
(compartilhamento)

comment = programas (comentário sobre o compartilhamento)

path = /var/samba/programas (caminho do compartilhamento)

writeable = yes (habilita a escrita)

guest ok = Yes (habilita acesso aos convidados=guest)

vfs objects = extd_audit, recycle

[media$] 
# As in Rwindows TM. The $ refers to sharing

comment = media # Do you remember /mnt? Now, everything is in /media

path = /media # Accessing CD-ROM, floppy and other devices

writeable = yes

guest ok = yes

max connections = 1 # Only one connection

Summary

This file is only an example of smb.conf that you may modify depeding on your preferences. To get access to the Samba recycle, you can just enter sharing. For example, if you want to hide the recycle directory, add a dot (.) before the directory name (/var/samba/documentos/.recycle)

Special thanks for the Fedora Brasil community.
Original article can be found (in Portuguese) at http://www.fedora.org.br/contentid-7.html or smash_se's blog

Setting your X11 keyboard layout

Swobodin's picture
Submitted by Swobodin on Fri, 2006-05-26 10:34. ::
Sometimes, you may need more characters than the ones that are available on your keyboard; therefore you look for the specified character in a text that contains it, or a program like charmap, copy the character and paste it, which is not always successful, especially in compatibility Gtk/Qt.
With X11, it's possible to customize your keyboard keys in any language layout you want.
For example: I use a standard US QWERTY keyboard with Arabic letters, but I need some Latin special characters to type in Spanish or so. Hence the need for adding special characters to the keyboard.
To configure your keyboard layout, edit the US International (us_intl) file, which can be found at /usr/X11R6/lib/X11/xkb/symbols/pc/us_intl in earlier Fedora Core versions, and at /usr/share/X11/xkb/symbols/us in Fedora Core 5, where the international layout is included within the main one as a subsection called intl-alt.
Backup the file (who knows?) before editing it.
As you can see, not all keys are listed, only the ones that differ from the standard US layout.
The structure is like the following
key <[code]> { [         lower,          upper,        metalower,         metaupper ] };
Where:
  • code is the key code: The key at left below Esc and containing a tilde is called , the first row is listed from (number 1 and exclaim mark) to (last one before Backspace key). Second row is listed from (Q) to , etc.
  • lower is the character typed without any extra key.
  • upper is the character typed while holding Shift key
  • metalower is the character typed while holding meta (Right Alt) key.
  • metaupper is the character typed while holding both meta (Right Alt) and Shift keys.
Example, the key containing both apostrophe and double quote symbols will be set as the following: Lower: apostrophe, Upper: Double quote, Meta lower: Dead acute (When typed, will be waiting for a vowel to make an accented character, eg.: á, é, í, Ó, Ú, ...), Meta Upper: Dead diaeresis (trema as in German ü or in French ë)
Key setting should be the following:
key { [ apostrophe, quotedbl, dead_acute,   dead_diaeresis         ] };
After you have configured your keys, update your keyboard layout
setxkbmap us_intl
If there's no error, then your configuration should be correct, else check your syntax. If you can't find the nistake (There's no debug here), restore your original file.
If everything goes well, modify to your /etc/X11/xorg.conf
Section "InputDevice"

        Identifier  "Keyboard0"
        Driver      "kbd"
        Option      "XkbModel" "pc105"
        Option      "XkbLayout" "us_intl"
EndSection
I attached my configuration files that you may download and use, copy it to your symbols/pc folder if you run an old Fedora version or insert the lines containing configuration instead of the original ones if running Fedora Core 5.

Python overview

Swobodin's picture
Submitted by Swobodin on Tue, 2006-05-16 12:33. ::
This week I have been leaning Python in order to set a Wikipedia robot; it differs so much from other C like languages, but it's powerful and its syntax is interesting.
Python is a free interpreted, interactive, object-oriented programming language  that  combines  remarkable power with very clear syntax.
You may start python in interactive mode; however, to create a solid program, it's better to use a script file
First line, like in UNIX script, must indicate the path to the executable, you may specify at the second line the charset (commented)
#!/usr/bin/python
## -*- coding: utf-8 -*-

A simple "Hello world" output is like the following
myvar="Hello world" # Variable declaration
print myvar+"\n" # Concatination is represented by a plus (+) symbol

Instruction is ended either by a semi-colon (;) or by a break line
The amazing thing is the start / end of instructions within "if", "while" and "for" statements, which is represented by a Tab!
Here is an example in both C and Python
C:
int a=5, b=7;
for (int i=0; i < b ; i++) {
        while (1) {
                b+=;   
                if (b == 100) {
                        break; 
                }

Python:
a, b = 5, 7;
for i in range (0, b):
    while (True): #instruction start by a Tab
        b = b+1 # Another tab
        if b == 100:
            break #Another tab!
# No more instruction in loop


Another example, to get the MD5 hash of a string, you have to import the module
import md5
m=md5.new("Your hash")
encoded = m.hexdigest() #hexdigest return void
print encoded

Another intersing feature: You may compile your code and make source unavailable by python itself!
You want to compile the file compiled.py , open another file
import compiler
compiler.compileFile("compiled.py")

Done, you should have obtained a file called compiled.pyc
This is just an overview, to find out more about the powerful language, check out the official site where you can get the program updates, documentation, tutorials, ...
http://python.org

Bash Completion

Swobodin's picture
Submitted by Swobodin on Fri, 2006-05-12 10:40. ::
Bash completion is a collection of shell functions that take advantage of the programmable completion feature of bash 2.04 and later.
Installation is easy, type as root
yum install bash-completion
and activate it
source /etc/bashrc
Once you hit "tab" key, completion is more "intelligent", for example:
  • It only displays directory with "cd"
  • Only displays image files with "display"
  • Displays available manual pages with "man"
  • Shows mount points with "mount"
  • Shows commandline options for the most useful commands, eg. "rpm", "ls", "perl", "mkisofs", etc.
  • Displays possible words of dictionary with "look" command
  • Recognizes environment variables, aliases and functions
  • Can find commandlines and binaries in path within a script (a loop "for", "while", ...)
Of course, the program is not intelligent to understand what you want to execute, that's why you may modify, add, delete some features.
For example, to add "SVG" extension to "display", edit /etc/bash_completion and change the line ending with display (Vim search: /^complete.*display$) adding "|SVG" within the entries.
To add extensions to "php" command, append
complete -f -X '!*.@(php|php3|php4|php5|phtml|inc)' php
To disable that feature (I don't see a reason to do it), rename the profile file
mv /etc/profile.d/bash_completion.sh{,.bak}

Setting a DHCP server

Swobodin's picture
Submitted by Swobodin on Tue, 2006-05-09 12:18. ::
DHCP stands for Dynamic Host Configuration Protocol.
DHCP allows hosts on a TCP/IP network to request and be assigned IP addresses, and also to discover  information  about  the network to which they are attached.  BOOTP provides similar functionality, with certain restrictions.
To run a DHCP server, you only need to edit /etc/dhcpd.conf
Here's a sample that you may find at /usr/share/doc/dhcp-version/dhcpd.conf.sample
ddns-update-style interim; # Possible values are ad-hoc, interim or none: Whether DNS should be updated
ignore client-updates; # By default, client-updates is allowed
option domain-name "myserver.com"; # domain name given to client
option domain-name-servers 192.168.0.254
default-lease-time 21600 # number of seconds till the expiration
max-lease-time 43200 # maximum length in seconds that will be assigned to a lease.

subnet 192.168.0.0 netmask 255.255.255.0 {
# These instruction are only applied for a given subnet
option routers 192.168.0.1; # Local gateway
option subnet-mask 255.255.255.0; # local mask

range 192.168.0.128 192.168.0.254; # DHCP range

#Static configuration for each DHCP hose
host mymachine {
hardware ethernet 12:34:56:78:AB:CD; # Your MAC address which can be obtained typing
# ifconfig ethX| head -1 | awk '{print $5}'
# Where ethX is your ethernet device
fixed-address 192.168.0.2; # Static IP
}
}
Activate the DHCP daemon
/etc/rc.d/init.d/dhcpd start
With client, it's too much simpler (guess so):
su -c dhcleint
I prefer to use pump, No official site for this application as far as I know, that's why I downloaded the source from Debian repository.
pump -i eth0
Please keep on mind that DHCP is not suitable for moitoring machines and security, neither for local servers.

Numlocx

Swobodin's picture
Submitted by Swobodin on Thu, 2006-05-04 07:15. ::
NumLockX is an interesting X11 program that consists of activating/deactivating numlock.
To run it, Download NumLockX tarball; uncompress the file, compile the source and install it
tar xvfz numlockx-1.1
cd numlockx-1.1
./configure && make
su
make install

This should be without any problem, as you have installed gcc and X stuff.
Still in the directory and having super-user privileges, to activate NumLockX at X startup, type
make xinitrc
And to deactivate it, type
make xinitrc_uninstall
To activate it with xdm (gdm, kdm or whatever), type
make xsetup
To deactivate it
make xsetup_uninstall
To switch numlock off, type (ypu do no longer need to be root)
numlockx off
and turn it on
numlockx on
1
2
3
4
5
6
7
8
9
...
next page
last page