[root@vm-2-100 ~]# cat /etc/ipsec.conf
# /etc/ipsec.conf - Openswan IPsec configuration file
#
# Manual: ipsec.conf.5
#
# Please place your own config files in /etc/ipsec.d/ ending in .conf
version 2.0 # conforms to second version of ipsec.conf specification
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
TOKEN=$(curl -X PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600") | |
curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/ | |
curl -H "X-aws-ec2-metadata-token: $TOKEN" -v http://169.254.169.254/latest/meta-data/ami-id | |
## Creds | |
curl -H "X-aws-ec2-metadata-token: $TOKEN" -sS http://169.254.169.254/latest/meta-data/iam/security-credentials | |
curl -H "X-aws-ec2-metadata-token: $TOKEN" -sS http://169.254.169.254/latest/meta-data/iam/security-credentials/test-yann-instanceprofile01|jq | |
export AWS_ACCESS_KEY_ID="ASIA2*REDACTED*" |
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
Task 1: Create a project jumphost instance | |
Navigation menu > Compute engine > VM Instance | |
Task 2: Create a Kubernetes service cluster | |
gcloud config set compute/zone us-east1-b | |
gcloud container clusters create nucleus-webserver1 |
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
sudo dnf install gcc libvirt libvirt-devel libxml2-devel make ruby-devel | |
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64" vagrant plugin install vagrant-libvirt | |
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib64" vagrant plugin install vagrant-mutate |
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/python | |
# -*- encoding: utf-8; py-indent-offset: 4 -*- | |
# vim: :set ts=8 et sw=4 sts=4 | |
import glob, sys | |
def CleanTmpDir(): | |
folder = '/tmp' | |
import os | |
for the_file in os.listdir(folder): |
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
## sed fichier /etc/hosts | |
sed -n '/HostsBegin/,/HostsEnd/p' /etc/hosts|\ | |
egrep -v '^[[:space:]]*$|^#' |\ | |
while read ipaddr hn x; do | |
if ! ping -c 2 -W 2 $ipaddr >/dev/null 2>&1; then | |
echo $ipaddr $hn unreachable | |
fi | |
done |
As configured in my dotfiles.
start new:
tmux
start new with session 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
# csv | |
import csv | |
file_csv = '' | |
csvfile = open(file_csv, 'rb') | |
reader = csv.reader(csvfile) | |
for row in reader: | |
print row | |
import csv |
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 os | |
scsi = os.popen('lsscsi').read().rstrip().split('\n') | |
for l in [s.split() for s in scsi]: | |
print l[0], l[-1] |
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
==== IAAS / Q5 ==== | |
ca = i.config.cloudApiConnection.find('main') | |
volid = 'c0a12a612e5946ea' | |
ca.disk.find(id = volid) | |
volguid = ca.disk.find(id = volid)['result'][0] | |
volguid | |
ca.disk.getObject(volguid) |
NewerOlder