#!/bin/bash
if [ "foo" = "foo" ]; then
echo expression evaluated as true
fi
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"
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 | |
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 |
URL pour obtenir les infos pour l'api :
http://sta1.mios.com/locator_json.php?username=XXX
##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
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
import smtplib | |
SERVER = "localhost" | |
FROM = "[email protected]" | |
TO = ["[email protected]"] # must be a list | |
SUBJECT = "Hello!" | |
TEXT = "This message was sent with Python's smtplib." |
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
import smtplib | |
fromaddr = '[email protected]' | |
toaddrs = '[email protected]' | |
msg = 'There was a terrible error that occured and I wanted you to know!' | |
# Credentials (if needed) | |
username = 'username' | |
password = 'password' |
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
http://blog.xn--hry-bma.com/article9/configurer-un-reverse-proxy-apache-http-https |
OlderNewer