Skip to content

Instantly share code, notes, and snippets.

@bahamut45
bahamut45 / resultat.txt
Last active August 29, 2015 14:04
Tableau Switch
array(2) {
["RG1"]=>
array(2) {
[1]=>
array(4) {
["UNITE"]=>
string(2) "U1"
["IP"]=>
string(11) "10.118.6.30"
["NOM"]=>
<?php
$output = shell_exec('cat output | tr "\"" "|"');
$snmp = array_values(array_filter(explode("|",$output),"trim"));
$marque = trim(shell_exec("echo \"$snmp[0]\" | head -1 | awk '{print $1}'"));
$model = trim(shell_exec("echo \"$snmp[0]\" | head -1 | awk '{print $1,$3}'"));
$nom = $snmp[1];
$location = $snmp[2];
$info = array("marque" => $marque,"modele" => $model,"nom" => $nom,"emplacement" => $location);
var_dump($info);
?>
@bahamut45
bahamut45 / rtgi-rne
Created October 1, 2014 15:12
rtgi-rne
#!/usr/bin/ruby1.9.1
# encoding: utf-8
##########################################################################################
RTGI_URL = 'https://rtgi.giprecia.fr'
#########################################################################################
require 'yaml'
require 'mechanize'
@bahamut45
bahamut45 / configure_kvm.bat
Last active August 29, 2015 14:07
Configure Kvm
@ECHO OFF
SETLOCAL EnableDelayedExpansion
TITLE CONFIGURE KVM GIPRECIA
:rne
echo.
echo.
echo. Entrer le rne de l'etablissement :
echo.
echo.
@bahamut45
bahamut45 / repose-droit
Last active August 29, 2015 14:09
Repose droit pour owncloud
#!/bin/bash
###### Variables #######
owncloud_dir=/var/www/owncloud
sabnzb_dir=/var/Downloads
user_data=/var/www/owncloud/data
tmp_dir=/tmp/repose-droit
now=$(date +"%d_%m_%Y_%H_%M_%S")
lock=${tmp_dir}/repose-droit-${now}.lock
/*
Copyright (c) 2003-2010, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function (config)
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
config.toolbar = 'Full';
@bahamut45
bahamut45 / tg-downtime
Created January 5, 2015 15:07
tg-downtime
#!/usr/bin/ruby
require 'rubygems'
require 'cgi'
require 'csv'
require 'json'
require 'pp'
# colors
BOLD = "\e[1;39m"
RESET = "\e[0m"
# Faire un update de babun
babun update
# installation de ruby rubygems rubygems-doc
pact install ruby rubygems rubygems-doc
# On verifie les versions des divers outils
git --version
@bahamut45
bahamut45 / win_autoinstall_chocolatey.ps1
Created September 15, 2015 05:18
Installation Automatique de chocolatey
#########################
# Autoinstall script using chocolatey
#########################
function Download-File {
param (
[string]$url,
[string]$file
)
Write-Host "Downloading $url to $file" -ForegroundColor Yellow;