Sandbox

An alternative space dedicated to technology and culture at Charleroi.
Révision datée du 25 décembre 2010 à 13:24 par Spike (discussion | contributions) (Test de <source>)
(diff) ← Version précédente | Voir la version actuelle (diff) | Version suivante → (diff)
Aller à la navigation Aller à la recherche

FreeBSD: how to add UTF-8 accounts classes to /etc/login.conf

#
# French UTF-8 Users Accunts.
#
french|French UTF-8 Users Accounts:\
    :charset=UTF-8:\
    :lang=fr_FR.UTF-8:\
    :tc=default:

#
# English UTF-8 Users Accunts.
#
english|English UTF-8 Users Accounts:\
    :charset=UTF-8:\
    :lang=en_US.UTF-8:\
    :tc=default:

TCL: read info from sqllite

In the config part

#The database containing mac information
#You can so hide a MAC address you don't want to print
#or gives it a custon name.
set macs(db) /tmp/pamela.db

#Path to libtclsqlite.so, if it's needed to manually load it
set macs(libtclsqlite) "/usr/local/lib/sqlite/libtclsqlite.so"

In the procedural part

#Loads database information
if {[info exists macs(db)] && $macs(db) != ""} {
    if {[info exists macs(libtclsqlite)] && $macs(libtclsqlite) != ""} {
        load $macs(libtclsqlite)
    } {
        package require sqlite
    }
    sqlite db $macs(db)
    set macs(knownmacs) [db eval {SELECT * FROM knownmacs}]
    db close
}