#!/bin/bash
if [ "$1" = "" ] ; then
echo -n "Nom du process : "
read process
else
process=$1
fi
ps aux | grep $process | grep -v grep | awk 'BEGIN { sum=0 } {sum=sum+$6; } END {printf("Taille RAM utilisée: %s Mo\n",sum / 1024)}'
Si tu donnes un poisson à un homme, il mangera un jour... Si tu lui apprends à pêcher, il mangera toujours !
jeudi 8 novembre 2018
Ping check
!/bin/bash
PINGLAT=$(ping -c1 8.8.8.8 | grep -i time | head -n 1 | awk '{print $7}' | awk 'BEGIN {FS="[=]|[ ]"} {print $2}')
PINGTHRESHOLD=400
PINGLATINT=$(echo "$PINGLAT/1" | bc)
echo $PINGLATINT
if [ $PINGLATINT -gt $PINGTHRESHOLD ]
then play -q ~jdoe/Musique/bip.mp3
else exit 0
fi
PINGLAT=$(ping -c1 8.8.8.8 | grep -i time | head -n 1 | awk '{print $7}' | awk 'BEGIN {FS="[=]|[ ]"} {print $2}')
PINGTHRESHOLD=400
PINGLATINT=$(echo "$PINGLAT/1" | bc)
echo $PINGLATINT
if [ $PINGLATINT -gt $PINGTHRESHOLD ]
then play -q ~jdoe/Musique/bip.mp3
else exit 0
fi
vendredi 14 septembre 2018
Configuration de Nextcloud (owncloud fork)
Fichier à mettre dans ./config/config.php :
$CONFIG = array (
'instanceid' => 'oc8d856504ae',
'passwordsalt' => 'MYSALT',
'secret' => 'SECRET',
'trusted_domains' =>
array (
0 => 'my.domain.com',
),
'datadirectory' => '/var/lib/owncloud/data',
'overwrite.cli.url' => 'https://my.domain.com',
'dbtype' => 'mysql',
'version' => '11.0.1.2',
'appstoreenabled' => true,
'dbname' => 'owncloud',
'dbhost' => 'localhost',
'dbtableprefix' => 'oc_',
'dbuser' => 'owncloud',
'dbpassword' => 'PASSWORD',
'installed' => true,
'memcache.local' => '\\OC\\Memcache\\APCu',
'forcessl' => true,
'maintenance' => false,
'loglevel' => 2,
'theme' => '',
'trashbin_retention_obligation' => 'auto',
'updatechecker' => false,
'appcodechecker' => false,
'appstoreurl' => 'https://api.owncloud.com/v1',
'apps_paths' =>
array (
0 =>
array (
'path' => '/var/www/html/nextcloud/apps',
'url' => '/apps',
'writable' => true,
),
),
'mail_from_address' => 'cloud',
'mail_smtpmode' => 'php',
'mail_domain' => 'domain.com',
'htaccess.RewriteBase' => '/',
'updater.secret' => 'SECRET',
'updater.server.url' => 'https://updates.nextcloud.com/updater_server/',
'updater.release.channel' => 'beta',
);
Inscription à :
Articles (Atom)