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
# Load the admin credentials | |
. /root/openrc | |
# Creating the external network type VLAN with VLAND ID == 300 (Online_dev). | |
# The name of the provider physical_network "ext" is mapped to a physical | |
# device on the ML2 configuration file of each network node | |
neutron net-create \ | |
--provider:network_type vlan \ | |
--provider:physical_network ext \ | |
--router:external \ |
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/env bash | |
cat <<EOF | |
http://www.kernel.org/doc/Documentation/vm/ksm.txt : | |
The effectiveness of KSM and MADV_MERGEABLE is shown in /sys/kernel/mm/ksm/: | |
pages_shared - how many shared pages are being used | |
pages_sharing - how many more sites are sharing them i.e. how much saved | |
pages_unshared - how many pages unique but repeatedly checked for merging | |
pages_volatile - how many pages changing too fast to be placed in a tree |
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
GITHUB_URL = Public repo on GitHub. | |
BITBUCKET_URL = Private repo on Bitbucket. | |
Given a upstream repo on GitHub in order to clone it to Bitbucket to keep | |
the configuration non public (for example, to create specific ansible playbooks | |
with a set of roles), do this (only once!). | |
1. Create a new repo on Bitbucket. (BITBUCKET_URL) | |
2. Clone the upstream repo from Github to your local machine: git clone GITHUB_URL | |
3. git remote rename origin upstream BITBUCKET_URL |
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
# Examples | |
# Debug syscalls for a daemon | |
strace -e poll,select,connect,recvfrom,sendto nc www.news.com 80 | |
# Attach to process and sent to output.txt | |
strace -c -p 11084 -o output.txt | |
# Check permissions | |
strace -e open,read,access ls 2>&1 | grep your-filename |
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
Create a playbook called deploy_role.yml: | |
- hosts: {{ hosts }} | |
roles: {{ roles }} | |
And then you can do: | |
ansible-playbook deploy_role.yml -e hosts=somehost -e roles=somerole |
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
root@node-11:~# nova hypervisor-list | |
+----+--------------------------+ | |
| ID | Hypervisor hostname | | |
+----+--------------------------+ | |
| 3 | node-8 | | |
| 6 | node-12 | | |
| 9 | node-15 | | |
+----+--------------------------+ | |
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
# To control the way the scheduler select the host where running a vm: | |
# Default value is 1.0, negative means that will pack vms on one host | |
ram_weight_multiplier = -1.0 | |
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/env bash | |
download() { | |
local url="$1" | |
local destin="$2" | |
echo -n " " | |
if [ ! -z "${destin}" ]; then | |
wget --progress=dot "${url}" -O "${destin}" 2>&1 | grep --line-buffered "%" | \ | |
sed -u -e "s,\.,,g" | awk '{printf("\b\b\b\b%4s", $2)}' |
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 java.io.ByteArrayInputStream; | |
import java.io.File; | |
import java.util.List; | |
import com.amazonaws.auth.AWSCredentials; | |
import com.amazonaws.auth.BasicAWSCredentials; | |
import com.amazonaws.util.StringUtils; | |
import com.amazonaws.services.s3.AmazonS3; | |
import com.amazonaws.services.s3.AmazonS3Client; | |
import com.amazonaws.services.s3.model.Bucket; | |
import com.amazonaws.services.s3.model.CannedAccessControlList; |
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 | |
TENANT=cf | |
PASSWORD=cf | |
TENANT_DESC="Cloud Foundry" | |
TENANT_EMAIL="cloud-foundry@springer.com" | |
TENANT_NET="10.0.1.0/24" | |
TENANT_NET_GW="10.0.1.1" | |
export OS_USERNAME=admin |