This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script pour nettoyer les journaux de traces dans /var/log | |
# À exécuter en tant que root | |
cd /var/log | |
cat /dev/null > messages | |
cat /dev/null > wtmp | |
echo "Journaux nettoyés." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
#Classer vos fichiers dans des dossiers par ordre chronologique | |
perl -MPOSIX=strftime -MFile::Path -e 'for(glob"*"){mkpath$d=strftime"%Y-%m-%d", | |
localtime((stat)[9]);rename$_,"$d/$_"}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Resizer(){ | |
$('.element').css('height', $(window).height()) | |
} | |
Resizer(); | |
$(window).resize(function(){ | |
Resizer(); | |
});jQuery |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var estPair = function(nombre) { | |
if (nombre % 2 === 0) { | |
return true; } | |
else if (estPair() === isNan()) { | |
return "Vous n'avez pas entré un nombre"; } | |
else { | |
return false; } } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Liste tous les fichiers contenant "log" dans /var/log (-I exclus les fichiers binaires) | |
# Extrait du résulat uniquement les noms des fichiers | |
# Trier noms des fichiers | |
# Supprime les doubons | |
sudo grep log -lr /var/log | cut -d: -f1 | sort | uniq |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# Affiche les liens symboliques du répertoire courant | |
use strict; | |
foreach my $name ( <*> ) { | |
print "$name\n" if( -l $name ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri Aug 7 22:20:06 2015 | |
@author: olto | |
""" | |
points = 9 | |
def test(message): | |
message = points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script iptables by olto | |
# Réinitialisation | |
iptables -F | |
echo - Réinitialisation... : [OK] | |
# Suppression des chaînes utilisateurs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
use strict; | |
# créé une liste de mots, transforme les majuscules de ces mots en minuscules, supprime les # chiffres appartenant aux mots, supprime les mots vides etaffiche la liste des mots ainsi | |
# transformés dans l'ordre lexical | |
my @r = qw(Un programme Perl est 5 fois plus rapide a ecrire); | |
map { tr/A-Z/a-z/; s/\d//g; } @r; | |
foreach (sort grep !/^$/, @r) { print "$_\n"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python | |
#coding=utf-8 | |
from random import randint | |
plateau = [] | |
for x in range(0, 5): | |
plateau.append(["O"] * 5) |
OlderNewer