nov

24

Posted by : admin | On : 24 novembre 2013

Compare CPU speed

a good website : http://www.diffen.com/difference/Special:Compare/Processors

oct

24

Posted by : admin | On : 24 octobre 2011

Samba permet de partager des dossiers sous Linux avec des ordinateurs locaux sous Windows, très pratique, donc !
De plus, il permet d’établir un réseau relativement sécurisé grâce à ses nombreuses fonctions.

Commencez d’abord par l’installer : loguez vous en root puis tapez :

apt-get install samba

Il faut ensuite configurer quelques lignes du fichier smb.conf :

vi /etc/samba/smb.conf

Ligne 27, renseignez le nom de votre groupe de travail, par exemple WORKGROUP :

 

# Change this to the workgroup/NT-domain name your Samba server will part of
 workgroup = WORKGROUP
 Après « ####### Authentication ####### », ligne 70, tapez :
 hosts deny = ALL
 hosts allow = ***.***.*.*

 

en remplaçant ***.***.*.* par l’ip local de l’ordinateur qui aura accès aux partages.

Si vous souhaitez mettre plusieurs ip, séparez les par des espaces.

Un peu plus loin, ligne 79, décommentez la ligne

;security = user

en supprimant le point virgule.
Cela signifie que par défaut seuls les utilisateurs enregistrés auprès de samba auront accès aux partages. A l’inverse, « share » autorise n’importe quel accès anonyme et est donc un mode bien moins sécurisé.


Les droits d’accès sont à configurer dans la partie « Share Definitions » : Par défaut, ils sont très limités.
Tout d’abord, pour autoriser les utilisateurs à naviguer et à écrire dans leur dossier personnel , modifier la partie [homes] de cette mannière :

 

[homes]
 comment = Home Directories
 browseable = yes
 # By default, the home directories are exported read-only. Change next
 # parameter to 'yes' if you want to be able to write to them.
 writable = yes
 # File creation mask is set to 0700 for security reasons. If you want to
 # create files with group=rw permissions, set next parameter to 0775.
 create mask = 0644
 # Directory creation mask is set to 0700 for security reasons. If you want to
 # create dirs. with group=rw permissions, set next parameter to 0775.
 directory mask = 0755

 

« create mask » est le CHMOD associé aux fichiers créés, « directory mask » celui associé aux dossiers créés.


Vous pouvez également partager n’importe quel dossier, et cela de différentes façons.

Il faut commencer par le nom du partage entre crochets, puis renseigner les différentes règles qui lui seront affectées :

[Nom_du_partage]
 path = /chemin/du/dossier/partagé
 valid users = guillaume ou public = yes
 browseable = yes/no
 writeable = yes/no
 create mask = 0644
 directory mask = 0755

Si vous utilisez la règle « public », n’oubliez pas de décommentez a ligne « guest account » dans la partie « Authentification », et au besoin modifier le compte qui sera utilisé par défaut par les invités.


On en a finit avec le fichier smb.conf. Il faut maintenant ajouter les utilisateurs de Samba.

Il faut commencer par ajouter les utilisateurs au système si ils n’existent pas encore, utilisez pour cela la commande adduser que vous pouvez compléter par la spécification du dossier personnel, auquel l’utilisateur aurra acès par défaut via samba :

adduser --home /home/votre_dossier nouvel_utilisateur

Vous est alors demandé le mot de passe associé ainsi que différentes informations que vous pouvez laisser vide.

Pour que les utilisateurs système aie un accès Samba, utilisez la commande :

smbpasswd –a nom_du_compte

En utilisant le nom de compte et le mot de apsse associé d’un utilisateur système.

Comme d’habitude, finalisez en redémarrant ce service :

/etc/init.d/samba restart

Pour avoir accès aux partages depuis Windows XP, créez un compte au même nom et avec le même mot de passe que celui enregistré à l’aide de la commande smbpasswd.

  • Source :

http://www.henol.fr/article-samba.html,

http://www.nuxo.net/tutorial-15.html

oct

24

Posted by : admin | On : 24 octobre 2011

http://blog.thelinuxfr.org/Installation-et-configuration-d-un.html

http://www.debian-administration.org/article/OpenLDAP_installation_on_Debian

Open LDAP

Installation des packages

 

sudo apt-get install slapd ldap-utils  libdb4.6
 sudo dpkg-reconfigure slapd
 root@artaud:~# /etc/init.d/slapd restart

 

Remplir notre ldap

 

sudo slapadd  -v -l ~/init.ldif
 ou ldapadd -c -x -D cn=admin,dc=spinlock,dc=hr -W -f ~/init.ldif

 

 

le prompt authentification aparait

 

 
 dn: ou=people,dc=home
 objectClass: organizationalUnit
 ou: people

 dn: ou=groups,dc=home
 objectClass: organizationalUnit
 ou: groups

 dn: uid=lionel,ou=people,dc=home
 objectClass: inetOrgPerson
 objectClass: posixAccount
 objectClass: shadowAccount
 uid: lionel
 sn: Porcheron
 givenName: Lionel
 cn: Lionel Porcheron
 displayName: Lionel Porcheron
 uidNumber: 1000
 gidNumber: 10000
 gecos: Lionel Porcheron
 loginShell: /bin/bash
 homeDirectory: /home/lionel
 shadowExpire: -1
 shadowFlag: 0
 shadowWarning: 7
 shadowMin: 8
 shadowMax: 999999
 shadowLastChange: 10877
 mail: lionel.porcheron@home.com
 postalCode: 31000
 l: Toulouse
 o: home
 mobile: +33 (0)6 xx xx xx xx
 homePhone: +33 (0)5 xx xx xx xx
 title: System Administrator
 postalAddress:
 initials: LP

 

 

Vérifier le peuplement de son LDAP

 

sudo slapcat
 ldapsearch -x

sortie écran

# extended LDIF # # LDAPv3 # base <> (default) with scope subtree # filter: (objectclass=*) # requesting: ALL # # search result search: 2 result: 32 No such object # numResponses: 1 root@artaud:~# ldapsearch -x # extended LDIF # # LDAPv3 # base <> (default) with scope subtree # filter: (objectclass=*) # requesting: ALL # # search result search: 2 result: 32 No such object # numResponses: 1

 

Configuration de /etc/ldap/ldap.conf

 

URI ldap://127.0.0.1/

 

 

 
 database    bdb

 suffix          "dc=admin,dc=home"

 #rootdn          "cn=Manager,dc=example,dc=com"
 rootdn          "cn=admin,dc=admin,dc=home"
 # Cleartext passwords, especially for the rootdn, should

 # be avoided.  See slappasswd(8) and slapd.conf(5) for details.
 # Use of strong authentication encouraged.

 #rootpw            {SSHA}rpns/vNaQ1h8qxzNGdnuS+mJtHGuzv+k
 {SSHA}4+B3Cqnpzf454dzgREe0FBsIQ19Y8Trp

 # rootpw          {crypt}ijFYNcSNctBYg

 root@artaud:~# sudo slapadd  -v -l ~/init.ldif

 

 

Annexe :

  • init.ldif

 

dn: ou=people,dc=home
 objectClass: organizationalUnit
 ou: people
 dn: ou=groups,dc=home
 objectClass: organizationalUnit
 ou: groups
 dn: uid=lionel,ou=people,dc=home
 objectClass: inetOrgPerson
 objectClass: posixAccount
 objectClass: shadowAccount
 uid: lionel
 sn: Porcheron
 givenName: Lionel
 cn: Lionel Porcheron
 displayName: Lionel Porcheron
 uidNumber: 1000
 gidNumber: 10000
 gecos: Lionel Porcheron
 loginShell: /bin/bash
 homeDirectory: /home/lionel
 shadowExpire: -1
 shadowFlag: 0
 shadowWarning: 7
 shadowMin: 8
 shadowMax: 999999
 shadowLastChange: 10877
 mail: lionel.porcheron@home.com
 postalCode: 31000
 l: Toulouse
 o: home
 mobile: +33 (0)6 xx xx xx xx
 homePhone: +33 (0)5 xx xx xx xx
 title: System Administrator
 postalAddress:
 initials: LP

 

 

Installer un client LDAP

  • les plus connu Gq et Luma
  • apt-get install luma
  • puis telecharger les sources sur le site de Luma . Version testé v2.4

Exécutez

 

python install –prefix=/usr/share
 /usr/share == PATH default

avr

24

Posted by : admin | On : 24 avril 2010

Preparation environnement J2EE

Telecharger
Maven2
Ant
Java
sun-java6-bin : Sun Java Runtime Environment (JRE) 6

=> sun-java6-demo : Sun Java Development Kit (JDK) 6 demos

=> sun-java6-jdk : Sun Java Development Kit (JDK) 6

=> sun-java6-jre : Sun Java Runtime Environment (JRE) 6
Voir ce site pour plus de détails :

export JAVA_HOME=/usr/lib/jvm/java-6-sun
export PATH=${JAVA_HOME}/bin:${PATH}

export ANT_HOME=/home/artaud/logiciels/apache-ant-1.8.1
export PATH=${ANT_HOME}/bin:${PATH}

export M2_HOME=/usr/local/apache-maven/
export M2=$M2_HOME/bin

export MAVEN_OPTS="-Xms512m -Xmx1024m"
export PATH=$M2:$PATH

Ecrire en japonais

Finalement j’y suis parvenu comme suit:

Dans Système->Administration->Prise en charge des langues, j’ai d’abord désinstallé le paquet de la langue japonaise, puis sélectionné le système de saisie au clavier ibus, puis réinstallé le paquet de la langue japonaise en cochant les trois cases « traductions », Méthodes de saisie » et « Polices supplémentaires ».
Redémarrage.
L’icone de ibus est apparue dans la zone de notification.
Click droit sur cet icone->préférences -> onglet méthode d’entrée -> Japonais -> Anthy->Ajouter

A partir de là dans une fenêtre de saisie (OpenOffice par exemple) CTL-Space pour activer désactiver. Les touches de basculement se déterminent dans l’onglet « Général » des préférences ibus.

references :

http://lejaponetmoi.blogspot.com/2009/11/ubuntu-910-et-le-japonais.html

http://forum.ubuntu-fr.org/viewtopic.php?id=352033

Source Liste

exemple :

 

echo "deb http://www.bashterritory.com/pytube/releases /" | sudo  tee -a /etc/apt/sources.list
 sudo aptitude install pytube

 

http://www.sourceslist.eu/notizie/sourceslist-table/

Nouveau depot Java Sun

Sous Lucid (Ubuntu 10.04), les paquets de sun-java 6 sont disponibles dans le dépôt partenaire qu’il faut activer pour pouvoir l’installer. Remarque : vous pouvez aussi utiliser l’alternative icedtea6

=> il suffit d’ajouter dans /etc/apt/sources.list ces deux liens

deb-src http://archive.canonical.com/ubuntu lucid partner
deb http://archive.canonical.com/ubuntu lucid partnerdeb-src http://archive.canonical.com/ubuntu lucid partner
sudo update-alternatives --config java

http://www.cyberciti.biz/faq/howto-ubuntu-linux-install-configure-jdk-jre/

Installer Avast Antivirus sur Amd64

apt-get install ia32-libs
 dpkg -i --force-architecture avast4workstation_1.0.8-2_i386.deb

Commande du quotidien

 

-Connaitre sa distribution :

lsb_release -c

-Installer un package

 sudo apt-get install --reinstall packagename

-Boucle de traitement :

for i in `ls`; do convert -resize 800x800 -quality 65 $i resized_$i; done

-Exemple de  PV Pipe Viewer:

tar -czf - . | pv > out.tgz
 tar -cf - . | pv  -s $(du -sb . | awk '{print $1}') | gzip > out.tgz

-Trouve tous les fichiers de format JPG ou jpg

 find . \( -name "*jpg" -o -name "*JPG" \) -type f

-Taille de tous les fichiers trouves :

find . \( -name "*jpg" -o -name "*JPG" \) -type f | du -sh

-Créer une Archive

tar -cvf toto.tar <Mes Fichiers>

-Tranfert SSH

ssh root@<ip_server> tar cf -toto | pv --wait > toto.ta

-Compter des fichiers

ls -l | wc -l

- Savoir quel est le user courant :

who am i | cut -f1 -d' '`

[/bash]

References :

http://www.smokinglinux.com/tutorials/howto-batch-image-resize-on-linux

http://doc.ubuntu-fr.org/imagemagick

Manuel

http://www.pixelbeat.org/cmdline.html

Find Command

 

find . -type f -name "*.php" -exec grep -il 'pattern' {} \;

find . -name "*.php" -print0 | xargs -0 egrep pattern

http://en.wikipedia.org/wiki/Find

Progress Bar and PV

http://www.korben.info/avoir-une-barre-de-progression-avec-la-commande-cp-sous-linux.html

http://www.ibm.com/developerworks/aix/library/au-spunix_pipeviewer/index.html

http://www.catonmat.net/blog/unix-utilities-pipe-viewer/

Autre

http://www.math.u-bordeaux1.fr/~foury/Info1/TP3/rappel.html

 #!/bin/sh
 cp_p()
 {
 set -e
 strace -q -ewrite cp -- "${1}" "${2}" 2>&1 \
 | awk '{
 count += $NF
 if (count % 10 == 0) {
 percent = count / total_size * 100
 printf "%3d%% [", percent
 for (i=0;i<=percent;i++)
 printf "="
 printf ">"
 for (i=percent;i<100;i++)
 printf " "
 printf "]\r"
 }
 }
 END { print "" }' total_size=$(stat -c '%s' "${1}") count=0
 }

Upgrade de votre distribution

http://planet.ubuntu-fr.org/

$sudo update-manager -c -d

Que faire quand Ubuntu plante ? via Hiko Seijûrô

Aucun système d'exploitation n'est parfait donc il arrive qu'Ubuntu plante. Mais heureusement, contrairement aux produits de Microsoft, on peut s'en sortir dans la plupart des cas avec Ubuntu (ou autres distributions Linux).

Tout est figé

Votre interface graphique est figé ? Seul la souris peut bouger ? N'éteignez pas brutalement votre ordinateur car il suffit de relancer l'environnement graphique. Pour cela il y a plusieurs solutions à essayer dans l'ordre suivant.
  1. On essaye un raccourci clavier bien utile : Alt + Impr écran + K [1] Cette combinaison de touches redémarre l'environnement graphique. Si vous avez une version d'Ubuntu inférieure à 9.04 (Jaunty Jackalope) il faut utiliser la combinaison Crtl + Alt + Backspace[2] devenue obsolète.
  2. Là on pas le choix il faut quitter cette interface graphique et se rendre dans un terminal. Pour cela il faut faire Ctrl + Alt + F1. On se retrouve alors dans le premier terminal[3] (tty1). On doit s'identifier donc tapez votre login et votre mot de passe. Puis entrez la commande suivante :
    sudo /etc/init.d/gdm restart

    Donnez votre mot de passe et patientez quelques secondes votre environnement graphique redémarre.

    GDM veut dire GNOME Display Manager et il est installé par défaut avec Ubuntu. Si vous utilisez un autre environnement graphique que GNOME remplacez gdm dans cette commande. Par exemple avec Kubuntu (environnement KDE) il faut remplacer par kdm.

  3. Si la commande précédente ne marche pas, ce qui m'est jamais arrivé, il faut redémarrer :
    sudo reboot

On doit sûrement pouvoir savoir pourquoi il y a eu un blocage en lisant les fichiers journaux (log) du système qui se situent dans le répertoire /var/log/. Mais je ne sais pas vraiment où trouver la bonne information. Je ne me suis pas vraiment penché sur le sujet.

http://www.pixelbeat.org/cmdline.html

mar

07

Posted by : admin | On : 7 mars 2010

Clam AntiVirus (ClamAV) is a free, cross-platform antivirus software tool-kit capable of detecting many types of malicious software, including viruses. One of its main uses is on mail servers as a server-side email virus scanner. The application was developed for Unix and has third party versions available for AIX, BSD, HP-UX, Linux, Mac OS X, OpenVMS, OSF and Solaris

Edit /etc/apt/sources.list

deb http://ppa.launchpad.net/ubuntu-clamav/ppa/ubuntu jaunty main

sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xf80220d0e695a455e651ac4d8ab767895adc2037
wget -q http://www.debian.org/volatile/etch-volatile.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get install clamav-freshclam

Mise a jour de lantivirus

freshclam

Lancer un scan des fichiers :

clamscan -r /home/utilisateur

mar

07

Posted by : admin | On : 7 mars 2010

Installation de tor

Tor logo

Tor is free software and an open network that helps you defend against a form of network surveillance that threatens personal freedom and privacy, confidential business activities and relationships, and state security known as traffic analysis.

Tor protects you by bouncing your communications around a distributed network of relays run by volunteers all around the world: it prevents somebody watching your Internet connection from learning what sites you visit, and it prevents the sites you visit from learning your physical location. Tor works with many of your existing applications, including web browsers, instant messaging clients, remote login, and other applications based on the TCP protocol.

Hundreds of thousands of people around the world use Tor for a wide variety of reasons: journalists and bloggers, human rights workers, law enforcement officers, soldiers, corporations, citizens of repressive regimes, and just ordinary citizens. See the Who Uses Tor? page for examples of typical Tor users. See the overview page for a more detailed explanation of what Tor does, and why this diversity of users is important.

Tor doesn’t magically encrypt all of your Internet activities, though. You should understand what Tor does and does not do for you.

Tor’s security improves as its user base grows and as more people volunteer to run relays. (It isn’t nearly as hard to set up as you might think, and can significantly enhance your own security.) If running a relay isn’t for you, we need help with many other aspects of the project, and we need funds to continue making the Tor network faster and easier to use while maintaining good security.

Tor is a network of virtual tunnels that allows people and groups to improve their privacy and security on the Internet. It also enables software developers to create new communication tools with built-in privacy features. Tor provides the foundation for a range of applications that allow organizations and individuals to share information over public networks without compromising their privacy.

Individuals use Tor to keep websites from tracking them and their family members, or to connect to news sites, instant messaging services, or the like when these are blocked by their local Internet providers. Tor’s hidden services let users publish web sites and other services without needing to reveal the location of the site. Individuals also use Tor for socially sensitive communication: chat rooms and web forums for rape and abuse survivors, or people with illnesses.

Journalists use Tor to communicate more safely with whistleblowers and dissidents. Non-governmental organizations (NGOs) use Tor to allow their workers to connect to their home website while they’re in a foreign country, without notifying everybody nearby that they’re working with that organization.

Groups such as Indymedia recommend Tor for safeguarding their members’ online privacy and security. Activist groups like the Electronic Frontier Foundation (EFF) recommend Tor as a mechanism for maintaining civil liberties online. Corporations use Tor as a safe way to conduct competitive analysis, and to protect sensitive procurement patterns from eavesdroppers. They also use it to replace traditional VPNs, which reveal the exact amount and timing of communication. Which locations have employees working late? Which locations have employees consulting job-hunting websites? Which research divisions are communicating with the company’s patent lawyers?

A branch of the U.S. Navy uses Tor for open source intelligence gathering, and one of its teams used Tor while deployed in the Middle East recently. Law enforcement uses Tor for visiting or surveilling web sites without leaving government IP addresses in their web logs, and for security during sting operations.

The variety of people who use Tor is actually part of what makes it so secure. Tor hides you among the other users on the network, so the more populous and diverse the user base for Tor is, the more your anonymity will be protected.

Why we need Tor

Using Tor protects you against a common form of Internet surveillance known as « traffic analysis. » Traffic analysis can be used to infer who is talking to whom over a public network. Knowing the source and destination of your Internet traffic allows others to track your behavior and interests. This can impact your checkbook if, for example, an e-commerce site uses price discrimination based on your country or institution of origin. It can even threaten your job and physical safety by revealing who and where you are. For example, if you’re travelling abroad and you connect to your employer’s computers to check or send mail, you can inadvertently reveal your national origin and professional affiliation to anyone observing the network, even if the connection is encrypted.

How does traffic analysis work? Internet data packets have two parts: a data payload and a header used for routing. The data payload is whatever is being sent, whether that’s an email message, a web page, or an audio file. Even if you encrypt the data payload of your communications, traffic analysis still reveals a great deal about what you’re doing and, possibly, what you’re saying. That’s because it focuses on the header, which discloses source, destination, size, timing, and so on.

A basic problem for the privacy minded is that the recipient of your communications can see that you sent it by looking at headers. So can authorized intermediaries like Internet service providers, and sometimes unauthorized intermediaries as well. A very simple form of traffic analysis might involve sitting somewhere between sender and recipient on the network, looking at headers.

But there are also more powerful kinds of traffic analysis. Some attackers spy on multiple parts of the Internet and use sophisticated statistical techniques to track the communications patterns of many different organizations and individuals. Encryption does not help against these attackers, since it only hides the content of Internet traffic, not the headers.

The solution: a distributed, anonymous network

Tor helps to reduce the risks of both simple and sophisticated traffic analysis by distributing your transactions over several places on the Internet, so no single point can link you to your destination. The idea is similar to using a twisty, hard-to-follow route in order to throw off somebody who is tailing you — and then periodically erasing your footprints. Instead of taking a direct route from source to destination, data packets on the Tor network take a random pathway through several relays that cover your tracks so no observer at any single point can tell where the data came from or where it’s going.

Tor circuit step one

To create a private network pathway with Tor, the user’s software or client incrementally builds a circuit of encrypted connections through relays on the network. The circuit is extended one hop at a time, and each relay along the way knows only which relay gave it data and which relay it is giving data to. No individual relay ever knows the complete path that a data packet has taken. The client negotiates a separate set of encryption keys for each hop along the circuit to ensure that each hop can’t trace these connections as they pass through.

Tor circuit step two

Once a circuit has been established, many kinds of data can be exchanged and several different sorts of software applications can be deployed over the Tor network. Because each relay sees no more than one hop in the circuit, neither an eavesdropper nor a compromised relay can use traffic analysis to link the connection’s source and destination. Tor only works for TCP streams and can be used by any application with SOCKS support.

For efficiency, the Tor software uses the same circuit for connections that happen within the same ten minutes or so. Later requests are given a new circuit, to keep people from linking your earlier actions to the new ones.

Tor circuit step three

Hidden services

Tor also makes it possible for users to hide their locations while offering various kinds of services, such as web publishing or an instant messaging server. Using Tor « rendezvous points, » other Tor users can connect to these hidden services, each without knowing the other’s network identity. This hidden service functionality could allow Tor users to set up a website where people publish material without worrying about censorship. Nobody would be able to determine who was offering the site, and nobody who offered the site would know who was posting to it. Learn more about configuring hidden services and how the hidden service protocol works.

Staying anonymous

Tor can’t solve all anonymity problems. It focuses only on protecting the transport of data. You need to use protocol-specific support software if you don’t want the sites you visit to see your identifying information. For example, you can use web proxies such as Privoxy while web browsing to block cookies and withhold information about your browser type.

Also, to protect your anonymity, be smart. Don’t provide your name or other revealing information in web forms. Be aware that, like all anonymizing networks that are fast enough for web browsing, Tor does not provide protection against end-to-end timing attacks: If your attacker can watch the traffic coming out of your computer, and also the traffic arriving at your chosen destination, he can use statistical analysis to discover that they are part of the same circuit.

Connaitre sa distribution Linux :

Open a prompt and type :

[bash]

lsb_release -idc

Distributor ID:    Ubuntu
Description:    Ubuntu 9.10
Codename:    xxxx

[/bash]

Near the code name you’ll find out the name of your distribution

Edit /etc/apt/sources.list

[bash]

deb http://deb.torproject.org/torproject.org <DISTRIBUTION> main
gpg –keyserver keys.gnupg.net –recv 886DDD89
gpg –export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
sudo apt-get update

sudo apt-get install tor
sudo aptitude install tor privoxy qt4-dev-tools qt4-designer cmake g++

sudo /etc/init.d/tor start
vidalia

[/bash]

Interface Vidalia

Check your installation :

https://check.torproject.org/