Archive

Archives pour 09/2015

A Raspberry Pi dashcam with two cameras and a GPS

28/09/2015 Comments off

Information on how to set up a Raspberry Pi as a two cameras dashcam with GPS.

General information about the Raspberry Pi dashcam

  What was used and how it’s connected up.

  Installing Arch Linux or Raspbian, resize the SD card, camera configurations etc.

How to wire up the button, LEDs and GPS using the Pi’s GPIO pins
A simple button for shutdown / reboots, status LEDs and an easy to connect GPS.

The built-in version

  I decided to try and hide things away and make it automated.
  Current status. What next?

Here are a couple of videos of the dashcam in action…

  
Categories: Matériel Tags:

How To Mount Remote Directory With SSHFS on a Linux

24/09/2015 Comments off

Source: nixCraft

How can I mount remote directory with ssh on a Linux bases system? How do I use SSHFS to mount remote file systems over SSH on a Ubuntu or Debian/RHEL/CentOS/Arch Linux system?

SSH is a secure protocol and you can use it to mount a directory on a remote server or local laptop with the help of the SSHF service. With SSHFS you can mount remote server file system to your local

More on SSHFS

sshfs is a filesystem based on the SSH file transfer protocol. It is used on a client system i.e. you need to install sshfs package on your local computer/laptop powered by CentOS/RHEL/Ubuntu/Debian/Arch Linux. No need to install anything on server (server1.cyberciti.biz). You only need an openssh server installed on server side. Our sample setup:

sshfs-setup

Lire la suite…

Categories: Système Tags: , ,

Debian Linux apt-get package management cheat sheet

24/09/2015 Comments off

Source: nixCraft

Both Debian and Ubuntu Linux provides a number of package management tools. This article summaries package management command along with it usage and examples for you.

  • apt-get : APT is acronym for Advanced Package Tool. It supports installing packages over internet using ftp or http protocols. You can also upgrade all packages in a single operations, which makes it even more attractive.
  • dpkg : Debian packaging tool which can be use to install, query, uninstall packages.

Gui tools: You can also try GUI based or high level interface to the Debian GNU/Linux package system. Following list summaries them:

  • aptitude: It is a text-based interface to the Debian GNU/Linux package system.
  • synaptic: GUI front end for APT

Red hat Linux package names generally end in .rpm, similarly Debian package names end in .deb, for example:

apache_1.3.31-6_i386.deb

Where,

  1. apache : Package name
  2. 1.3.31-6 : Version number
  3. i386 : Hardware Platform on which this package will run (i386 == intel x86 based system)
  4. .deb : Extension that suggest it is a Debian package

Remember, whenever I refer .deb file it signifies complete file name, and whenever I refer package name it must be first part of .deb file. For example, when I refer to a package sudo it means sudo only and not the .deb file i.e. sudo_1.6.7p5-2_i386.deb. You can find out debian package name with the following command:

apt-cache search {package-name}
apt-cache search apache

Finally, most of the actions listed in this post are written with the assumption that they will be executed by the root user running the bash or any other modern shell. Lire la suite…

Categories: Système Tags: , , , , ,

Debian/Ubuntu Linux: Restrict an SSH user session to a specific directory by setting chrooted jail

24/09/2015 Comments off

Source: nixCraft

I setup a web-server. I need to grant a user ssh access but I do not trust users. How can I limit user session to a specific directory such as /home/httpd/$USERNAME? How do I set up a ssh chroort jail on a Linux operating systems?

You can interactive shell with special root directory on a Linux or Unix-like systems. You can set the pathname (such as /home/httpd/foo) of a directory to chroot to after authentication. All components of the pathname must be root owned directories that are not writable by any other user or group. After the chroot, sshd changes the working directory to the user’s home directory.

Say hello to ChrootDirectory directive

From the sshd_config man page:

The ChrootDirectory must contain the necessary files and directo ries to support the user’s session. For an interactive session this requires at least a shell, typically sh(1), and basic /dev nodes such as null(4), zero(4), stdin(4), stdout(4), stderr(4), arandom(4) and tty(4) devices. For file transfer sessions using « sftp », no additional configuration of the environment is necessary if the in-process sftp server is used, though sessions which use logging do require /dev/log inside the chroot directory.

Lire la suite…

Categories: Système Tags: , , , ,

Monitoring Your Network And Servers With Observium

24/09/2015 Comments off

Source: unixmen.com

Introduction

You have a problem while monitoring your servers, switches or physical machines. Observium fits your need. As a free monitoring system, it helps you to monitor your servers remotely. It is an auto-discovering SNMP based network monitoring platform written in PHP which includes support for a wide range of network hardware and operating systems including Cisco, Windows, Linux, HP, NetApp and many other. I will give you the steps to follow while setting up an Observium server on Ubuntu 12.04.

Capture1

Currently there are two different versions of observium.
  • The observium Community is a free tool and licensed under the QPL Open Source license. This version is the best solution for small deployments. It gets security updates each 6 months.
  • While the second version, the Observium Professional is distributed under SVN based release mechanism. And it gets daily security updates. This tool is the best for Service Provider and enterprises deployments.

For more information you can visit the offcial website of Observium.

Lire la suite…

Installation et configuration d’Observium sous debian / ubuntu

24/09/2015 Comments off

Source: NooBUNBOX

Observium est un système de supervision de réseaux basé sur PHP / MySQL. Il supporte une large gamme de distributions (Windows, Linux, FreeBS, ESXI, etc.) et de matériels (Cisco, Linksys, Juniper, Dell).

Observium se décline en deux versions :

  • Observium Community Edition : une version gratuite, open-source et mise à jour tous les 6 mois.
  • Observium Profesionnal : une version payante (£150/an) distribuée via svn patchée quotidiennement (bug fixes, mises à jour de sécurité et nouvelles features)

Pour une utilisation non-professionnelle la version Community Edition suffit. Ici nous allons nous intéreser à l’installation et la configuration d’Observium sous debian 7.

Installation d’Observium

Ici nous partons d’une distribution propre, il nous faut donc commencer par installer les dépendances

sudo apt-get install libapache2-mod-php5 php5-cli php5-mysql php5-gd php5-mcrypt php5-json php-pear snmp fping \
mysql-server mysql-client python-mysqldb rrdtool subversion whois mtr-tiny ipmitool graphviz imagemagick

Créez le répertoire ou nous installerons Observium

Téléchargez la dernière version du logiciel et extrayez la

Lire la suite…

How To Run Cronjob Script On The Last Day Of a Month

24/09/2015 Comments off

Source: nixCraft

How to execute script on the last day of a month on Linux or Unix bash shell? How do I run a disk usage or custom reporting shell/perl/python script on the last day of a month on a Linux or Unix-like systems?

You need to use the date command to find out whether tomorrow is the first day of the next month. If it is true, you can run your script.

Say hello to TZ variable

TZ is time zone environment variable on Linux or Unix-like systems. The TZ environment variable tells functions such as the ctime(3) family and programs like date what the time zone and daylight saving rule is. For example, Greenwich Mean Time can be defined as follows:

TZ='GMT'

You can set TZ as follows to get tomorrow from the current date (+%d):
TZ=GMT-24 date +%d

Lire la suite…

Categories: Système Tags: ,

Linux and Unix Test Disk I/O Performance With dd Command

24/09/2015 Comments off

Source: nixCraft

How can I use dd command on a Linux to test I/O performance of my hard disk drive? How do I check the performance of a hard drive including the read and write speed on a Linux operating systems?

You can use the following commands on a Linux or Unix-like systems for simple I/O performance test:

dd command : It is used to monitor the writing performance of a disk device on a Linux and Unix-like system.

hdparm command : It is used to get/set hard disk parameters including test the reading and caching performance of a disk device on a Linux based system.

In this tutorial you will learn how to use the dd command to test disk I/O performance.

Use dd command to monitor the reading and writing performance of a disk device:

  1. Open a shell prompt.
  2. Or login to a remote server via ssh.
  3. Use the dd command to measure server throughput (write speed)
dd if=/dev/zero of=/tmp/test1.img bs=1G count=1 oflag=dsync
  1. Use the dd command to measure server latency
dd if=/dev/zero of=/tmp/test2.img bs=512 count=1000 oflag=dsync

Lire la suite…

How to Prevent & Disable Mac OS X From Sleeping From the Command Line Terminal Application

24/09/2015 Comments off

Source: nixCraft

I’m running a process to complete backup and covert images in Mac OS X laptop. I do not wish to disable sleep manually from my OS X power options (Energy Saver). How do I temporarily prevent a Mac from sleeping while my process is still active in Mac OS X Unix operating systems? How can I prevent the system from sleeping temporarily from the command prompt?

You can use the caffeinate command. This command creates assertions to alter system sleep behavior. If no assertion flags are specified, caffeinate creates an assertion to prevent idle sleep.

Another option is to use the pmset command to manipulate power management settings.

caffeinate-osx-demo

Syntax

The syntax is:

caffeinate
caffeinate [options]
caffeinate [options] command

Lire la suite…

Categories: Système Tags: , ,

Installation Serveur Mail Postfix, Amavisd, Mysql, Spamassassin, Dspam, Dovecot

23/09/2015 Comments off

Ce tutoriel a été intégralement repris du site  http://www.starbridge.org et a été réalisé par tonio. Il est distribué sous licence creativecommons  Creative Commons License

Cet article, initié en 2007, est mis à jour régulièrement.
Le système sur lequel est basé ce document est une DEBIAN stable (Wheezy).
Le tuto est aussi entièrement compatible avec la version Testing (Jessie).

Ce tuto fonctionne également sous Ubuntu mais certains paquets présentent de légères différences. On essaiera de les indiquer si possible.

Mise à jour du 5/5/2015

Table des matières

Préparation de l’environnement

On prendra comme base pour l’exemple le domaine starbridge.org et le hostname du serveur de mail sera spike.

On met le système à jour :

aptitude update
aptitude full-upgrade

On vérifie les fichiers :

/etc/hostname : spike.starbridge.org
/etc/hosts : 127.0.0.1    spike.starbridge.org localhost.localdomain localhost spike

Lire la suite…

Categories: Logiciel, Tutoriel Tags: , , ,