GeeK`s Lifez GeeK`s Lifez

16Jan/120

HP Procurve – Configure NTP

Un petit post rapide sous forme de mémo...

Procurve#show time

Mon Jan 1 00:04:21 1990

Procurve#configure

Procurve#sntp unicast

Procurve#sntp server <ip server NTP>

Procurve#timesync sntp

Procurve#show time

Mon Jan 16 10:35:27 2012

Personnellement j'adore les procurve ...

Filed under: Procurve No Comments
2Jan/123

Serveur VPN PPTP linux pour clients windows, iPhone, Android

Cédons a la mode du VPN !

Ces derniers temps avec la crise Hadopi & co, la mode est au VPN... et pour cause quoi de plus beau que l'anonymat sur le nain ternet ?

Je vais vous expliquer comment mettre en place votre propre VPN pour au choix, être géolocalisé dans un pays différents du votre ? (Streaming?) ou tout simplement pour salir l'ip de votre dédié préféré !

Dans cet exemple nous aurons donc un serveur dedié nommé "serveur" et une machine cliente nommé cliente ! (Cet exemple permet aussi d'utiliser le VPN sur un device de type iPhone ou Android)

Commençons par installer le serveur pptp sur notre serveur debian:

serveur#apt-get install pptpd

Dans mon cas, je sais que je n'aurai jamais plus d'un client connecté a mon VPN à la fois et je décide de dédier a ce VPN le sous réseau suivant: 10.13.13.0/24

Voici donc le contenu de mon fichier /etc/pptpd.conf:

serveur# cat /etc/pptpd.conf | grep -v '^$' |grep -v '^#'
option /etc/ppp/pptpd-options
logwtmp
localip 10.13.13.1
remoteip 10.13.13.2-3

Voici le contenu de mon fichier /etc/ppp/pptpd-options:

serveur# cat /etc/ppp/pptpd-options | grep -v '^$' |grep -v '^#'
name NomdeVotre.VPN
refuse-pap
refuse-chap
refuse-mschap
require-mschap-v2
require-mppe-128
ms-dns 8.8.8.8
proxyarp
lock
nobsdcomp
mtu 1490
mru 1490

On note le nom de votre VPN ainsi que les DNS publics de google qui seront utilisés par le client VPN

Je souhaite également pouvoir m'authentifier par login / password, pour cela il faut renseigner le fichier /etc/ppp/chap-secrets

serveur# cat /etc/ppp/chap-secrets
monlogin NomdeVotre.VPN  monpassword *

Le quatrième champs peut être utilisé pour faire un restriction par adresse IP cliente.

Coté serveur il ne reste plus qu'a redemarrer le service pptpd:

# /etc/init.d/pptpd restart

Vérifions à l'aide d'un ifconfig -a que le service est bien lancé que l'ip local est bien assignée:

server# ifconfig -a ppp0

ppp0 Link encap:Point-to-Point Protocol
inet addr:10.13.13.1 P-t-P:10.13.13.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1396 Metric:1
RX packets:6628 errors:0 dropped:0 overruns:0 frame:0
TX packets:11701 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:1123537 (1.0 MiB) TX bytes:8077239 (7.7 MiB)

Coté client, il ne reste plus qu'à configurer votre client pptp sous windows, iPhone, ou Android !

Un petit coup de MASQUERADE vous sera tres utile:

IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE

Verifier votre ip de sortie

Sur votre dedié vous pouvez faireu ne ping sur la machine cliente:

serveur

serveur# ping 10.13.13.2
PING 10.13.13.2 (10.13.13.2) 56(84) bytes of data.
64 bytes from 10.13.13.2: icmp_req=1 ttl=64 time=97.9 ms
64 bytes from 10.13.13.2: icmp_req=2 ttl=64 time=224 ms
64 bytes from 10.13.13.2: icmp_req=3 ttl=64 time=148 ms

P.S: on ne s'affole pas il s'agit du fabuleux réseaux 3g d'orange ...

That's done !!

iPhone VPN

iPhone VPN

Filed under: Debian, PPTP 3 Comments
29Dec/110

hubiC – OVH

Hier, le 28 Decembre, OVH a lancé son offre "hubiC" de Cloud NAS.

D'ordinaire je ne suis que peu interressé par les offre de beta testing, et pourtant cette fois-ci, les 25 Go gratuits m'ont plutôt motivé!

Pour creer un compte rien de plus simple il suffit de télécharger l'applicatif adéquat (disponible a l'heure d'aujourd'hui: Android, iPhone, Windows), de le lancer pour s'inscrire:

hubic1

hubic1

Lors de la face d'inscription un tcpdump montre que nous sommes bien sur du sécurisé avec du httpps a gogo, sur un windows on decouvre une interface QT assez sympa.

Pour le moment je n'ai pas encore prit le temps de lire les CGV, parce que bon, si je dois déposer toutes mes photos sur un compte gratuit pour commencer je réagirai assez mal à sa suppression arbitraire ou autre.

L'interface iPhone est simple mais au moins on s'y retrouve:

hubic-iphone

hubic-iphone

 

Bref, vivement le client Linux et/ou BSD ? :)

OVH continue de surfer sur la vague du cloud et ils ont bien raisons !

Filed under: hubic, OVH No Comments
15Jan/110

Extract files from tar archive

Just a quick post to indicate how to extract some files from tar.gz archive:

For example if you need to extract file/directory named blog from archive arch.tar.gz you can use the following command:

tar -zxvf arch.tar.gz directory/where/is/blog

You can extract files by using extensions too:

tar -xf arch.tar.gz --wildcards --no-anchored '*.php'

I hope these commands could help us.

Filed under: Linux No Comments
3Oct/103

Reportage censuré de M6 sur Mc Donald

Comme quoi parfois on trouve des videos sympas sur l'hygiene de certains Mc Donald

Ci-dessous un reportage tourné par M6 sur le sujet en question (reportage supprimé sur dailymotion a la demande de M6)

Get the Flash Player to see this content.

Tagged as: 3 Comments
2Oct/102

How to know the size of Mysql’s databases

This is a little command which permit to know the size of all your mysql's databases:

First connect you to your mysql server as root:

# mysql - u root -p

Then use the following request:

mysql> select table_schema as BDD,round(sum(data_length+index_length)/1024/1024,2) as 'Size(MB)' from information_schema.tables group by table_schema;
+---------------------+----------+
| BDD                 | Size(MB) |
+---------------------+----------+
| database1  |    24.88 |
| information_schema  |     0.00 |
| mysql               |     0.51 |
+---------------------+----------+
3 rows in set (0.30 sec)
This command could be usefull when you want to prevent mysql's backup size.
Tagged as: 2 Comments
27Sep/102

Centreon script for Juniper SSG5

A few times ago i had to realized a centreon script which goal was to draw graph related to VPN use on Juniper SSG5.

This script display only traffic on VPN, you can't get state like OK, WARNING, CRITICAL, this script will only print,performance data related to traffic on vpn (like bandwith consumption)

You can download this script there

8Jun/103

Create your own Tinyproxy FreeBSD’s package

In FreeBSD  8.0, tinyproxy's package in stable repository isn't compil with the --enable-transparent-proxy option.

This is the reason why, i'll explain how to create a tinyproxy's package including this compilation option.

First, edit your /usr/ports/www/tinyproxy/Makefile like the following:

# New ports collection makefile for:    tinyproxy
# Date created:         01 Jul 1999
# Whom:                 Mitsuru Yoshida <mitsuru@riken.go.jp>
#
# $FreeBSD: ports/www/tinyproxy/Makefile,v 1.30 2009/10/19 18:41:40 wxs Exp $
#

PORTNAME=       tinyproxy
PORTVERSION=    1.6.5
PORTEPOCH=      1
CATEGORIES=     www
MASTER_SITES=   https://www.banu.com/pub/tinyproxy/1.6/

MAINTAINER=     wxs@FreeBSD.org
COMMENT=        A small, efficient HTTP proxy server

USE_RC_SUBR=    tinyproxy.sh
GNU_CONFIGURE=  yes
USE_GMAKE=      yes
CONFIGURE_ARGS= --bindir=${PREFIX}/sbin \
--with-config=${PREFIX}/etc/tinyproxy.conf \
--program-transform-name=""
MAKE_JOBS_SAFE= yes

MAN8=           tinyproxy.8

OPTIONS=        REVERSE "Enable reverse proxy support" Off \
TRANSPARENT "Enable transparent proxy" Off

.include <bsd.port.pre.mk>

.if defined(WITH_REVERSE)
CONFIGURE_ARGS+=        --enable-reverse
.endif

.if defined(WITH_TRANSPARENT)
CONFIGURE_ARGS+=        --enable-transparent-proxy
.endif

post-patch:
@${REINPLACE_CMD} -e 's|-O2||' ${WRKSRC}/configure
@${REINPLACE_CMD} -e 's|/etc/tinyproxy/tinyproxy.conf|${PREFIX}/etc/tinyproxy.conf|' \
${WRKSRC}/doc/tinyproxy.8
@${REINPLACE_CMD} -e 's|/usr/share/tinyproxy|${DATADIR}|' \
${WRKSRC}/doc/tinyproxy.conf

post-install:
@if [ ! -f ${PREFIX}/etc/tinyproxy.conf ]; then \
${CP} -p ${PREFIX}/etc/tinyproxy.conf-dist \
${PREFIX}/etc/tinyproxy.conf ; \
fi

.include <bsd.port.post.mk>

Be carefull, note that indentation is really important in Makefile!

Now just create the package by using:

make package

After a few seconds you'll have a pakage store in this path:

/usr/ports/packages/All/tinyproxy-1.6.5,1.tbz

4May/1028

Redirection avec Lighttpd

Récemment j'ai voulu pour les besoin d'un site webs rediriger automatiquement http://domaine.com/ vers http://www.domaine.com/

Pour cela il faut dans un premier temps ajouter le module mod_redirect à Lighttpd (/etc/lighttpd/lighttpd.conf):

server.modules = ( "mod_redirect" )

Puis de même pour le nom de domaine concerné rajouter:

$HTTP["host"] =~ "^domaine.com$" {
url.redirect = ( "^/(.*)" => "http://www.domaine.com/$1" )
}

Tagged as: 28 Comments
3May/104

Jailbreak Iphone 3.1.3

Ca y'est la dev team nous offre la possibilité de jailbreak les iphone 3.1.3 05.12.01 avec le dernier iboot.

Cela prends 10 secondes sans perdre ses données.

Ca se passe ici: http://spiritjb.com/

Have fun !