BaroqueW

BaroqueW

and his sidekick nikkitaa

BaroqueW RSS Feed
 
 
 
 

Archive for Tech

Sloppy Apple

After making of the launch of their iPhone 3GS a big event full of rejoicing for the nerd herds and apple maniacs, Apple is getting sloppy with the unlucky ones that won’t get their new iPhone early.

In Sweden, it’s only discreetly that Telia announced, a few weeks after the official keynote and 10 days after the release in some other countries of Europe, that the iPhone would only reach god-forsaken Sweden on July 31st.

iPhone 3G discreetly coming to a shop near you, on July 31st

For Apple, the iPhone is already available all over the world except a couple of poor African countries.

Apple - iPhone: NOT released in Sweden yet

Also, note to Apple, most people do not speak Spanish in Sweden. So hey, don’t forget that having a popular product doesn’t mean you can get sloppy!No hablo svenska

  • Share/Save/Bookmark
Category: Articles in English, Suède / Sweden, Tech | Comments (3)

Installing the GlobalSat DG100 under Windows XP 64 bits

Check the drivers for the serial-to-USB module of the GPS chip http://www.prolific.com.tw/eng/downloads.asp?ID=31 on Prolific’s website. As of the writing of this article, the right drivers were:

wd_pl2303h-hx-x_64-bit_v2018.zip 2008/6/25 v2.0.1.8 197 KB

PL-2303 (H, HX, X chip version) Windows XP and Server 2003 64-bit Driver (Not WHQL driver)

Then install the GlobalSat utility provided with your GPS data logger and enjoy!

Below, my daily commuting to work:


  • Share/Save/Bookmark
Category: Articles in English, Tech >> Computer, Voyage / Travel | Leave a comment

Latex – Autres astuces

Voici quelques snipets de LaTeX basé sur mon rapport de stage / Master.

Pour faire cadres et avoir un fond en couleur

Pour avoir un cadre autour de votre texte, un peu de la même manière que pour afficher le code sur ce site :

\begin{figure}[htb!]
\centering
\fcolorbox{black0}{graylight}{\parbox{1\textwidth}{
\paragraph{}
A concrete example in our case would be to retrieve all the URIs watched by the client with the URI "sip:cz@iptel.org". This can be done with the following XPath query: \texttt{//service[@uri="sip:cz@iptel.org"]//entry/@uri}. This would also work in the case there are multiple \texttt{list} elements associated to the URI "sip:cz@iptel.org".
}}
\caption{The XPath query language}\label{fig:XCAPquery}
\end{figure}

Tableaux

\begin{table}[htb!]
\caption{Improvements and their level of implementation}\label{table:3lvl}
\begin{center}
\begin{tabular}{|c|c|c|c|}
\hline
Improvement  \ Level & JBoss Server & Configuration & Asterisk \\
\hline
\hline
Call control & X & & X \\
\hline
External SIP proxy support & & X & X \\
\hline
H.323 support & X & X & X \\
\hline
Statistics & X & & X \\
\hline
Non-human user detection & & & X \\
\hline
\end{tabular}
\end{center}
\end{table}

Pour ajouter des éléments dans la table des matières

Par exemple, pour ajouter la bibliographie à la table des matières :

\usepackage[nottoc]{tocbibind}

Pour faire des chapitres non-numérotés mais présents dans la table des matières :

\chapter*{Acknowledgments}\label{section:ack}\addcontentsline{toc}{chapter}{Acknowledgments}

Utiliser verbatimtab

Pour afficher du texte, tel quel :

\begin{figure}[p]
\begin{verbatimtab}
<?xml version="1.0" encoding="UTF-8"?>
<rls-services>
        <service uri="sip:smith-list@iptel.org">
                <resource-list>http://localhost/xcap-root/resource-lists/users/smith/
resource-list.xml/~~/resource-lists/list[@name=\%22default\%22]
                </resource-list>
                <packages>
                        <package>presence</package>
                </packages>
        </service>
        <service uri="sip:cz@iptel.org">
                <list name="czech iptel">
                        <entry uri="sip:abc@iptel.org">
                                <display-name>A B</display-name>
                        </entry>
                        <entry uri="sip:cde@iptel.org">
                                <display-name>C D</display-name>
                        </entry>
                        <entry uri="sip:efg@iptel.org">
                                <display-name>Ef Ge</display-name>
                        </entry>
                </list>
                <packages>
                        <package>presence</package>
                        <package>email</package>
                </packages>
        </service>
</rls-services>
\end{verbatimtab}
\centering%
\caption{Example of RLS services document~\cite{presencehandbook}}
\label{fig:rlsdoc}
\end{figure}

Résumé en plusieurs langues

Parfois, vous voulez faire un résumé (abstract) en plusieurs langues, pour ce faire vous pouvez utiliser le code ci-dessous :

\usepackage[swedish,french,english]{babel}

\selectlanguage{english}
\begin{abstract}
\paragraph{}
The increased use of computer networks has lead to the adoption of Internet-based solutions for reducing telephony costs. This has proved a boon to callers who can reach the other party directly via the Internet. Unfortunately numerous business person still need to call to and from mobile phones which are currently a domain where the customers are generally tightly bound to their operators. To provide a simple solution to this problem, Opticall AB has designed an integrated system called the Dial over Data (DoD) solution, coupling a mobile interface with an Asterisk PBX and a GSM gateway, which allows calls to be originated remotely at the best price, exploiting the company’s existing network. This scheme allows the company to easily control telecommunications costs and to monitor of their employees’ efficiency.

\end{abstract}

\selectlanguage{swedish}
\begin{abstract}
Den nuvarande ökningen av datanätverk har lett till adoptionen av Internetbaserade lösningar för att
förminskar kostnader inom telefoni. Tyvärr behöver åtskilliga affärsmän fortfarande ringa till och ifrån
mobiler som återstår som ett område där kunderna är fastkedjade till deras operatörer. För att tillföra en
enkel lösning till detta problem har Opticall AB planlagt ett integrerat system som kallas den DoD
servern som kopplar ihop ett mobilt gränssnitt, med en Asterisk PABX\glossary{[PABX] Private Automatic Branch eXchange, synonym with PBX} och en GSM förmedlingsnod, som tillåter telefonsamtal påbörjas avlägset på det billigaste priset tack vare företagets nätverk. Det ger möjligheten till företaget att  vara centralt för sina personals kommunikationer. Det medger ett enkelt sätt att kontrollera kostnader samt övervaka personalens effektivitet.

\end{abstract}

\selectlanguage{french}
\begin{abstract}
L’omniprésence des réseaux informatiques aujourd’hui a pour effet de pousser de plus en plus à l’adoption de solutions en ligne pour réduire les coûts liés à la téléphonie. Malheureusement de nombreux hommes d’affaires doivent toujours appeler vers et depuis des téléphones portables, qui, pourtant, demeurent un domaine où les clients sont étroitement dépendants des opérateurs. Afin de fournir une solution à ce problème, Opticall AB a conçu un système intégré appelé le Dial over Data Server, comprenant une interface mobile à un  PABX Asterisk et une passerelle GSM, qui permet à des appels d’être lancés à distance au meilleur prix en utilisant le réseau de l’entreprise. Un tel dispositif place l’entreprise aux centres des communications de ses employés en permanence. Ceci permet un meilleur contrôle des coûts et une surveillance centralisée de l’activité des employés.

\end{abstract}

Accolades géantes

Pour mettre une belle portion de votre texte entre accolades, et pas seulement sur une ligne : notez que ce snippet comporte aussi le “cadre couleur” évoqué plus haut

\begin{figure}[htb!]
\centering
\fcolorbox{black0}{gray1}{
The administrator $\left\{\begin{tabular}{m{4.2in}}
has access to full settings through a dedicated Web interface. Timeout periods, dialplan contexts, and the number of conferences simultaneously allowed can be adjusted to suit the needs of the company. Users and operators can also be managed via this interface.\\
\\
The manager $\left\{\begin{tabular}{m{3.2in}}
has access to detailed statistics for each user as both raw values and graphs, to allow monitoring of user activity. The manager can also access aggregated values per day, week, or month for each user.\\
\\
The user $\left\{\begin{tabular}{m{2.4in}}
can place calls and manage their contacts. He or she can also access a small subset of the statistics concerning her.
                        \end{tabular}\right.$
                \end{tabular}\right.$
           \end{tabular}\right.$
}
\caption{Access level model for the DoD interface}\label{fig:modelauth}
\end{figure}

Le secret réside dans le

$\left\{\begin{tabular}{m{4.2in}} \\ xxx \\.

Mes headers

Pour la bonne bouche, voilà tous mes includes et définitions en tête de document :

\documentclass[10pt,a4paper,onecolumn, openright]{report}
\usepackage[applemac]{inputenc}
\usepackage[swedish,french,english]{babel}
\author{Max Weltz}
\title{Dial over Data solution}

\usepackage[left=1.5in, right=1in, top=1in, bottom=1in, includefoot, headheight=13.6pt]{geometry}

\usepackage{multirow}
\usepackage{listings}
\usepackage{graphics}
\usepackage{footmisc}
\usepackage{verbatim}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage[left]{eurosym}
\usepackage{array}
\usepackage{xy}
\usepackage{url}
\usepackage{afterpage}
\usepackage{float}
\restylefloat{figure}
\usepackage{moreverb}
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{subfigure}
\usepackage{color}
\definecolor{gray1}{gray}{0.5}
\definecolor{graylight}{gray}{0.7}
\definecolor{black0}{gray}{0}
\setlength{\fboxrule}{1pt}%
\setlength{\fboxsep}{10pt}%

\makeglossary

\usepackage[nottoc]{tocbibind}%ajouter une entrée bibliographique à la table des matières %

\usepackage{graphicx}

\newcommand{\footnoteremember}[2]{\footnote{#2}\newcounter{#1}\setcounter{#1}{\value{footnote}}}\newcommand{\footnoterecall}[1]{\footnotemark[\value{#1}]}

\newcommand{\montitre}{\Huge Dial over Data solution}

\hyphenpenalty=5000
\tolerance=1000

\usepackage{hyperref}
\pdfcompresslevel=9
\hypersetup{
colorlinks=true, %colorise les liens
breaklinks=true, %permet le retour à la ligne dans les liens trop longs
urlcolor= blue,  %couleur des hyperliens
linkcolor= blue, %couleur des liens internes
anchorcolor = blue,
citecolor = blue,
filecolor = blue,
pagecolor = blue,
pdftitle={Dial over Data solution}, %informations apparaissant dans
pdfauthor={Max Weltz}    %dans les informations du document sous Acrobat.
}

  • Share/Save/Bookmark
Category: Articles en français, Tech >> Computer | Leave a comment

Cacti on a MacOSX machine

Why?

Sometimes, you want to have everything under control. Or just have some nice graphs to watch during your long idle moments. Then cacti is something for you. It will allow you to monitor various values for various machines: bandwidth use for your router, CPU or hard disk use for your server, number of logged in users for your workstation… Cacti polls it for your using SNMP and then makes some nice graphs out of it.

How?

This article will briefly guide through setting up your random Intel Mac machine running Leopard (tested here on a MBP and iMac) to turn it into a Cacti server. Note that with that, you will be able to monitor any machine or device, running MacOSX or not, Linux or not, being an actual PC or not.

Step one will be to install the necessary Linux packages through Mac Ports. If you start from scratch, download the installer from the site, install it, and then run from Terminal

sudo /opt/local/bin/port -v selfupdate
sudo /opt/local/bin/port install net-snmp rrdtool

You will also need to install MySQL for MacOSX from MySQL website. This will put a nifty panel in your System Preferences, make sure the MySQL engine is enabled before proceeding forward.

We will run Cacti as the cacti user on the system, so go and create it. Open System Preferences and go under the Accounts panel. Create a user named cacti, give it some password, and keep it a “Standard user”.

Now, from the Terminal, change to being the cacti user and let’s proceed onward:

su cacti
cd ~
wget http://www.cacti.net/downloads/cacti-0.8.7d.tar.gz
tar -zxvf cacti-0.8.7d.tar.gz
ln -s ~/cacti-0.8.7d /Library/WebServer/Documents/cacti

Now time to deal with the database:

sudo mysqladmin -u root password <new password>
sudo mysqladmin --user=root -p create cacti

Change directory to the cacti directory or give the full path to cacti.sql

mysql -u root -p cacti < cacti.sql
sudo mysql -u root -p mysql
mysql> GRANT ALL ON cacti.* TO cacti@localhost IDENTIFIED BY 'password'; exit;

Now, edit include/config.php with the right values based on what you used above:

$database_type = "mysql"; 
$database_default = "cacti"; 
$database_hostname = "localhost"; 
$database_username = "cacti"; 
$database_password = "password";

Data has to be polled at a regular interval, usually five minutes, so, still as cacti user, from Terminal, run

crontab -e

and append this line somewhere:

*/5 * * * * php /Library/WebServer/Documents/cacti/poller.php > /dev/null 2>&1

Now you should be able to access your Cacti server from http://localhost/cacti/ so just follow the on screen indications for a while.

Go in Configuration > Settings in the main page in the Console view, NET-SNMP version should be 5.x and RRDTool should be 1.2.x. Otherwise, you will never get any graphs.

Now we have to add some data sources.

  1. Go into Devices > Add > give the device a name, a description, and give its IP or hostname (start with localhost, it’s the easier). SNMP version 2, public should be your default choices. For my part, I have set that localhost to being a “Leopard host” (see templates below), and added those graph templates:Linux – Memory Usage, Unix – Load Average, Unix – Logged in Users, Unix – Processesand the following data queries:SNMP – Get Mounted Partitions, SNMP – Get Processor Information, SNMP – Interface Statistics, Unix – Mounted partitions.When adding the templates and queries to a host, check if they return a success or a failure (Status column). Also, you can check on top of the page to see if the host is even reachable at all (Ping Results and SNMP Information).
  2. As a second example, here is how to add a Web server to your Cacti monitoring. Add another device, I set it to “web server – apache” (see below how to import templates), device detection is set to Ping or SNMP (UDP ping).I have added the following graph templates:teMySQL – CPU Usage, teMySQL – Load Average, WebServer – Apache Statistics – Hits /s, WebServer – Apache Statistics – kBits / sand following data queries:

    SNMP – Get Mounted Partitions, SNMP – Get Processor Information, SNMP – Interface statistics.

Some things to keep in mind:

  • If you have a public server, using SNMP 1 or 2, you don’t have much possibility to securize the SNMP protocol. You might want to disable all rw access and change the community name in /etc/snmp/snmpd.conf, for instance I commented out a bunch of lines in mine:

[...]

####
# First, map the community name (COMMUNITY) into a security name
# (local and mynetwork, depending on where the request is coming
# from):

#       sec.name  source          community
com2sec local     0.0.0.0       mycommunityrocks
#com2sec mynetwork NETWORK/24      COMMUNITY

####
# Second, map the security names into group names:

#               sec.model  sec.name
#group MyRWGroup        v1         local
group MyROGroup v2c        local
#group MyRWGroup        usm        local
#group MyROGroup v1         mynetwork
#group MyROGroup v2c        mynetwork
#group MyROGroup usm        mynetwork

####
# Third, create a view for us to let the groups have rights to:

#           incl/excl subtree                          mask
view all    included  .1                               80

####
# Finally, grant the 2 groups access to the 1 view with different
# write permissions:

#                context sec.model sec.level match  read   write  notif
#access MyRWGroup ""      any       noauth    exact  all    all   all
access MyROGroup ""      any       noauth    exact  all    none none

# -----------------------------------------------------------------------------

[...]

  • Also, sometimes, you will be presented with data from a different host (usually localhost) than the host you are working on. Be careful not to add this data to your graphs! (in device / graphs views in Console)
  • Which leads me to warn you that once data has been added to a device, you still need to create a graph about it, which will instruct Cacti to try to create the graph, and not just poll the values.
  • Last point, it’s probably a good thing to browse around Cacti’s interface to really customize it to your needs. Graph trees for instance will help you make useful views for your graphs: by host, by data type, etc.

Templates

You can install some extra data presentation and fetching templates via the obvious “Import templates” in the Console view in Cacti’s GUI. I used the following templates:

  1. apachestats make sure to enable mod_status in your apache server and to copy ws_apachestats.pl into Cacti’s scripts folder.
  2. teMySQLcacti to monitor MySQL use (including innoDB)
  3. Leopard templates (I do not seem to remember where I found them, please contact me if you know about their source)

Extra templates can be found there for instance: http://www.debianhelp.co.uk/cactitemplates.htm

Result

Note that it will take some time before enough data is gathered and the graphs can start being created and displayed, be patient. Count a couple of hours.

Sources:

Because I simply didn’t invent all of that, below are the links I used as guide lines. I wrote this article because some were a bit outdated or concerned MacOSX server. Or simply because I prefer to have it all in one place.

http://forums.cacti.net/about10202.html

http://frjo.info/?p=30

  • Share/Save/Bookmark
Category: Articles in English, Tech >> Computer | Comments (2)

Installing LDAP on Gentoo with MySQL support

One week-end, I endeavoured to install LDAP on my server with a hope it would help me keep my contacts synchronized between work and home, computers and phones. I decided to go for the MySQL storage since I already have such a DB running. It wasn’t so easy after all so I kept my life easier and decided to instead improve the way I dealt with my different sources instead of adding a new one. I hope that the notes below will nonetheless be helpful to someone out there!

Requirements

I will be installing phpldapadmin, so we need PHP with PCRE, SESSION, GETTEXT, XML, and LDAP support. SESSION and GETTEXT should be OK, but not the other two. So find your .ebuild and trail to the list of parameters (–with-xsl –with-ssl etc.):

–with-ldap \
–with-pcre-regex \
–with-xml

Update the ebuild’s digest: ebuild whatever.ebuild digest and reinstall: emerge php5 We will also need ODBC connectors, so emerge myodbc. Note that it wanted to install 90 packets on my machine to satisfy the dependencies (not quite sure what audiofile has to do with MySQL connections though…). Some of those packets needed X11, which, well, was not the case here. Solution: I ended up downloading the sources for unixODBC from http://www.unixodbc.org/, untared them, and used ./configure –enable-gui=no to bypass that (for some reason even changing the ebuild for that package did not help). And then run make, sudo make install as usual. Then, you’re left to install myodbc from the sources as well, from the MySQL website (needs registration, though). Note that to install myODBC you will also need the –enable-gui=no flag. Maybe you will hit the following bug:

/usr/include/mysql/my_global.h:318:24: error: asm/atomic.h: No such file or directory

My solution was to comment out the #include in /usr/include/mysql/my_global.h

Installing LDAP

 Easy on gentoo: emerge openldap

Configuring LDAP

A bit more difficult now. First, let’s say we want to configure it all for the domain example.com, that’s what all the tutorials I have found were about and I am sorry to say that making it work for another domain was too hard for me… Let’s also say that it will all reside on the same server: MySQL, LDAP, phpldapadmin.

Configuring MySQL and ODBC

First we need to create a user ldap for MySQL with password ldap and a database called ldap:

mysqladmin -u root -p create ldap

and then in a mysql command-line:

GRANT ALL ON ldap TO ldap@* IDENTIFIED BY ‘ldap’;

Let’s now create the proper structure in the database. This is done by executing the following scripts in order: testdb_create.sql, testdb_data.sql, backsql_create.sql, and finally testdb_metadata.sql:

mysql -u ldap -p ldap < file.sql

The files are located in openldap-2.4.11/servers/slapd/back-sql/rdbms_depend/mysql/ where openldap-2.4.11 is the folder where you uncompressed openldap’s archive.

Put this in /etc/openldap/ldap.conf:

HOST 127.0.0.1
BASE o=sql,c=RU

And in /etc/openldap/slapd.conf (you need to be root to edit this file):

#######################################################################
# sql database definitions
#######################################################################

 database        sql
 # This following is for the sample database as it installs
 suffix          "o=sql,c=RU"
 rootdn          "cn=root,o=sql,2c=RU"
 rootpw          YourPasswordHere
 dbname          ldap
 dbuser          ldap
 dbpasswd        ldap
 subtree_cond    "ldap_entries.dn LIKE CONCAT(’%',?)"
 insentry_query  "INSERT INTO ldap_entries (dn,oc_map_id,parent,keval) VALUES (?,?,?,?)"

Adding data manually

To add data, in command line, just use ldapadd over a ldif file as follow:

ldapadd -x -D "cn=Manager,dc=example,dc=com" -W -f example.ldif

A ldif file will look like the file below:

dn: cn=max,dc=example,dc=com
cn: max
sn: max
objectclass: top
objectclass: person
userPassword: anotherpassword

Now time to start the beast!

/etc/init.d/slapd restart

Installing phpldapadmin

Since now we have a proper PHP engine with the good modules, it should be easy. Get the latest sources from http://phpldapadmin.sourceforge.net/wiki/index.php/Download and untar them in your webroot folder. Copy conf/config.php.example in conf/config.php and change it if necessary. In our case luckily, it isn’t necessary. Now you should be able to connect and play around in an easier way than from command line!

Using your new LDAP

I will use LDAP with “Address Book” from Apple on MacOSX. Here is how to configure it briefly:

  • Open “Address Book”
  • Go in “Preferences”, “LDAP”
  • Click on the “+” sign
  • Enter a “Name” (anything) for your server and its location in the “Server” field (domain name or IP address)
  • “Port” is 389
  • Let the rest to default to search in all LDAP-domains

Resources

Here are the resources I had to use to put this all together (thanks to everyone who contributed to them):

http://linuxreviews.org/gentoo/ebuilds/

http://phpldapadmin.sourceforge.net/wiki/index.php/PreRequisites

http://www.openldap.org/doc/admin24/quickstart.html

http://www.zytrax.com/books/ldap/ch6/#database

http://www.flatmtn.com/article/setting-ldap-back-sql

http://www.yolinux.com/TUTORIALS/LinuxTutorialLDAP-BindPW.html

http://www.openldap.org/faq/data/cache/1322.html http://www.openldap.org/faq/data/cache/978.html

  • Share/Save/Bookmark
Category: Articles in English, Tech >> Computer | Comments (2)

Status

  • BaroqueW ecoute desproges dans les fjords
    1 day ago
  • BaroqueW : it is in fact NOT funny to point people in the wrong direction when they're lost
    1 day ago
  • BaroqueW : iphone 3gs, July 31st in Sweden - according to Telia
    3 days ago
  • BaroqueW had a quick look at the book keeping of the holidays... gloups
    3 days ago

Popular posts

My Social Networks

DandyID 43 Things Clipmarks coComment Dailymotion Delicious deviantART Digg Diigo Facebook Flickr Get Satisfaction Guitar Hero HelloTxt Hulu ICQ Imdb Imeem Kiva last.fm Linkedin Netvibes orkut PeoplePond Picasa Plaxo PostCrossing RockBand Scribd Stumbleupon Tagged TripAdvisor Twitpic Twitter Xbox LIVE YouTube

Expand the experience

Blogroll

Internet Map

Meta