Comment a block of text in VIM

it’s easy to comment a large text zone in VIM:

switch in visual mode (CTRL + V)
press touch I (upcase i)
Enter the comment caractere (# for exemple or // for exemple)
And now press ESC.

Et voilà!

Dell OpenManage 5 (OMSA) on Debian setup.

Cet aricle est tiré du site de john parnefjord. Merci à lui pour ce fabuleux article! 🙂
Dell OpenManage 5 (OMSA) est maintenant disponible en package .deb. Rien de plus facile pour l’installer dorénaveant. A condition d’avoir toutes les informations nécessaires!
Dans ce tutoriel nous verrons comment l’installer rapidement.

This article come from the john parnefjord website. Many thanks to him! 🙂
Since the advent of the debianized version of Dell OMSA installation has been a breeze.
Follow this tut to install quickly Dell OpenManage on a Debian system.

Continue reading ‘Dell OpenManage 5 (OMSA) on Debian setup.’

WordPress 2.6 is available

New WordPress version is available right now:
Download WordPress 2.6

More information on this brief video tour presentation of 2.6:

Read more to see “what’s new”
Continue reading ‘WordPress 2.6 is available’

Ethernet bonding (aggregating multiple ethernet channels)

Ethernet bonding refers to aggregating multiple ethernet channels together to form a single channel. This is primarily used for redundancy in ethernet paths or for load balancing.

To use Bonding Ethernet for High-Availability (fail-over) on Debian you need to:

install package ifenslave-2.6.To install this package follow this command
#apt-get install ifenslave-2.6

edit /etc/network/interfaces to look like this:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
auto bond0
iface bond0 inet static
address 192.168.1.14
netmask 255.255.255.0
gateway 192.168.1.1
dns-search MyDomain.net
dns-nameservers 192.168.1.1
up ifenslave bond0 eth0 eth1
down ifenslave -d bond0 eth0 eth1

comment or borrow the lines referring to your real NICs in the same file
add the following lines to your /etc/modprobe.d/bonding:


alias bond0 bonding
alias eth0 e1000
alias eth1 e1000
options bonding mode=0 miimon=100

Export/Import an existing list of packages

It is possible to export a list of all packages on a server and import this list to a new one.
It’s very usefull if you have a big server farm to manage.

Il est possible d’exporter la liste de toutes les packages d’un serveur et d’importer cette liste sur un autre serveur. Cette commande est très pratique si vous avez une ferme de serveurs à gérer.

Export packages list from the primary server:
dpkg –get-selections > mes_paquetages

Import the list on the new server:
dpkg –set-selections < mes_paquetages

And finally install the packages:
apt-get dselect-upgrade

Importons la liste des packages sur le serveur primaire:
dpkg –get-selections > mes_paquetages

Sur le nouveau serveur importons la liste des packages du serveur primaire:
dpkg –set-selections < mes_paquetages

Et enfin installons les paquets:
apt-get dselect-upgrade

Alienware M15x and Ubuntu

Just received my Alienware M15x and install Ubuntu 8.04 on it.
No problem except for the sound.
Need to add the line
options snd-hda-intel model=mbp3
in file
/etc/modprobe.d/alsa-base

Another little issue if you’re using AMsn and you don’t have sounds when you receive a message or when someone connect:
Go to Accound / Preferences / Others and replace
play $sound
with
aplay $sound

to use alsa sound server instead default library.

Get the Dell Service Tag number with Linux


[root@SERVER ~]# dmidecode | grep “Serial Number”
                Serial Number: 8HZZ42C

The Horrorist Live @ Paris 2008 04 01

All pictures available here:
http://www.crapules.com/gallery2/main.php/v/concerts/Horrorist/

20080401_Horro01.jpg

20080401_Horro02.jpg

JO: un journaliste de FR2 viré par des officiels chinois

Je ne suis pas fan de morandini, mais une vidéo intéressante lors de la flamme à paris:
Un journaliste de France2 qui filmait les manifestants et les officiels chinois c’est fait sortir par les officiels chinois qui visiblement demandaient à la police et obtenaient ce qu’ils voulaient.

Setup Sendmail without DNS

Configure Sendmail is not very funny.
In my case I have several box in a DMZ and i would like these box will be available to send email from my mail server. But sendmail need a valid MX reply to relay emails.
Without this valid MX you should have this error in the log file

Apr 4 15:46:32 SERVER-01 sendmail[2422]: [ID 801593 mail.info] m34DdKJC002400: to=<evargas @mycompany.com>,<hello @SERVER-01.internaldomain.fr>, delay=00:07:12, xdelay=00:00:00, mailer=relay, pri=240354, relay=mail, dsn=4.0.0, stat=Deferred: Name server: mailhost: host name lookup failure </hello></evargas>

When DNS doesn’t arrive for the party, sendmail gets mad.

How to solve this?
Continue reading ‘Setup Sendmail without DNS’

recursive mass rename script

Hello,

here a little script called myrename.pl to mass rename all the file of a directory and all the sub-directory and all files.
I need this script to delete the space character in the filename

Continue reading ‘recursive mass rename script’

listing & zip Dir on the Fly

Hello,
Sometime I need to access my music from work.
To do this I have made a quick php script to print my private collection hosted on my own server and added a script to create archive file (.zip) on the fly.

J’ai développé une petite page php pour gerer ma musique sur mon server perso. Ce script me permet de créer un fichier zip a la volée pour chaque album que je veux prendre chez moi.

homelist

Continue reading ‘listing & zip Dir on the Fly’

Force (W)SUS to update

Below a batch to force WSUS , windows update to update automaticaly.


@echo off
Echo This batch file will Force the Update Detection from the AU client:
Echo 1. Stops the Automatic Updates Service (wuauserv)
Echo 2. Deletes the LastWaitTimeout registry key (if it exists)
Echo 3. Deletes the DetectionStartTime registry key (if it exists)
Echo 4. Deletes the NextDetectionTime registry key (if it exists)
Echo 5. Restart the Automatic Updates Service (wuauserv)
Echo 6. Force the detection
Pause
@echo on
net stop wuauserv
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v LastWaitTimeout /f
REG DELETE "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v DetectionStartTime /f
Reg Delete "HKLM\Software\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v NextDetectionTime /f
net start wuauserv
wuauclt /detectnow
@echo off
Echo This AU client will now check for the Updates on the Local WSUS Server.
Pause

resize, add border&watermark

Hello,

Imagemagick is a very powerfull program to modify picture with a simple comand line.
For example, we can write a script to automatically resize, add a border and watermark to many picture in the same directory.


#/bin/sh
for img in `ls *.jpg`
do
convert $img -resize 20% rez_$img
convert -bordercolor "#000000" -border 2x2 -bordercolor "#FFFFFF" -border 4x4 -bordercolor "#000000" -border 2x2 rez_$img border_$img
convert border_$img -font /usr/share/fonts/default/ghostscript/bchri.pfa -fill white -pointsize 16 -draw "gravity southeast text 10,7 '(c) Vargas Emmanuel http://www\
.crapules.com'" final_$img
/bin/rm -f rez_$img
/bin/rm -f border_$img
done

RIP Linux Server

First Time I need to definitively shutdown a Production Linux Server.

RIP.

cro_RIP

Solaris tips

Solaris tips

Continue reading ‘Solaris tips’

VIM shortcuts

Some tips and shortcuts for VIM
Continue reading ‘VIM shortcuts’

Force autoshare on Windows

Change this key to 1 and reboot

Hive: HKEY_LOCAL_MACHINE
Key: SYSTEM\CurrentControlSet\Services\LanManServer\Parameters
Name: AutoShareServer
Data Type: REG_DWORD
Value: 0

Port Knocking Configuration

This articles describe how to configure a port knocking. We will use Knockd
Cet articles décrit la mise en place d’un port knocking. Nous utiliserons Knockd
Continue reading ‘Port Knocking Configuration’

Setup a server in FW

This firewall script is very interesting with a web/ftp server directly connected to Internet.
We are in the “easiest” IPTables mode without nat or mangle.
Please comment if you have any suggestion!
Continue reading ‘Setup a server in FW’

Configuration Firewall avec serveur en frontend

Dans mon cas, la dedibox est directement relié au net avec une IP publique.
On est dans le cas le plus “simple” ou IPTables joue uniquement un rôle de Firewall
Continue reading ‘Configuration Firewall avec serveur en frontend’

Remplacer les espaces par des underscores

Petit script trouvé sur Space Replace 1.0.1 qui permet de remplacer tous les espaces d’un répertoire ainsi que son contenu par des undescores.
Par exemple, intricate – in pectra devient intricate_-_in_pectra
Script to replace all space in file and directory with an undescore. Script found Here

Continue reading ‘Remplacer les espaces par des underscores’

Emacs backup files in ONE directory

Backup directory pour avoir tous les fichiers de backup dans un seul
répertoire plutôt que d’en avoir partout;

move your emacs backup files in only one directory


;; Backup directory pour avoir tous les fichiers de backup dans un seul
;; répertoire plutôt que d'en avoir partout;
;; 
;; move your emacs backup files in only one directory
(defun make-backup-file-name (file)
   (concat "~/backup/" (file-name-nondirectory file) "~"))

mirroring script

I have made a little script to mirroring some ftp (apache for exemple).
This script is based on the anonftprsync debian script.
just copy this in /usr/sbin/anonftprsyncapache:

Continue reading ‘mirroring script’

Monitoring Proftpd

My major problem with proftpd is the real time monitoring of log analysis.

I will try to describe on this post the current solution I have build on my proftpd server.

Prerequisites:

  • Proftpd + mysql
  • Perl + Perl-MIME-Lite + Perl-MailsTools + Perl-DBI and Perl-DBD-mysql

Continue reading ‘Monitoring Proftpd’