Skip to content

Instantly share code, notes, and snippets.

@Guitsou
Guitsou / commands.md
Last active December 17, 2015 19:39
IP vs IFCONFIG

##Show network devices and configuration ¶

ifconfig   # ifconfig way
ip addr show
ip link show

##Enable a network interface ¶

ifconfig eth0 up
ip link set eth0 up
@Guitsou
Guitsou / ssh_drac.md
Last active December 17, 2015 19:29
Fonctions de la DRAC Dell

Reset de la DRAC

racadm racreset

Redémarrage du serveur

racadm serveraction powercycle
@Guitsou
Guitsou / vera.md
Created May 24, 2013 11:46
Domotique en vrac

URL pour obtenir les infos pour l'api :

http://sta1.mios.com/locator_json.php?username=XXX
@Guitsou
Guitsou / Change_DRAC_password.sh
Last active December 17, 2015 16:49
Dell OpenManage
#!/bin/bash
PASSWORD="toto"
if ! grep -i qemu /proc/cpuinfo > /dev/null; then ## VM ou phys ?
if [ -f /opt/dell/srvadmin/bin/omreport ]; then ## Tools DELL ok ?
ID=$(omreport chassis remoteaccess config=user | grep -B 3 root | awk '/ID/ {print $4}')
echo "ID root : $ID"
echo "Changement de mot de passe..."
omconfig chassis remoteaccess config=user id=$ID newpw=$PASSWORD confirmnewpw=$PASSWORD

Gestion

Déclaration des variables

A ajouter en source dans le .bashrc. Sinon, les valeurs devront être passées en paramètre systématiquement...

#!/bin/bash
## my-landscape-api.rc
export LANDSCAPE_API_KEY="Ma clé"
export LANDSCAPE_API_SECRET="Mon secret"
export LANDSCAPE_API_URI="https://URL/api/"
export LANDSCAPE_API_SSL_CA_FILE="/etc/ssl/certs/landscape_server_ca.crt"
@Guitsou
Guitsou / if-simple.md
Last active December 17, 2015 10:49
Exemple de if sous Bash

Simple

Simple

#!/bin/bash
if [ "foo" = "foo" ]; then
    echo expression evaluated as true
fi

Complet