Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<epandage>
<parametres_parcelle>
<nom>TEST</nom>
<longueur>455</longueur>
<largeur>22</largeur>
<volume_pulverise>27</volume_pulverise>
<volume_hectare>18</volume_hectare>
</parametres_parcelle>
</epandage>
@hardware
hardware / config.xml
Last active August 29, 2015 14:02
Exemple de gestion d'un fichier XML avec Qt
<?xml version="1.0" encoding="UTF-8"?>
<epandage>
<parametres>
<parametres_parcelle>
<nom>TEST</nom>
<longueur>455</longueur>
<largeur>22</largeur>
<volume_pulverise>27</volume_pulverise>
<volume_hectare>18</volume_hectare>
@hardware
hardware / prewikka.sh
Last active August 29, 2015 14:05
Prewikka init.d script
#!/bin/bash
# Variables couleurs
CSI="\033["
CEND="${CSI}0m"
CGREEN="${CSI}1;32m"
# PID du processus
PID=$(netstat -tlnp | awk '/:8000 */ {split($NF,a,"/"); print a[1]}')
@hardware
hardware / prelude-manager
Created August 31, 2014 08:02
Prelude Manager - Script init.d
#!/bin/sh
#
# init.d script for prelude-manager with LSB support.
#
# Copyright (c) 2008 Pierre Chifflier <pollux@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@hardware
hardware / prelude-lml
Created August 31, 2014 08:03
Prelude LML - Script init.d
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: prelude-lml
# Required-Start: $syslog $remote_fs
# Required-Stop: $syslog $remote_fs
# Should-Start: $local_fs
# Should-Stop: $local_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start prelude-lml sensor
@hardware
hardware / prelude-correlator
Created August 31, 2014 08:04
Prelude Correlator - Script init.d
#!/bin/sh
#
# init.d script for prelude-correlator with LSB support.
#
# Copyright (c) 2008 Pierre Chifflier <pollux@debian.org>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@hardware
hardware / ipban.sh
Created October 7, 2014 09:27
ipban
CSI="\033["
CEND="${CSI}0m"
CRED="${CSI}1;31m"
CCYAN="${CSI}1;36m"
ipban() {
ACTION=$1
IP=$2
#!/bin/bash
CSI="\033["
CEND="${CSI}0m"
CGREEN="${CSI}1;32m"
CRED="${CSI}1;31m"
RTORRENT_PID=$(netstat -tlnp | awk '/:45000 */ {split($NF,a,"/"); print a[1]}')
# Vérification du fonctionnement de RTorrent
@hardware
hardware / keybase.md
Created January 5, 2015 17:50
keybase.md

Keybase proof

I hereby claim:

  • I am hardware on github.
  • I am hardware (https://keybase.io/hardware) on keybase.
  • I have a public key whose fingerprint is 9225 EFB7 88EB 7666 4349 DA30 FDF3 D728 D616 9BF1

To claim this, I am signing this object:

@hardware
hardware / gist:5a2fa850411f700ba8b5
Created March 6, 2015 10:34
Search mail providers in db
CREATE OR REPLACE FUNCTION CHARINDEX(text, text, integer) RETURNS integer AS $$
SELECT CASE WHEN strpos(substr($2, $3+1), $1) = 0 THEN 0
ELSE strpos(substr($2, $3+1), $1) + $3 END;
$$ LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT;
SELECT DISTINCT substring(mail,charindex('@',mail,1)+1,length(mail)) FROM table;